Hi
I am trying to export an table data to csv format. The problem here is the table columns are dynamic. The DTS exports only the columns available during the DTS design time and it ignores if any new columns are added after the design. I need solution for this asap.
Thanks
SqlJerinUse BCP to do that,or you could achieve this using the command line utilities like isql.exe and osql.exe.
I think that will solve your problem...
From command prompt:
osql.exe -S YourServerName -U sa -P secretcode -Q "Put your query" -o "E:\output.csv"
From T-SQL:
EXEC master..xp_cmdshell 'osql.exe -S YourServerName -U sa -P secretcode -Q "put your query" -o "E:\output.csv"'|||Hi
I am trying to export an table data to csv format. The problem here is the table columns are dynamic. The DTS exports only the columns available during the DTS design time and it ignores if any new columns are added after the design. I need solution for this asap.
Thanks
SqlJerin
A better question is: Why is your schema changing after the design phase?|||While there might be a good reason for this, it makes me nervous. What kind of changes are you making to the schema on an ongoing basis, and what is the underlying (business) reason for making those changes? This sounds like a problem in search of a victim to me.
-PatP|||Hello Rudra
Thanks for your immediate reply. The BCPs are not working in this context as it generates ununiform data in the csv file and it doesn't provide column headers. I prefer dynamic DTS export solutions.
Thanks
SqlJeba|||Hello Rudra
The BCPs are not working in this context as it generates ununiform data in the csv file and it doesn't provide column headers. Thanks
SqlJeba
yea,that will not help you,dynamic columns right..ok this can help you a bit
link
(http://groups.google.com/group/microsoft.public.sqlserver.dts/browse_thread/thread/db64c75d96945d07/fadd21a55a86d51d?lnk=st&q=dynamic+column+in+dts+export+sql+server+2000&rnum=1&hl=en#fadd21a55a86d51d)
it doesn't provide column headers.
You haven't mentioned column header in your first post,anyway
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment