Dave Mateer
Dave Mateer

Reputation: 6626

Automate Generate Scripts Wizard in SQL2008

Problem: how to automate a Generate Scripts in SQL2008 Management Studio:

ie right click on database, Tasks, Generate Scripts

All Tables All Stored Procs

Create drop statements Don't use USE statement Generate data

This is a 20sec process to do by hand.. needs automating :-) I don't really want to code it in C# in SQL Server Management Objects (SMO).

Maybe I'll have to use AutoHotKey :-)

Upvotes: 1

Views: 1052

Answers (3)

Dave Mateer
Dave Mateer

Reputation: 6626

I've taken Will A's advice and tried scripting.. SQL Server Management Objects

nearly there :-)

Upvotes: 0

blorkfish
blorkfish

Reputation: 22824

Have a look at DBSourceTools. http://dbsourcetools.codeplex.com
It's an open-source scripting engine for SQL Server Databases that uses SMO.

Upvotes: 0

Will A
Will A

Reputation: 24988

Use SMO - it's the right thing to do and you know it!

Upvotes: 1

Related Questions