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)
 Job on SQL server

Author  Topic 

ilimax
Posting Yak Master

164 Posts

Posted - 2012-01-05 : 15:17:10
I want to create job on Sql server that do this for me;
1.Create new db
2.Read all objects from old db and copy them empty into new db; tables, constraints, indexes, views, store procedures, users

So, I need one new empty db as old one.

Does anybody know how to make this?

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2012-01-06 : 14:21:18
Why do you want to do this within a SQL Job? How do you intend to define the source and destination databases? There are a variety of third party applications that do this already. We use RedGate Compare but there are plenty of others.

=================================================
Men shout to avoid listening to one another. -Miguel de Unamuno
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-01-06 : 14:21:49
why not use copy database wizard then?

http://msdn.microsoft.com/en-us/library/ms188664.aspx

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -