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.
Author |
Topic |
vaibhavktiwari83
Aged Yak Warrior
843 Posts |
Posted - 2010-10-02 : 02:52:32
|
Hello All,I am trying to generate one script to insert the data from one database to another databaseAs i dont have permission to script the data.So I am writing a dynamic query to get the insert script for all the tables.Here is the query - SELECT 'INSERT INTO '+ name + ' --' + CHAR(13) + 'SELECT * FROM [10.1.4.118].itspatchdb.dbo.' + name FROM sys.tablesthis will generate Script like belowINSERT INTO PTH_PatchOthersInstalled --SELECT * FROM [10.1.4.118].itspatchdb.dbo.PTH_PatchOthersInstalledI want to get the count of table just next to "--"Can anyone help me out.Vaibhav TTo walk FAST walk ALONE To walk FAR walk TOGETHER |
|
|
|
|