This post originated from an RSS feed registered with .NET Buzz
by Korby Parnell.
Original Post: Part II - Versioning SQL Server Stored Procedures and Other db Objects in VSS
Feed Title: Korby Parnell
Feed URL: /msdnerror.htm?aspxerrorpath=/korbyp/Rss.aspx
Feed Description: Copyright 2003 Korby Parnell Fri, 01 Aug 2003 10:03:48 GMT ChrisAn's BlogX korbyp@microsoft.com korbyp@microsoft.com Alex Lowe Joins Microsoft http://blogs.gotdotnet.com/korbyp/permalink.aspx/536bb108-6a66-4dc6-8847-69f4d799bb55 http://blogs.gotdotnet.com/korbyp/permalink.aspx/536bb108-6a66-4dc6-8847-69f4d799bb55 Fri, 01 Aug 2003 10:03:48 GMT From ASP.NET MVP to Microsoft .NET Evangelist. Success is the domain of good guys. Welcome aboard Alex. I look forward to meeting you in person. Thanks to ScottW for posting the big announcement. Este mensaje se proporciona "como está" sin garantías de ninguna clase, y no otorga ningún derecho.
Step
1: Since I can only add files to a VSS database, the first step is to figure out
how to [programmatically] transform my SQL Server database objects (stored
procedures, UDFs, table schema, etc) into text files. One idea is to write
a C# class that connects to a database and use isql.exe for this task. Can
I do it with one line of code? AHA! I can!
Of course, in Visual Studio .NET, I can do the virtually
the same thing with a click of the button. In the Server Explorer window,
you can simply select a database object and click 'Generate Create
Scripts'.
IMPORTANT: When generating individual script files of a
SQL Server dbo for addition to a VSS db, elect to save the file
in Windows Text (ANSI) format rather than the default Unicode enconding.
Doing so will allow you to Diff versions of the file. Currently, VSS is
unable to diff unicode files.
You can also perform this same task
using SQL Server's Enterprise Manager. Mike, of Rosey's Blog, writes:
"SQL
Server actually has a couple of "features" when generating scripts that make
this a little easier. You can select all the objects in Enterprise Manager
you want to script, right click and select Generate SQL Script - which launches
a wizard that will walk you through the process. You also want to change
the default option of scripting to a single file - to one of script each object
to it's own file. Then, when SQL Server is done, you just navigate to
the folder where you put the scripts, select the files, and check them into
VSS."
Ce message est fourni en l’état, sans garantie d’aucune
sorte, et ne vous confère aucun droit. Vous assumez tous les risques liés à son
utilisation.