| March
8th 2006
Command line
SQL Generation
Bit of a misleading
title actually - by this we mean generating the SQL that (which?)
describes a database without using the visual tools in SQL2005 management
studio.
Two reasons - one
the management studio is awful, and two, there are so many options
to set that you never get it right.
Are there any command
line tools? Answer not that we can find. But it wasn't too difficult
to build a small C# executable that used the SQLDMO TransferClass
to do the job for us. The advantage with this is it's entirely repeatable,
we order the file sensibly, add drop and create, security attributes
etc.
The end result
is an SQL file that will correctly "clone" a database structure (incl.
logins and other items if required). Neat...
|