The Artima Developer Community
Sponsored Link

.NET Buzz Forum
Part II - Versioning SQL Server Stored Procedures and Other db Objects in VSS

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Korby Parnell

Posts: 136
Nickname: korbyp
Registered: Aug, 2003

Korby Parnell is Programming Writer for Microsoft Visual SourceSafe and Visual Studio .NET
Part II - Versioning SQL Server Stored Procedures and Other db Objects in VSS Posted: Aug 1, 2003 2:31 PM
Reply to this message Reply

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.
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Korby Parnell
Latest Posts From Korby Parnell

Advertisement

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!

isql -S servername -U sqluserid -P sqluserpassword -d databasename -q "exec sp_helptext databaseobjectname" > drive letter:\DBO Text Files\ databaseobjectname.txt

sp_helptext, what a lovely, lovely name.

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.

Read: Part II - Versioning SQL Server Stored Procedures and Other db Objects in VSS

Topic: Office 2003 Developer Contest Previous Topic   Next Topic Topic: Skip the SQL When Paging To Improve Performance

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use