SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Excel import - force column to be string (SSIS 2005)


Excel import - force column to be string (SSIS 2005)

Author
Message
suslikovich
suslikovich
Valued Member
Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)Valued Member (64 reputation)

Group: General Forum Members
Points: 64 Visits: 300
It would be nice to know where you do the QUOTENAME(columnname, '"')
Donny Z
Donny Z
SSC Rookie
SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)

Group: General Forum Members
Points: 30 Visits: 237
Jeff Moden (10/16/2011)
The way I solved this problem for my group was to simply use QUOTENAME(columnname, '"') and make sure that I used '"' as the text qualifier.


Can anyone explain more about this??
This kind of statement is like "I know how, but I won't tell." kinda statement.

Best Regards.
Rob Taylor
Rob Taylor
Hall of Fame
Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)Hall of Fame (3.9K reputation)

Group: General Forum Members
Points: 3868 Visits: 1616
Donny Z (8/19/2013)
Jeff Moden (10/16/2011)
The way I solved this problem for my group was to simply use QUOTENAME(columnname, '"') and make sure that I used '"' as the text qualifier.

Can anyone explain more about this??
This kind of statement is like "I know how, but I won't tell." kinda statement.

Take a look at: http://technet.microsoft.com/en-us/library/ms176114(v=sql.105).aspx

A simple search brought that back. Rolleyes

HTH,
Rob
Daniel Bowlin
Daniel Bowlin
SSCrazy Eights
SSCrazy Eights (8.1K reputation)SSCrazy Eights (8.1K reputation)SSCrazy Eights (8.1K reputation)SSCrazy Eights (8.1K reputation)SSCrazy Eights (8.1K reputation)SSCrazy Eights (8.1K reputation)SSCrazy Eights (8.1K reputation)SSCrazy Eights (8.1K reputation)

Group: General Forum Members
Points: 8078 Visits: 2629
Right click on the Excel source transform, choose Show Advanced Editor, and modify the column data type properties in the Input and Output properties tab
whereisSQL?
whereisSQL?
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2056 Visits: 1481
I am stuck at a similar dilemma with Excel source and Jet provider.

Cannot edit registry key.

I was thinking about this.. but I am not sure if it is possible.. Can I add a dummy row with more than 255 chars each time data flow task runs by using a script task and then take the dummy row out using an identifier?

Script Task (add dummy row, move all rows one level below dummy)
Excel Source
Some other Task (which you would normally go to and take dummy row out)

I have near zero scripting skills and am looking for help to see if this is a possibility
Phil Parkin
Phil Parkin
SSC Guru
SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)

Group: General Forum Members
Points: 52448 Visits: 21180
whereisSQL? (8/20/2013)
I am stuck at a similar dilemma with Excel source and Jet provider.

Cannot edit registry key.

I was thinking about this.. but I am not sure if it is possible.. Can I add a dummy row with more than 255 chars each time data flow task runs by using a script task and then take the dummy row out using an identifier?

Script Task (add dummy row, move all rows one level below dummy)
Excel Source
Some other Task (which you would normally go to and take dummy row out)

I have near zero scripting skills and am looking for help to see if this is a possibility



If you can't use a CSV as your source instead - which is my preferred approach whenever the subject of Excel comes up - then yes, you can do this. Use a Conditional Split in your dataflow to send the unwanted row to an unused output.


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
whereisSQL?
whereisSQL?
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2056 Visits: 1481
What about adding the dummy line? I am not loading the file,to open it and add the line. It is getting loaded through application GUI on client side.
Phil Parkin
Phil Parkin
SSC Guru
SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)SSC Guru (52K reputation)

Group: General Forum Members
Points: 52448 Visits: 21180
whereisSQL? (8/21/2013)
What about adding the dummy line? I am not loading the file,to open it and add the line. It is getting loaded through application GUI on client side.



Sorry - I misunderstood your post - I thought that the dummy line was going to be in the source file.


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.

Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.
Donny Z
Donny Z
SSC Rookie
SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)SSC Rookie (30 reputation)

Group: General Forum Members
Points: 30 Visits: 237
robert.gerald.taylor (8/20/2013)
Donny Z (8/19/2013)
Jeff Moden (10/16/2011)
The way I solved this problem for my group was to simply use QUOTENAME(columnname, '"') and make sure that I used '"' as the text qualifier.

Can anyone explain more about this??
This kind of statement is like "I know how, but I won't tell." kinda statement.

Take a look at: http://technet.microsoft.com/en-us/library/ms176114(v=sql.105).aspx

A simple search brought that back. Rolleyes

HTH,
Rob

Hi Rob,

I know what QUOTENAME's function is.
What I mean is how Jeff apply it in the excel source, cause AFAIK we can't use every T-SQL function when we try to select from excel, and we can't define text-qualifier unless we're using Flat File Source Ermm

So I thought maybe Jeff got something up his sleeve or know something I don't.
And basically I asked the same question suslikovich asked before my post.
--------------------------------------

@whereisSQL?
I already spent few days looking for answer like this for SSIS 2008 (yup, the saga continues to 2008) and bcoz it's driver caused problem, I'm stuck w/ converting the excel to other delimited format file then use SSIS to read the result file. Still trying to find free converter which can be executed through CMD prompt though Pinch
whereisSQL?
whereisSQL?
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2056 Visits: 1481
I read here that the ACE OLEDB 12.0 provider overcomes it.

Installed it, but no go. Stumped..

edit - tried to make less clutter with the url tag
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search