Showing posts with label dts. Show all posts
Showing posts with label dts. Show all posts

Friday, March 30, 2012

I hate this

I'm migrating a fu... dts to SSIS. That's fine. I've got a derived column task for stuff as cdbl(DTSSource("Col014") /100).

But how the source plain file have a lot of columns suddenly I find this:

Function Main()


Fecha=Right(DTSSource("Col014"),2) & "-" & Mid(DTSSource("Col014"),5,2) & "-" & left(DTSSource("Col014"),4)
If IsDate(Fecha) then
DTSDestination("FechaOp") =Fecha
Else
DTSDestination("FechaOp")=null
End IF
Main = DTSTransformStat_OK
End Function

So that 'Derived Column' is useless at all for to encompass this rule unless to anyone be able to tell me how to implement that conditional snippet inside...

I'll be to use a Script Component Task only for that dammed column when the rest ones already defined.

!!!!

Do y'know hare and tortoise tale? So here is the same but in reverse order. jezz|||

There is a conditional operator in the SSIS expression language. It will do what you need to do.

Here's the BOL topic on it: http://msdn2.microsoft.com/en-us/library/ms141680(SQL.90).aspx

-Jamie

|||Thanks Jamie. hurries doesn't provide us good advices..|||

OK.

I've taken as example this and then I've converted into this line:

'Fecha = Right(DTSSource("Col014"), 2) & "-" & Mid(DTSSource("Col014"), 5, 2) & "-" & Left (DTSSource("Col014"), 4)
'If IsDate(Fecha) Then
' = Fecha
'Else
'DTSDestination("FechaOp") = null
'End If

Isdate(Right([Column 13],2) & "/" & Mid([Column13],5,2) & "/" & Left([Column13],4)) ? [Column13] : Nothing

But fails:

Error at CargaModelo187 [Derived Column [10345]]: Attempt to find the input column named "Column13" failed with error code 0xC0010009. The input column specified was not found in the input column collection.

Error at CargaModelo187 [Derived Column [10345]]: Attempt to parse the expression "Isdate(Right([Column 13],2) & "/" & Mid([Column13],5,2) & "/" & Left([Column13],4)) ? [Column13] : Nothing" failed and returned error code 0xC00470A2. The expression cannot be parsed. It might contain invalid elements or it might not be well-formed. There may also be an out-of-memory error.

Error at CargaModelo187 [Derived Column [10345]]: Cannot parse the expression "Isdate(Right([Column 13],2) & "/" & Mid([Column13],5,2) & "/" & Left([Column13],4)) ? [Column13] : Nothing". The expression was not valid, or there is an out-of-memory error.

Error at CargaModelo187 [Derived Column [10345]]: The expression "Isdate(Right([Column 13],2) & "/" & M

id([Column13],5,2) & "/" & Left([Column13],4)) ? [Column13] : Nothing" on "input column "Column 13" (11693)" is not valid.

Error at CargaModelo187 [Derived Column [10345]]: Failed to set property "Expression" on "input column "Column 13" (11693)".


Let me know which is the next step or what guidelines must I follow on this issue.

|||

In your expression you refer to "Column13" but the SSIS error message shows that the column in the data flow is in fact named "Column 13"

Donald

|||

A couple other things:

The expression language does not have an IsDate() function. What exactly are you testing for with that? Itstill might be possible, depending what you are looking for...

There is also Left() function -- you should use Substring() for that.

Instead of "Nothing", you need to use the NULL() functions, which are strictly typed.

|||

Mark Durley wrote:

There is also Left() function -- you should use Substring() for that.

Another alternative to the lack of a LEFT() function is RIGHT(REVERSE())

-Jamie

|||Thanks a lot to all of you|||

Well, this follow failing:

Right([Column 13],2) & "/" & SubString([Column 13],5,2) & "/" & SubString([Column 13],1,4) ? [Column 13] : Nothing

Column 13 on the first row own this value:

20050214

TITLE: Microsoft Visual Studio

Error at CargaModelo187 [Derived Column [10345]]: Attempt to find the input column named "Nothing" failed with error code 0xC0010009. The input column specified was not found in the input column collection.

Error at CargaModelo187 [Derived Column [10345]]: Attempt to parse the expression "Right([Column 13],2) & "/" & SubString([Column 13],5,2) & "/" & SubString([Column 13],1,4) ? [Column 13] : Nothing" failed and returned error code 0xC00470A2. The expression cannot be parsed. It might contain invalid elements or it might not be well-formed. There may also be an out-of-memory error.

Error at CargaModelo187 [Derived Column [10345]]: Cannot parse the expression "Right([Column 13],2) & "/" & SubString([Column 13],5,2) & "/" & SubString([Column 13],1,4) ? [Column 13] : Nothing". The expression was not valid, or there is an out-of-memory error.

Error at CargaModelo187 [Derived Column [10345]]: The expression "Right([Column 13],2) & "/" & SubString([Column 13],5,2) & "/" & SubString([Column 13],1,4) ? [Column 13] : Nothing" on "input column "Column 13" (12091)" is not valid.

Error at CargaModelo187 [Derived Column [10345]]: Failed to set property "Expression" on "input column "Column 13" (12091)".


ADDITIONAL INFORMATION:

Exception from HRESULT: 0xC0204006 (Microsoft.SqlServer.DTSPipelineWrap)


BUTTONS:

OK

|||

I was wrong although this new line-version fails too...

[Derived Column 1] == Right([Column 13],2) & "/" & SubString([Column 13],5,2) & "/" & SubString([Column 13],1,4)

Thanks in advance,

|||

It's already solved.

Instead of & you must use + and drop '[Derived Column 1] =='

RIGHT([Column 13],2) + "/" + SUBSTRING([Column 13],5,2) + "/" + SUBSTRING([Column 13],1,4)

IsDate function is not necessary because of I saw concretly in that file that all of them have the same structure yyyymmdd

|||In any case what function is intented do the same that ISDATE?|||

There is no function that can do IsDate. As Mark suggested there may be possibilities using other functions - checking that a string has certain characters and that substrings, can be cast to valid integers - but that expression would likely be rather complex.

Script component does all this really nicely, of course.

Donald

I found a bug in MSSQL DTS import wizard

We have a textfile that we import in Excel(provided by our mainframe folks).
It's fixed width with 142 columns. When I import it in excel or ms access,
it gives me about ~34000 rows. But when I import using DTS package that is
exported to Access mdb, rows becomes ~17000 rows
And another hurdle that I'm faced is that there are rows that contains
combined data such as street, city and state all together without spaces.
Unfortunately, we can't modify the source text file. However, I do have a
fieldmarker(save a .txt file) which I always use in Excel so that when I
import it, I can select the area to create a vertical line just right that
marker.
Here is a sample of my fieldmarker.
12345p1234567p12pp123456p
Everytime i see a p, I click it with a mouse to create a vertical line in
fixed width importing. In that case, there are 5 columns. These are all
similar to ms access or excel.
The bug.
Please see this link below about the bug I found in MSSQL DTS Import wizard.
It doesn't happen in Excel or MS Access. Excel and MS Access can handle it
properly.
http://restricted.dyndns.org/dtsimportissue.html
Please help. Solution needed very badly!
Thanks,
Neil
"Neil" <neil-on-ht@.restricted.dyndns.org> wrote in message
news:Oj$m4gz5EHA.1292@.TK2MSFTNGP10.phx.gbl...
> We have a textfile that we import in Excel(provided by our mainframe
> folks). It's fixed width with 142 columns. When I import it in excel or ms
> access, it gives me about ~34000 rows. But when I import using DTS package
> that is exported to Access mdb, rows becomes ~17000 rows
> And another hurdle that I'm faced is that there are rows that contains
> combined data such as street, city and state all together without spaces.
> Unfortunately, we can't modify the source text file. However, I do have a
> fieldmarker(save a .txt file) which I always use in Excel so that when I
> import it, I can select the area to create a vertical line just right that
> marker.
> Here is a sample of my fieldmarker.
> 12345p1234567p12pp123456p
> Everytime i see a p, I click it with a mouse to create a vertical line in
> fixed width importing. In that case, there are 5 columns. These are all
> similar to ms access or excel.
> The bug.
> Please see this link below about the bug I found in MSSQL DTS Import
> wizard. It doesn't happen in Excel or MS Access. Excel and MS Access can
> handle it properly.
> http://restricted.dyndns.org/dtsimportissue.html
> Please help. Solution needed very badly!
It looks as though DTS is using the CRLF in the first line to define the
line lengths, and concatenating data in the rows because they are too short
and therefore incomplete records. What happens if you trim the first line
back to the same length as the other lines? Or how about padding the lines
out so they are all the same length?
According to http://support.microsoft.com/default...b;en-us;271247
if any rows are longer than expected then additional characters appear
wrapped in the DTS wizard, but are actually discarded.
However, in article
http://support.microsoft.com/default...b;en-us;247360 it mentions
that DTS expects a fixed length file to have lines of fixed length, and
having shorter lines will cause additional characters to be read from the
next line.
So the answer appears to be that in a fixed length import, make sure every
line is the same length to avoid this problem.
Dan
|||"Daniel Crichton" <msnews@.worldofspack.co.uk> wrote in message
news:uZDTPI05EHA.3076@.TK2MSFTNGP15.phx.gbl...
> It looks as though DTS is using the CRLF in the first line to define the
> line lengths, and concatenating data in the rows because they are too
> short and therefore incomplete records. What happens if you trim the first
> line back to the same length as the other lines? Or how about padding the
> lines out so they are all the same length?
> According to
> http://support.microsoft.com/default...b;en-us;271247 if any rows
> are longer than expected then additional characters appear wrapped in the
> DTS wizard, but are actually discarded.
> However, in article
> http://support.microsoft.com/default...b;en-us;247360 it
> mentions that DTS expects a fixed length file to have lines of fixed
> length, and having shorter lines will cause additional characters to be
> read from the next line.
> So the answer appears to be that in a fixed length import, make sure every
> line is the same length to avoid this problem.
>
Ok. Then we're out of luck then. I will contact the vendor if there will be
data for those columns in the future. If not, I can just delete it for now
to avoid the problem. It's just that MS Excel and Access support it. I don't
know why they didn't do that for DTS
Thanks.
Neil
|||Neil,
I don't quite understand your explanation or the online example. You
say this is a fixed-width file, but the example you give online shows a
first line that is much longer than the second line. Fixed-width means
every line of the text file has the same length. Your file has lines of
different lengths, but it also doesn't have a separator character
between each column, so the wizard won't help you, and you'll need to do
something else, I guess.
Maybe one of these will work:
Import using BULK INSERT with a format file.
Preprocess the file with Unix-like utilities to add delimiters, then
import as delimited
Import the file into a staging table with one long column, then split
it up with
insert into FinalDestinationTable
select substring(s,1,4), substring(s,5,7), ...
Steve Kass
Drew University
Neil wrote:

>We have a textfile that we import in Excel(provided by our mainframe folks).
>It's fixed width with 142 columns. When I import it in excel or ms access,
>it gives me about ~34000 rows. But when I import using DTS package that is
>exported to Access mdb, rows becomes ~17000 rows
>And another hurdle that I'm faced is that there are rows that contains
>combined data such as street, city and state all together without spaces.
>Unfortunately, we can't modify the source text file. However, I do have a
>fieldmarker(save a .txt file) which I always use in Excel so that when I
>import it, I can select the area to create a vertical line just right that
>marker.
>Here is a sample of my fieldmarker.
>12345p1234567p12pp123456p
>Everytime i see a p, I click it with a mouse to create a vertical line in
>fixed width importing. In that case, there are 5 columns. These are all
>similar to ms access or excel.
>The bug.
>Please see this link below about the bug I found in MSSQL DTS Import wizard.
>It doesn't happen in Excel or MS Access. Excel and MS Access can handle it
>properly.
>http://restricted.dyndns.org/dtsimportissue.html
>Please help. Solution needed very badly!
>Thanks,
>Neil
>
>
|||Sorry if my example is to confusing. The first row is actually coming
from a different text file. I call it field separator. I just wrote that
website for reference. My real field separator is about 2,050 characters
long. the data really starts at row 2 and they are all in fixed length.
Going back to the field separators, I use it only so that when I import
it using Fixed width, I will be able to tell where I need to click the
mouse.
Let say the mainframe file specs goes like this:
loanno text(10)
datewritten text(8)
code text(2)
state text(2)
zipcode text(5)
firstname text(5)
lastname text(5)
If the data was like this, it would have been ok
1234567890 12/21/04 DD IL 60061 frank burns
1234567891 12/21/04 DD IL 60061 ana saige
1234567892 12/21/04 DD IL 60061 polly yuigo
1234567893 12/21/04 DD IL 60061 jake snake
But our mainframe data is like this,
123456789012/21/04DDIL60061frankburns
123456789112/21/04DDIL60061ana saige
123456789212/21/04DDIL60061pollyyuigo
123456789312/21/04DDIL60061jake snake
For that example, I could have come up with a field marker like this
123456789p1234567p1p1p1234p1234p1234p. It works great in Excel and
Access. The p marker is just for me. It can be any. Unfortunately, the
target table for the DTS have more columns. I tried modify the data
above but still, DTS is importing it improperly. It's not intelligent
enough to pad it with blank spaces. I can pad using a different tool but
that's not a good solution. That's another point of failure.
I tried this data,
123456789012/21/04DDIL60061frankburns
123456789112/21/04DDIL60061ana saige
123456789212/21/04DDIL60061pollyyuigo
123456789312/21/04DDIL60061jake snakeBBBCCCCCDDDD
the data was still concatenated with the previous lines. So looks like,
DTS import is not honoring the {CR}{LF} but I'm 100% very sure that
there is an {CR}{LF}
Like what I said, it works perfect in Excel and Access. So I guess, this
is still considered a bug.
Thanks.
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!
|||I found a better solution in MS Access. I found it inside the Advanced
button when we do the import table wizard.
It's the table specification. It's awesome. Is this possible in DTS?
Thanks.
"Neil Camara" <neil-on-ht@.restricted.dyndns.org> wrote in message
news:ea%23nwe75EHA.2568@.TK2MSFTNGP10.phx.gbl...
> Sorry if my example is to confusing. The first row is actually coming
> from a different text file. I call it field separator. I just wrote that
> website for reference. My real field separator is about 2,050 characters
> long. the data really starts at row 2 and they are all in fixed length.
> Going back to the field separators, I use it only so that when I import
> it using Fixed width, I will be able to tell where I need to click the
> mouse.
> Let say the mainframe file specs goes like this:
> loanno text(10)
> datewritten text(8)
> code text(2)
> state text(2)
> zipcode text(5)
> firstname text(5)
> lastname text(5)
> If the data was like this, it would have been ok
> 1234567890 12/21/04 DD IL 60061 frank burns
> 1234567891 12/21/04 DD IL 60061 ana saige
> 1234567892 12/21/04 DD IL 60061 polly yuigo
> 1234567893 12/21/04 DD IL 60061 jake snake
> But our mainframe data is like this,
>
> 123456789012/21/04DDIL60061frankburns
> 123456789112/21/04DDIL60061ana saige
> 123456789212/21/04DDIL60061pollyyuigo
> 123456789312/21/04DDIL60061jake snake
> For that example, I could have come up with a field marker like this
> 123456789p1234567p1p1p1234p1234p1234p. It works great in Excel and
> Access. The p marker is just for me. It can be any. Unfortunately, the
> target table for the DTS have more columns. I tried modify the data
> above but still, DTS is importing it improperly. It's not intelligent
> enough to pad it with blank spaces. I can pad using a different tool but
> that's not a good solution. That's another point of failure.
> I tried this data,
> 123456789012/21/04DDIL60061frankburns
> 123456789112/21/04DDIL60061ana saige
> 123456789212/21/04DDIL60061pollyyuigo
> 123456789312/21/04DDIL60061jake snakeBBBCCCCCDDDD
> the data was still concatenated with the previous lines. So looks like,
> DTS import is not honoring the {CR}{LF} but I'm 100% very sure that
> there is an {CR}{LF}
> Like what I said, it works perfect in Excel and Access. So I guess, this
> is still considered a bug.
> Thanks.
>
>
>
> *** Sent via Developersdex http://www.codecomments.com ***
> Don't just participate in USENET...get rewarded for it!
|||Sorry, Neil, but I still don't understand. You have a text file with
equal length lines, and with <CRLF> ending each line, and dts doesn't
respect the end-of-line markers? You say you are 100% very sure that
there is an {CR}{LF}. Have you used a hex editor to be certain?
My earlier suggest to use BULK INSERT may work for you if indeed this is
a bug. You can specify a format file and bulk insert into a table that
has already been created.
SK
Neil Camara wrote:

>Sorry if my example is to confusing. The first row is actually coming
>from a different text file. I call it field separator. I just wrote that
>website for reference. My real field separator is about 2,050 characters
>long. the data really starts at row 2 and they are all in fixed length.
>Going back to the field separators, I use it only so that when I import
>it using Fixed width, I will be able to tell where I need to click the
>mouse.
>Let say the mainframe file specs goes like this:
>loanno text(10)
>datewritten text(8)
>code text(2)
>state text(2)
>zipcode text(5)
>firstname text(5)
>lastname text(5)
>If the data was like this, it would have been ok
>1234567890 12/21/04 DD IL 60061 frank burns
>1234567891 12/21/04 DD IL 60061 ana saige
>1234567892 12/21/04 DD IL 60061 polly yuigo
>1234567893 12/21/04 DD IL 60061 jake snake
>But our mainframe data is like this,
>
>123456789012/21/04DDIL60061frankburns
>123456789112/21/04DDIL60061ana saige
>123456789212/21/04DDIL60061pollyyuigo
>123456789312/21/04DDIL60061jake snake
>For that example, I could have come up with a field marker like this
>123456789p1234567p1p1p1234p1234p1234p. It works great in Excel and
>Access. The p marker is just for me. It can be any. Unfortunately, the
>target table for the DTS have more columns. I tried modify the data
>above but still, DTS is importing it improperly. It's not intelligent
>enough to pad it with blank spaces. I can pad using a different tool but
>that's not a good solution. That's another point of failure.
>I tried this data,
>123456789012/21/04DDIL60061frankburns
>123456789112/21/04DDIL60061ana saige
>123456789212/21/04DDIL60061pollyyuigo
>123456789312/21/04DDIL60061jake snakeBBBCCCCCDDDD
>the data was still concatenated with the previous lines. So looks like,
>DTS import is not honoring the {CR}{LF} but I'm 100% very sure that
>there is an {CR}{LF}
>Like what I said, it works perfect in Excel and Access. So I guess, this
>is still considered a bug.
>Thanks.
>
>
>
>*** Sent via Developersdex http://www.codecomments.com ***
>Don't just participate in USENET...get rewarded for it!
>
|||"Steve Kass" <skass@.drew.edu> wrote in message
news:OKuZfY%235EHA.2876@.TK2MSFTNGP12.phx.gbl...
> Sorry, Neil, but I still don't understand. You have a text file with
> equal length lines, and with <CRLF> ending each line, and dts doesn't
> respect the end-of-line markers? You say you are 100% very sure that
> there is an {CR}{LF}. Have you used a hex editor to be certain?
See my earlier reply with articles from the MS KB that mention that the
fixed width import requires all lines to be the same length, otherwise it
concatenates the data from successive lines to pad shorter lines out. Looks
like the CRLF is only used for the first line to determine the fixed row
length, all other lines are then dealt with using that length - extra
characters on lines are discarded, lines that are too short are treated as
continuing onto the next line.
Dan
|||Ok then. I'd have to accept that that is the way DTS works. I have to
fix my source by padding spaces. I can only say that Access or Excel
pads everything automatically for us. At least, that article explains
what I have found out.
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!
sql

I found a bug in MSSQL DTS import wizard

We have a textfile that we import in Excel(provided by our mainframe folks).
It's fixed width with 142 columns. When I import it in excel or ms access,
it gives me about ~34000 rows. But when I import using DTS package that is
exported to Access mdb, rows becomes ~17000 rows :(
And another hurdle that I'm faced is that there are rows that contains
combined data such as street, city and state all together without spaces.
Unfortunately, we can't modify the source text file. However, I do have a
fieldmarker(save a .txt file) which I always use in Excel so that when I
import it, I can select the area to create a vertical line just right that
marker.
Here is a sample of my fieldmarker.
12345p1234567p12pp123456p
Everytime i see a p, I click it with a mouse to create a vertical line in
fixed width importing. In that case, there are 5 columns. These are all
similar to ms access or excel.
The bug.
Please see this link below about the bug I found in MSSQL DTS Import wizard.
It doesn't happen in Excel or MS Access. Excel and MS Access can handle it
properly.
http://restricted.dyndns.org/dtsimportissue.html
Please help. Solution needed very badly!
Thanks,
Neil"Neil" <neil-on-ht@.restricted.dyndns.org> wrote in message
news:Oj$m4gz5EHA.1292@.TK2MSFTNGP10.phx.gbl...
> We have a textfile that we import in Excel(provided by our mainframe
> folks). It's fixed width with 142 columns. When I import it in excel or ms
> access, it gives me about ~34000 rows. But when I import using DTS package
> that is exported to Access mdb, rows becomes ~17000 rows :(
> And another hurdle that I'm faced is that there are rows that contains
> combined data such as street, city and state all together without spaces.
> Unfortunately, we can't modify the source text file. However, I do have a
> fieldmarker(save a .txt file) which I always use in Excel so that when I
> import it, I can select the area to create a vertical line just right that
> marker.
> Here is a sample of my fieldmarker.
> 12345p1234567p12pp123456p
> Everytime i see a p, I click it with a mouse to create a vertical line in
> fixed width importing. In that case, there are 5 columns. These are all
> similar to ms access or excel.
> The bug.
> Please see this link below about the bug I found in MSSQL DTS Import
> wizard. It doesn't happen in Excel or MS Access. Excel and MS Access can
> handle it properly.
> http://restricted.dyndns.org/dtsimportissue.html
> Please help. Solution needed very badly!
It looks as though DTS is using the CRLF in the first line to define the
line lengths, and concatenating data in the rows because they are too short
and therefore incomplete records. What happens if you trim the first line
back to the same length as the other lines? Or how about padding the lines
out so they are all the same length?
According to http://support.microsoft.com/default.aspx?scid=kb;en-us;271247
if any rows are longer than expected then additional characters appear
wrapped in the DTS wizard, but are actually discarded.
However, in article
http://support.microsoft.com/default.aspx?scid=kb;en-us;247360 it mentions
that DTS expects a fixed length file to have lines of fixed length, and
having shorter lines will cause additional characters to be read from the
next line.
So the answer appears to be that in a fixed length import, make sure every
line is the same length to avoid this problem.
Dan|||"Daniel Crichton" <msnews@.worldofspack.co.uk> wrote in message
news:uZDTPI05EHA.3076@.TK2MSFTNGP15.phx.gbl...
> It looks as though DTS is using the CRLF in the first line to define the
> line lengths, and concatenating data in the rows because they are too
> short and therefore incomplete records. What happens if you trim the first
> line back to the same length as the other lines? Or how about padding the
> lines out so they are all the same length?
> According to
> http://support.microsoft.com/default.aspx?scid=kb;en-us;271247 if any rows
> are longer than expected then additional characters appear wrapped in the
> DTS wizard, but are actually discarded.
> However, in article
> http://support.microsoft.com/default.aspx?scid=kb;en-us;247360 it
> mentions that DTS expects a fixed length file to have lines of fixed
> length, and having shorter lines will cause additional characters to be
> read from the next line.
> So the answer appears to be that in a fixed length import, make sure every
> line is the same length to avoid this problem.
>
Ok. Then we're out of luck then. I will contact the vendor if there will be
data for those columns in the future. If not, I can just delete it for now
to avoid the problem. It's just that MS Excel and Access support it. I don't
know why they didn't do that for DTS :(
Thanks.
Neil|||Neil,
I don't quite understand your explanation or the online example. You
say this is a fixed-width file, but the example you give online shows a
first line that is much longer than the second line. Fixed-width means
every line of the text file has the same length. Your file has lines of
different lengths, but it also doesn't have a separator character
between each column, so the wizard won't help you, and you'll need to do
something else, I guess.
Maybe one of these will work:
Import using BULK INSERT with a format file.
Preprocess the file with Unix-like utilities to add delimiters, then
import as delimited
Import the file into a staging table with one long column, then split
it up with
insert into FinalDestinationTable
select substring(s,1,4), substring(s,5,7), ...
Steve Kass
Drew University
Neil wrote:
>We have a textfile that we import in Excel(provided by our mainframe folks).
>It's fixed width with 142 columns. When I import it in excel or ms access,
>it gives me about ~34000 rows. But when I import using DTS package that is
>exported to Access mdb, rows becomes ~17000 rows :(
>And another hurdle that I'm faced is that there are rows that contains
>combined data such as street, city and state all together without spaces.
>Unfortunately, we can't modify the source text file. However, I do have a
>fieldmarker(save a .txt file) which I always use in Excel so that when I
>import it, I can select the area to create a vertical line just right that
>marker.
>Here is a sample of my fieldmarker.
>12345p1234567p12pp123456p
>Everytime i see a p, I click it with a mouse to create a vertical line in
>fixed width importing. In that case, there are 5 columns. These are all
>similar to ms access or excel.
>The bug.
>Please see this link below about the bug I found in MSSQL DTS Import wizard.
>It doesn't happen in Excel or MS Access. Excel and MS Access can handle it
>properly.
>http://restricted.dyndns.org/dtsimportissue.html
>Please help. Solution needed very badly!
>Thanks,
>Neil
>
>

Wednesday, March 28, 2012

I don't understand it

Dear all,
I'm executing a DTS which own a sql server task that launch a stored
procedure.
This stored procedure run a WHILE sentence and then launch a bcp command
dinamically.
Well, everything works debugging that stored procedure or simply launch it
throught Query Analyzer with its parameters.
Problem come up when I launch the DTS. That sql server task works but only
launch one time the BCP command.
I know that is very difficult reach to see the exit but...
There goes an excerpt:
set @.cont = 1
Set @.iCont = (select count(*) from tblDownloadKF_Bridge_Info)
WHILE @.cont < @.iCont + 1
begin
set @.table = (select name from tblDownloadKF_Bridge_Info where ID = @.cont)
SET @.bcpCommand= 'bcp ' + @.db + '' + @.table + ' out ' + @.strPath +
Ltrim(RTrim(@.table)) + '.dat -c -S ' + @.host + ' -U ' + @.strUser +' -P '
+
@.strPassword + ''
EXEC @.result = master.dbo.xp_cmdshell @.bcpCommand
if (@.result = 0)
set @.status = 'done'
else
set @.status = 'error'
update tblDownloadKF_Bridge_Info
set Remarks = Ltrim(Rtrim(@.status)),
dateoperation = getdate()
where ID = @.cont
set @.table = ''
set @.cont = @.cont + 1
end
GO
Is there any restriction on that command via DTS'
Thanks so much,Hi Enric,
Your problem is not the BCP command but xp_cmdshell stored procedure.
"INF: How to Run a DTS Package as a Scheduled Job"
http://support.microsoft.com/defaul...kb;en-us;269074
Cristian Lefter, SQL Server MVP
"Enric" <Enric@.discussions.microsoft.com> wrote in message
news:0C0CB603-97B8-40B0-9255-D6E3E3F245B3@.microsoft.com...
> Dear all,
> I'm executing a DTS which own a sql server task that launch a stored
> procedure.
> This stored procedure run a WHILE sentence and then launch a bcp command
> dinamically.
> Well, everything works debugging that stored procedure or simply launch it
> throught Query Analyzer with its parameters.
> Problem come up when I launch the DTS. That sql server task works but only
> launch one time the BCP command.
> I know that is very difficult reach to see the exit but...
> There goes an excerpt:
> set @.cont = 1
> Set @.iCont = (select count(*) from tblDownloadKF_Bridge_Info)
> WHILE @.cont < @.iCont + 1
> begin
> set @.table = (select name from tblDownloadKF_Bridge_Info where ID = @.cont)
>
> SET @.bcpCommand= 'bcp ' + @.db + '' + @.table + ' out ' + @.strPath +
> Ltrim(RTrim(@.table)) + '.dat -c -S ' + @.host + ' -U ' + @.strUser +' -P
> ' +
> @.strPassword + ''
> EXEC @.result = master.dbo.xp_cmdshell @.bcpCommand
> if (@.result = 0)
> set @.status = 'done'
> else
> set @.status = 'error'
> update tblDownloadKF_Bridge_Info
> set Remarks = Ltrim(Rtrim(@.status)),
> dateoperation = getdate()
> where ID = @.cont
> set @.table = ''
> set @.cont = @.cont + 1
> end
> GO
>
> Is there any restriction on that command via DTS'
> Thanks so much,

i don′t understand

i′m sorry my bad english

i have a dts in sql server 2005

for example in sql server 2000 i can do that :

over DTS right-clik choose option "Scheduled pachage" and this create a scheduled what i mean is that this produces a "JOB"

what i mean is that i need to know how can to create a scheduled to DTS′s in sql 2005

Please anyone of you provide some solution for this.

Okay, I completely misunderstood what you wanted before. But, I think I can help you now.

Once you have the SSIS package (DTS packages mean something else - like packages from SQL SERVER 2000 DTS) you can use SQL Server Agent to shedule the package to be run at a certain time.

Use the SQL Server Agent to schedule your package.

|||

sorry man:

what i do in sql server 2005 is:

right-click over SQL Server Agent , choose the option "New" and choose option "Schedule" but isn't what i want, may be i am not specfic

when i do right-click over dts in sql server 2000 and choose the option schedule package this produces an scheduled and i can see it in the part of the jobs

Now how i can do that in sql server 2005? i need to see of my DTSs the jobs that i created and you said me that i can do by SQL Server Agent in SQL server 2005 and this isn′t do what i want.

Please anyone of you provide some solution for this.
Thanks :)

|||

limon26,

I merged this post into your earlier thread. If you want to reply to another reply you should use the reply button and not the new thread button. This will keep the discussion in one thread and others that can help will be able to follow the discussion more easy.

Thanks.

|||

i apologies for that

so what can i do about my DTSs in sql server 2005 ?

|||

I am not that experienced with SSIS for 2005, hopefully swells or somebody else will be able to help you further...

|||

In SQL Server 2000, you could create a schedule by right-clicking on a package in Enteprise Manager and selecting "Schedule Package." SQL Server 2000 created the SQL Server Agent job. You could find the jobs in Enterprise Manager under the Management folder, in the jobs tree.

In SQL Server 2005 there are some changes ...

1. SQL Server Agent is not automatically enabled. Make sure the service has been started.

2. You do not automatically create scheduled jobs for SSIS. You should right click on the SQL Server Agent icon in the SQL Server Object Explorer in the Management Studio and select to create a new Agent Job. When you do that, you can add a new job step to execute an SSIS package. You can also add a new schedule.

The end result is similar to 2000 - jobs are listed under the SQL Server Agent node; jobs have steps - one step executes a package; and jobs have schedules.

An important difference is that SSIS now has an Agent subsytem for more better integrated execution.

hth

Donald

|||

After create your ssis package. Here is step you have to do to make a job run....

My ssis is running every 10 min.....

Here is what I do to make it work.......

Create the proxy account, And SQL Server Agent running under your NT Acount and then the job Steps running under the "SQL Agent Service Account" and your nt account as the owner of the job. It will works perfect.

I don't know if you know how to create proxy account. Here is how to create:

Use master

CREATE CREDENTIAL [MyCredential] WITH IDENTITY = 'yourdomain\myWindowAccount', secret = 'WindowLoginPassword'

Use msdb

Sp_add_proxy @.proxy_name='MyProxy', @.credential_name='MyCredential'

Sp_grant_login_to_proxy @.login_name=' devlogin', @.proxy_name='MyProxy'

Sp_grant_proxy_to_subsystem @.proxy_name='MyProxy', @.subsystem_name='SSIS'

Use master

CREATE CREDENTIAL [MyCredential] WITH IDENTITY = 'yourdomain\myWindowAccount', secret = 'WindowLoginPassword'

Use msdb

Sp_add_proxy @.proxy_name='MyProxy', @.credential_name='MyCredential'

Sp_grant_login_to_proxy @.login_name=' devlogin', @.proxy_name='MyProxy'

Sp_grant_proxy_to_subsystem @.proxy_name='MyProxy', @.subsystem_name='SSIS'

kenny

|||Similar problems, but (so far) the credentials/proxy doesn't seem to resolve it.

We have two people who have developed some SSIS packages, myself and

another developer. The other developer's SSIS package runs fine from

BIDS, DTexec and DTexecUI, but not from SQL Server agent. My SSIS

package runs fine from BIDS, DTexec, DTexecUI and local SQLServer

Agent. I haven't had the opportunity to have it deplyed into another

environment to check if I have problems from the server.

What was interesting to me, in attempting to test the credentials, was

that the working SQL Server Agent job, it I edit it to use the proxy,

fails. If I edit the job back to using the SQL Agent Service Account

(on the RUN AS tab on the task), then it works successfully.

Now this may be because I've set up the credential incorrectly, since

it was my first time (be gentle :-)). I'm going to try and modify the

script above and see if that works any better. The credential I set up

used a local user I created that was part of the powerusers group. The

package does file operations locally (based on the current

configuration file). The 'ProtectLevel' was set to

'EncryptSenstitiveWithPassword', and this specific test job is using

SQL Server as the package source.

Nay help? The KB http://support.microsoft.com/kb/918760 states that

this is ' This behavior is by design.' - but surely it should also be

easy to use?|||using the scipr (after removing the duplicate, and adding exec's), I

generated a proxy and a credential. The user being used is the same one

I create earlier (which is a member of the power user group on my

laptop). I get the following error:

-

Date 25/07/2006 14:21:59

Log Job History (Test Excel Orchestration)

Step ID 1

Server MyLaptop\SQL2005_SP1_TEST

Job Name Test Excel Orchestration

Step Name Invoke Excel Orchestration

Duration 00:00:01

Sql Severity 0

Sql Message ID 0

Operator Emailed

Operator Net sent

Operator Paged

Retries Attempted 0

Message

Executed as user: MyLaptop\SSISAgentJobCredUser. The package could not be loaded. The step failed.

-

this proves the credential at least worked - it did try to run with the correct user, but still no joy.

.... even less joy now, since I now get the following, trying to use this in the way that worked before:
Date 25/07/2006 14:27:45

Log Job History (Test Excel Orchestration)

Step ID 1

Server MyLaptop\RGALBRAITH\SQL2005_SP1_TEST

Job Name Test Excel Orchestration

Step Name Invoke Excel Orchestration

Duration 00:00:00

Sql Severity 0

Sql Message ID 0

Operator Emailed

Operator Net sent

Operator Paged

Retries Attempted 0

Message

Non-SysAdmins have been denied permission to run DTS Execution job steps without a proxy account. The step failed.|||

Hey,

Today I got the same error as you, to fixed I didn't create the credentials, I changed the owner for the Scheduled Jobs instead, and it's works great!

|||

I fixed this by adding the owner of the package to the owned schema's in the agent roles in msdb.

take a look at this link:

http://www.microsoft.com/technet/prodtechnol/sql/2005/newsqlagent.mspx

Monday, March 26, 2012

i can't save my DTS

here's my problem :
i've created a DTS with enterprise manager directly on the server, and
everything was ok for some days.
But i've modified this DTS on a distant computer and since i've done it,
i've an access denied message when i try to save or execute any dts on the
server. I've acces to everyting else on the entreprise manager (i'm using
a system administrators account) but the only thing i can do with the DTS
is deleting.
On the other side, i can do everything on the DTS on the distant computer.
pleaaaaaaaaaaase...help meeee !!!See if you can run the same commands that the DTS package is executing from
OSQL or ISQL.
Access Denied maybe permissions with the filesystem rather than DTS or SQL.
You can run FileMon.exe from www.sysinternals.com to see where the
permission problem is.
Hope this helps.
Kevin McDonnell
Microsoft Corporation
This posting is provided AS IS with no warranties, and confers no rights.|||What was the error message when saving the DTS package?
--
--
Satya SKJ
"jc@.leman-industrie.fr" wrote:

> here's my problem :
> i've created a DTS with enterprise manager directly on the server, and
> everything was ok for some days.
> But i've modified this DTS on a distant computer and since i've done it,
> i've an access denied message when i try to save or execute any dts on the
> server. I've acces to everyting else on the entreprise manager (i'm using
> a system administrators account) but the only thing i can do with the DTS
> is deleting.
> On the other side, i can do everything on the DTS on the distant computer.
> pleaaaaaaaaaaase...help meeee !!!
>

Monday, March 12, 2012

I believe that DTS would be most appropriate solution ..

After thinking about it more, I believe that DTS would be most appropriate
solution for what you are wanting to do: copy the contents of one table to
another table while performing data transformations. You can use a VBScript
or JScript task for performing the complex transformation. The DTS package
is a standard SQL Server approach, it can be contained within the database,
and can be scheduled via a job.
"nick" <nick@.discussions.microsoft.com> wrote in message
news:0B329B5A-860D-475B-BC24-DF284BEEE547@.microsoft.com...
> In fact, my question is
> Transact-SQL script "declare cursor" (fast forward) vs. Client side ADO
> code
> with fast forward server cursor
> Which one is better for very large rows?
>
> "nick" wrote:
>Thanks. In fact, each row of the very big table provides the parameters for
a
complex C++ function written by others. The source code is available but I
better not touch the C++ code since the author may upgrade. The C++ code wil
l
return quite a few values for each row and these values need to written in a
SQL table. The process is simple but the data amount is big.
Maybe use JScript in DTS to call an executible? But need to parse the
input/ouput...
"JT" wrote:

> After thinking about it more, I believe that DTS would be most appropriate
> solution for what you are wanting to do: copy the contents of one table to
> another table while performing data transformations. You can use a VBScrip
t
> or JScript task for performing the complex transformation. The DTS package
> is a standard SQL Server approach, it can be contained within the database
,
> and can be scheduled via a job.
> "nick" <nick@.discussions.microsoft.com> wrote in message
> news:0B329B5A-860D-475B-BC24-DF284BEEE547@.microsoft.com...
>
>|||What you just described is not really 'data transformation', but some type
of data entry that needs to be automated using a large list of parameters
supplied by a 3rd party. In that case, rather than DTS, I would suggest
writing a client side application that:
#1 Opens a forwardonly / readonly recordset recordset from the source
table
#2 Steps through the recorset from top to bottom (not really looping)
#3 For each record, call the C++ executable using parameters from the
record
#4 Write the result of each SP call to a tab delimited text file
#5 Once the last record has been processed, close the recordset, and use
the bulk copy utility (BCP.EXE) to load the tab delimited file into the
destination table.
#6 Truncate the source table?
I would not reccomend running the executable on the database server, becuase
it would provide only a marginal performance benefit but result in security,
deployment, and resource utilization issues.
Read up on the 'bcp utility' in SQL Server Books Online.
The following article describes a bulk loading, with an emphasis on
optimizing performance, but may provide more detail than what you need.
SQL Server 2000 Incremental Bulk Load Case Study
[url]http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/incbulkload.mspx[/u
rl]
"nick" <nick@.discussions.microsoft.com> wrote in message
news:BCA25342-6927-4416-9F0F-F9CCA2E76FA5@.microsoft.com...
> Thanks. In fact, each row of the very big table provides the parameters
> for a
> complex C++ function written by others. The source code is available but I
> better not touch the C++ code since the author may upgrade. The C++ code
> will
> return quite a few values for each row and these values need to written in
> a
> SQL table. The process is simple but the data amount is big.
> Maybe use JScript in DTS to call an executible? But need to parse the
> input/ouput...
> "JT" wrote:
>|||Thanks. The existed solution is:
#1 A "wrapper"(extended stored procedure) to call the C++ routines.
#2 A stored procedure which declares a fast forward cursor over the large
table and fetch every row and calls the extended stored procedure with
fetched values as parameters.
I am not sure about the C++ code and worry about memory leaks, etc, that's
the reason I am sing an alternative solution. Assume the C++ code (for
both 3rd party code and extended SP) is good, what's the issue of the existe
d
approach? Performance/resource usage?
"JT" wrote:
> What you just described is not really 'data transformation', but some type
> of data entry that needs to be automated using a large list of parameters
> supplied by a 3rd party. In that case, rather than DTS, I would suggest
> writing a client side application that:
> #1 Opens a forwardonly / readonly recordset recordset from the source
> table
> #2 Steps through the recorset from top to bottom (not really looping)
> #3 For each record, call the C++ executable using parameters from the
> record
> #4 Write the result of each SP call to a tab delimited text file
> #5 Once the last record has been processed, close the recordset, and us
e
> the bulk copy utility (BCP.EXE) to load the tab delimited file into the
> destination table.
> #6 Truncate the source table?
> I would not reccomend running the executable on the database server, becua
se
> it would provide only a marginal performance benefit but result in securit
y,
> deployment, and resource utilization issues.
> Read up on the 'bcp utility' in SQL Server Books Online.
> The following article describes a bulk loading, with an emphasis on
> optimizing performance, but may provide more detail than what you need.
> SQL Server 2000 Incremental Bulk Load Case Study
> [url]http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/incbulkload.mspx[
/url]
> "nick" <nick@.discussions.microsoft.com> wrote in message
> news:BCA25342-6927-4416-9F0F-F9CCA2E76FA5@.microsoft.com...

Sunday, February 19, 2012

Hw to get Schema file through DTS

Hi,
Cud anybody tell me how to get schema as a DTS file?
Its urgent.
Thanks,
Dutt.
Have a look at the script and ScriptTransfer methods in SQLDMO. Also have a
look at 3rd-party tools eg RedGate's SQL Compare.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com

Hw to get Schema file through DTS

Hi,
Cud anybody tell me how to get schema as a DTS file?
Its urgent.
Thanks,
Dutt.Have a look at the script and ScriptTransfer methods in SQLDMO. Also have a
look at 3rd-party tools eg RedGate's SQL Compare.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com

Hw to get Schema file through DTS

Hi,
Cud anybody tell me how to get schema as a DTS file?
Its urgent.
Thanks,
Dutt.Have a look at the script and ScriptTransfer methods in SQLDMO. Also have a
look at 3rd-party tools eg RedGate's SQL Compare.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com