Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 osql / Export

Author  Topic 

jwe
Starting Member

13 Posts

Posted - 2007-05-17 : 09:02:18
Hi,

I am using a stored procedure with osql and xp_cmdshell to generate inserts of all data in all tables in my database and dumps it into text files. I then use osql again to import these inserts into another database.
The problem comes when I load large text files (150 000 inserts +), osql will hang and eventually time out.
Is there a way I can split these exports into specified sizes or number of rows per text file on creation with osql?

Thanks

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-05-17 : 09:46:10
Why don't insert data with sql statement directly?
Go to Top of Page

jwe
Starting Member

13 Posts

Posted - 2007-05-17 : 09:54:06
Hi,

I am not sure I am following?
I need to dump all the data and then re-import it into another database.
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-05-17 : 16:08:34
You can do that with 'insert into ... select ... from ...' statement.
Go to Top of Page
   

- Advertisement -