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
 Import/Export (DTS) and Replication (2000)
 Generate SQL Script . . . automation

Author  Topic 

JaredStokes
Starting Member

9 Posts

Posted - 2003-12-18 : 10:06:02
I was wondering if any of you could help me figure out how to replicate structure only via an automated process.

What I am looking to do is like the Right click on database > all tasks > Generate SQL Scripts . . . Only automatically. And if possible apply it to a different server, automatically or at least via some automated process.

I would love to just publish the database and select what I want but that is not an option as this will be over a very slow link and the structure is the most important thing at this moment.

mfemenel
Professor Frink

1421 Posts

Posted - 2003-12-18 : 11:17:28
DTS offers you a copy sql server objects task which you can use to only copy the structure. You can provide a source & destination argument which would give you what you're looking for. You can then schedule the job to run whenever you want it to.

Mike
"oh, that monkey is going to pay"
Go to Top of Page

JaredStokes
Starting Member

9 Posts

Posted - 2003-12-18 : 11:26:48
That is a great idea. I can not seem to find a way to say what tables and stored procedures I would like to transfer and from what database.
Go to Top of Page

graz
Chief SQLTeam Crack Dealer

4149 Posts

Posted - 2003-12-18 : 14:46:44
I'd also look at using DMO. It's a little more complicated but much more flexible.

http://www.sqlteam.com/item.asp?ItemID=9093

===============================================
Creating tomorrow's legacy systems today.
One crisis at a time.
Go to Top of Page

MichaelP
Jedi Yak

2489 Posts

Posted - 2003-12-18 : 14:59:53
Another solution might be to use SQL Compare by redgate. I believe they have a way to automate their compare process.

Michael

<Yoda>Use the Search page you must. Find the answer you will.</Yoda>
Go to Top of Page

JaredStokes
Starting Member

9 Posts

Posted - 2003-12-18 : 15:33:28
MichaelP,

That looks like a good solution!

I hope they go for it.
*sigh*

Go to Top of Page

JaredStokes
Starting Member

9 Posts

Posted - 2003-12-18 : 15:35:35
graz,

If I was anywhere near as smart as you all I would use that. It looks like exactly what I would want to be able to access.
Go to Top of Page

MichaelP
Jedi Yak

2489 Posts

Posted - 2003-12-18 : 15:38:15
Jared,

Redgate has a demo version. Check that thing out and see if it will do what you need it to do before ya spend the cash.

Also, you might want to check out a similar product from a different company like this one. I hear good things about both products.

http://www.apexsql.com/index_sqldiff.htm

Michael

<Yoda>Use the Search page you must. Find the answer you will.</Yoda>
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2003-12-19 : 05:57:17
Here is code to script the structure - you can then apply it via osql.
If you don't want to loop through all the files there is an option to generate a single file.

http://www.nigelrivett.net/DMOScriptAllDatabases.html


==========================================
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

JaredStokes
Starting Member

9 Posts

Posted - 2003-12-19 : 10:18:08
NR,

You are now my hero. ALL HAIL NIGEL!!! HURA FOR NIGAL!

Thanks everyone. I think I have enought to do what I need to now. Thanks!

-Jared
Go to Top of Page
   

- Advertisement -