Showing posts with label source. Show all posts
Showing posts with label source. Show all posts

Wednesday, March 21, 2012

exponential value

I am using data flow. source is ole db and target is flat file (csv). I run sql server stored procedure in source and mapped all columns to target file.

Value "-5.0000000000000003E-2" is giving me hard time. It's coming in target file how can remove exponential before writing to target file. In source table that value is coming from float type column. I would like to use some function in select sql if I can.

Thank you - Ashok

Well, that is not a "number" (it's text), so of course you're going to have problems.

How are you extracting from the source table? Do you really need precision to 1e-16? Perhaps you should apply some bounds to the source data before extracting. I think in any application, the value of -0.05 would be appropriate in your case.|||

sorry it's just -5.0000000000000003E-2

I should not have put " in my question.

I have simple select sql in stored procedure which gets that data some thing like select qty from tablename

You are correct I just want -0.05 in my target file.

|||The fact there is an "E" in your data (not to mention the second negative sign) indicates to any parser that the data is text -- most likely.

Regardless, you should convert the data in your SQL statement. Something like this perhaps: (would give you 4 decimal places)

SELECT CAST(qty as decimal(20,4)) as qty
FROM tablename|||

I used CAST(endqty as DECIMAL(10,4)) AS Quantity,in my sql but still get -5.0000000000000003E-2 value in my target file. Looks nothing working I tried to create new table with endqty decimal(18,3) and select from that table but same. when I run stored procedure in management studio I see -0.0500 but in file it not coming same.

when i looked in connection of the .csv file data type is double-precision float [DT_R8] but this is all generated I have not changed any .

Thanks - Ashok

Now I tried change to decimal [DT_DECIMAL] in csv connection for Quantity still same result.

|||

Ashok Ojha wrote:

I used CAST(endqty as DECIMAL(10,4)) AS Quantity,in my sql but still get -5.0000000000000003E-2 value in my target file. Looks nothing working I tried to create new table with endqty decimal(18,3) and select from that table but same. when I run stored procedure in management studio I see -0.0500 but in file it not coming same.

when i looked in connection of the .csv file data type is double-precision float [DT_R8] but this is all generated I have not changed any .

Thanks - Ashok

I'd rebuild the source connections/data flows if possible, using the CAST statement in your source query.|||

I removed whole data flow and connection and strated again.

Now I am in Flat file connection manager edior -> columns and I see Quantity coming as -5.00000000000003E-2 which is not good

when I go in Advanced - DataType I see numeric [DT_NUMERIC] data precision 10 data scale 4

in preview also Quantity coming as -5.00000000000003E-2

Lets see what happen when I run.

You are the man. worked. in target file -.0500

THANK YOU - Phil Brammer
.

Exploring SSIS

I have started exploring SSIS

My Requirement is exactly like Data Driven Query Task in SQL 2000 DTS

Scenario :

1. I Have a Source & Destination Table. Let's say S- Source Table, D - Destination Table.

2. I want to insert rows from S table to D table which are not available in table D

3. I want to update the rows in table D for which I have the records in both the table S as well as D

4. I can make use of a column called 'C1' to find out the rows exists in destination table or not

5. I want to Track/Trap the source as well as destination error rows.

I achieved the functionality as follows.

1. I Added OLEDB Source to fetch the record from table S (Source) (Configured to direct error output to "Redirect Row")

2. On an error or failure at source event I am directing the row to "OLEDB Command " (I will get rows failed at source

3. I added Row count transformation to find out the rows failed & source & I populated the value in package level variable

3. On Success - I added a lookup Transformation

4. On Failure (We need to trigger Insert) the two folows I added 2 different "OLEDB Commands" for insert & update.

5 Subsequent to Both of OLEDB Command transformations I added row count transformations to get the rows succeeded & failed at destination through 2 differnet row count transformation for each of OLEDB Command transformation. It serves my purpose. but I am not sure whethere this is the efficient way of doing this or there is any alternative avaiable to the same

Come on over and post this in the SSIS forum...

http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=80&SiteID=1

Friday, February 24, 2012

Existing project Where do I reset the connection string in the data source?

I closed and opened up my project again - now in the data tab, I get:
The query could not be loaded
Verify your connection string and query string
I have looked and looked - where do I find a menu item with either the Data
Source or the connection string, so I can check it out?On Jan 9, 10:47 am, "Elmo Watson" <s...@.here.com> wrote:
> I closed and opened up my project again - now in the data tab, I get:
> The query could not be loaded
> Verify your connection string and query string
> I have looked and looked - where do I find a menu item with either the Data
> Source or the connection string, so I can check it out?
In BIDS, you will want to open the Solution Explorer (via: Ctrl + Alt
+ L) >> then right-click a Data Source below Shared Data Sources/etc
>> select Open and the Connection string appears there. Hope this
helps.
Regards,
Enrique Martinez
Sr. Software Consultant|||That's the problem -
apparently, when I created the report - it wasn't with the wizard, so I
didn't check the 'shared' checkbox.
Is there any way to get to the data source at this point?
"EMartinez" <emartinez.pr1@.gmail.com> wrote in message
news:6f710d59-fd4d-49ae-9a12-1abf6df99fa1@.l32g2000hse.googlegroups.com...
> On Jan 9, 10:47 am, "Elmo Watson" <s...@.here.com> wrote:
>> I closed and opened up my project again - now in the data tab, I get:
>> The query could not be loaded
>> Verify your connection string and query string
>> I have looked and looked - where do I find a menu item with either the
>> Data
>> Source or the connection string, so I can check it out?
>
> In BIDS, you will want to open the Solution Explorer (via: Ctrl + Alt
> + L) >> then right-click a Data Source below Shared Data Sources/etc
>> select Open and the Connection string appears there. Hope this
> helps.
> Regards,
> Enrique Martinez
> Sr. Software Consultant|||Later, I added a shared data source - created a new report, using that data
source, and now when I open the project and try to run that report, it tries
to access the original (unshared) data source
I'm totally confused now
"Elmo Watson" <sm@.here.com> wrote in message
news:%23VhUK9tUIHA.6060@.TK2MSFTNGP05.phx.gbl...
>I closed and opened up my project again - now in the data tab, I get:
> The query could not be loaded
> Verify your connection string and query string
> I have looked and looked - where do I find a menu item with either the
> Data Source or the connection string, so I can check it out?
>
>|||On Jan 11, 9:15 am, "Elmo Watson" <s...@.here.com> wrote:
> Later, I added a shared data source - created a new report, using that data
> source, and now when I open the project and try to run that report, it tries
> to access the original (unshared) data source
> I'm totally confused now
> "Elmo Watson" <s...@.here.com> wrote in message
> news:%23VhUK9tUIHA.6060@.TK2MSFTNGP05.phx.gbl...
> >I closed and opened up my project again - now in the data tab, I get:
> > The query could not be loaded
> > Verify your connection string and query string
> > I have looked and looked - where do I find a menu item with either the
> > Data Source or the connection string, so I can check it out?
You might try deleting the original data source and then recreate the
report. Also, you could try to open the raw RDL file with a text
editor (i.e., Notepad) and change the <DataSources> tag, etc to the
correct datasource. Hope this helps.
Regards,
Enrique Martinez
Sr. Software consultant