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 2000 Forums
 SQL Server Administration (2000)
 Export the DB script to a linked server

Author  Topic 

adila
Starting Member

5 Posts

Posted - 2006-02-04 : 14:03:50
Hello all,
I want to duplicate my database(without data) into another sql server.
how can i export DB script to a linked server?
or
how can i insert tables with limited data (ex. top 10 records) into the linked server?

Thanks

nr
SQLTeam MVY

12543 Posts

Posted - 2006-02-04 : 14:28:28
run on source server
'select top 10 * into ' + name + ' from lnksvr.dbname.dbo.' + name
from sysobjects where xtype = 'u'

then run the output on the destination server
Check the output first to see if it looks ok.

Just the top 10 records is usually not much good as it will lose referential integrity.

You would be better scripting the database and applying that then dealing with the data separately.



==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -