September 4, 2009 at 12:01 pm
It is quite painful in MS SQL 2005 to generate scripts for all objects. Does anyone know how to schedule it?
Any input will be greatly appreciated.
September 4, 2009 at 12:36 pm
Well, for code objects, you could select from sys.sql_modules. That'll get you procs, views and functions. For tables, you'd need to select from sys.columns, and a variety of other objects for constraints, indexes, column data types, and so on. Would take a while to build, test, debug, etc., but would be interesting to do.
I'm not sure why you'd need a job to output generate scripts. Don't you have the scripts in source control? Or are people issuing rogue DDL commands into your database without going through source control of some sort?
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
September 4, 2009 at 12:54 pm
there's some script contributions here on SSC that call SMO; I've done this all via TSQL, where i stick a current "snapshot" of a database in a versioning table in my master database; did you want to script this to a file, or just stick it in a table?
Lowell
September 4, 2009 at 8:09 pm
I would like to get the object-level permissions. It is very time-consuming. I would like to make a schedule to run it.
September 5, 2009 at 10:40 am
If you have an old copy of SQL Server 2000 laying around and it doesn't share an instance of 2005 (which deletes the program), make a copy of the SCPTXFER.exe program that came with SQL Server 2000. SCPTXFER /? will tell you how it works and it will script your entire database with a single command... object permissions included if I recall correctly.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply