Monday, March 26, 2012

Export data

Hi,

I usually export data from my sqlserver db to a mdb file. I know there are different destinations like csv, txt, etc...
But however, how can I export data in a sql script file?? I know i should do it with the sentence "insert into table" but i would like to know if the sqlserver has some option to do this without i have to write the sentence for each rows to insert.
I know this option in Oracle.

Thanks for all.bcp, dts..|||He wants to generate individual insert statements for records...

You will need to write a select statement for each of your tables that generates select strings as output. There is no built-in functionality to do this, probably because it is a very inefficient means of transferring data. I encourage you to use an alternate method.|||Hi, thanks for your response.

I have another question, is there any way in sqlserver to generate an mdb file from a select statement??

Thanks.|||No. That is not what select statements do.|||I have another question, is there any way in sqlserver to generate an mdb file from a select statement??Using pure Transact-SQL only, no.

A linked server (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adminsql/ad_1_server_4uuq.asp) can get you most of the way there in the Transact-SQL environment. A SQL Server DTS package (http://msdn.microsoft.com/library/en-us/dtssql/dts_basic_5zg3.asp) can do exactly what you've requested.

-PatP

No comments:

Post a Comment