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)
 recreating exisitng tables in a new DB

Author  Topic 

zubair
Yak Posting Veteran

67 Posts

Posted - 2009-02-05 : 11:13:16
I need to perform the following task:

1.get a sql script of a table including primary key, foreign keys and contraints

2. running the sql script above in another database

I need to do this on a regular basis. Is there a way to automate this task instead of manually having to get the script via enterprise manager and then copying and pasting into query anayluser and running against new database? I think this can be done via OSQL? Does anyone have an example i could base mine on? Thx

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-02-05 : 11:20:05
Duplicate, locking thread.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -