SQL to Sourcesafe Scripter v2.0 (SQLScripter, Schema Scripter) for Windows
Table Of Contents
Overview, what is SQLScripter?
SQLScripter is a 32 bit windows application designed as a tool that automatically generates SQL schema scripts for Microsoft SQL Server databases, and stores them in file system or under Microsoft SourceSafe version control. Although recent versions of MS SQL Server support version control on stored procedures through Visual SourceSafe integration, the procedure requires modifications to be done exclusively from within a MS Visual Studio interface, and does not apply to other schema information such as table or view scripts. SQLScripter proposes a solution (Schema Change History) where all development work is done as before on the real server, and all database schema objects are scripted into SourceSafe at predefined intervals. Interested parties are notified of changes by automatic e-mails where created, altered or dropped objects are reported. This tool can also be used as a change and configuration management for SQL Server. The individual database programmer may benefit from SQLScripter in keeping a personal history of versions. However the real value of SQLScripter comes out in collaboration, where a possibly multi-site group of programmers are working on related databases. If the volume of shared development is very high, a project may indeed call for a disciplined old-fashioned check-out-check-in mode of database operations to avoid collisions. Otherwise, which is the case for most mature projects in maintenance, this may be overkill. A daily run of SQLScripter may be enough to make everyone aware of any changes, and still be able roll back if necessary. Change History (What's new?)
Credits
Idea Inspired from Zafer Barutcuoglu Top
Installation, how to setup?
The latest release setup package of SQLScripter can be downloaded from here. Operation, how it works?
The program processes the configuration file in sequence. For each each matching
object in SQL Server, it first generates the object's SQL script into its temporary
files directory specified in the configuration. It then compares this file to the
version in SourceSafe, internally noting the the file as changed, unchanged or new.
Then the SourceSafe version is checked-out (without getting a local copy) and the
scripted version is checked in. When all objects are processed like this, the program
recurses in SourceSafe to find files that match the configuration but have not been
scripted in this run. These files are assumed to have been dropped, and are renamed
with the prefix For the first run, since no objects yet exist in SourceSafe, all objects will be
noted as new and according to database e-mail recipients may receive huge reports.
To prevent this, see the The log file contains entries for the program start, termination, summary info and
any error messages. Top
Usage, how to use?
SQLScripter is a batch tool, primarily intended for scheduled use. Based on a configuration file, it starts scripting as soon as it is run. The configuration file is in INI format and needs to be edited manually. See the next section for details. The program can be run without parameters: SQL2SS.exe
In this case it looks for the configuration file Otherwise a configuration file can be specified manually: If there is an error in loading the configuration file, an error log will be created in the executable directory. Provided that the configuration is normally loaded and it specifies a valid log file location, any other errors are logged to that file without visual prompting. Note that the notification e-mails also contain the error entries written to the log file. Typical usage is scheduling SQLScripter as a nightly or hourly job. If scripting multiple servers in sequence takes too long, the batch job can be divided into multiple configuration files (e.g. one for each SQL Server) and scheduled as independent jobs to run in parallel. In that case, be sure to specify different log files and temporary directories to avoid concurrency conflicts. Top
Configuration, how to configure?
Configuration INI file section and key details:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Top
Sample configuration file is as follows:
Sample.INI:
[GLOBAL] CharSet=iso-8859-9 [SQL2SS_Scripter] tempfolder="%AppPath%" logfile="%AppPath%\Log\Log_%DateTime%.txt" DefaultExt=SQL permdatadir="%AppPath%\Data" permdatakeep="1" BeforeDbSrvTrg="init.bat" AfterDbSrvTrg="" AfterCatTrg="" [AfterTrigger] ;Run1=test.bat [scc] scccheck=0 sccget=0 sccsave=0 sccname=LocalVSS sccpath="\\server1\vssdb\srcsafe.ini" sccroot="$/SQL" sccuser="SQLScripter1_vss" sccpass="" [SQL_01] ignore=0 dbsrvname="TESTSQL1" Login="SQLScripter" dbsrvpass="" ;dbsrvpassenc="" objects="user" Noreport=0 StripConstraint=1 StripCollation=0 DBs2Exclude=Pubs;TestDb1;TestDB2 [SQL_02] ignore=0 dbsrvname="TESTSQL2" Login="SQLScripter" dbsrvpass="" objects="user" Noreport=0 StripConstraint=0 StripCollation=0 Tables2ScrContent=UserTypes;LookupTable;Countries;States; Tables2ScrC_MaxRow=200 DbName_01=Pubs StripConstraint_01=1 StripCollation_01=0 Tables2ScrContent_01=PubsStates; Tables2ScrC_MaxRow_01=300 DbName_02=NorthWind StripConstraint_02=0 StripCollation_02=1 [Mail_01] maildsb=0 smtpsrv="smtp.abc.com" smtpuser="" smtppass="" From="admin@abc.com" ReplyTo="" Tag="PREFIXTAG" To1=admin@abc.com To2=sqloperator@abc.com SkipWhenNoChange=0 SkipOthersIfOk=1 SendMethod=0 ItemFormat=%ObjType% <A href="http://www.abc.com/ss2web/ss2web.asp?p=%Spec%">%DB%.%OwnerExc%.%Name2Show%</A>
Top
CREATE TABLE [dbo].[jobs] (
[job_id] [smallint] IDENTITY (1, 1) NOT NULL ,
[job_desc] [varchar] (50) NOT NULL DEFAULT ('New Position - title not formalized yet'),
[min_lvl] [tinyint] NOT NULL ,
[max_lvl] [tinyint] NOT NULL ,
PRIMARY KEY CLUSTERED
(
[job_id]
) ON [PRIMARY] ,
CHECK ([max_lvl] <= 250),
CHECK ([min_lvl] >= 10)
) ON [PRIMARY]
GO
GRANT REFERENCES , SELECT , UPDATE , INSERT , DELETE ON [dbo].[jobs] TO [guest]
GO
ALTER TABLE [jobs] NOCHECK CONSTRAINT ALL SET IDENTITY_INSERT [jobs] ON INSERT INTO [jobs] ([job_id],[job_desc],[min_lvl],[max_lvl]) VALUES (1,'New Hire - Job not specified',10,10) INSERT INTO [jobs] ([job_id],[job_desc],[min_lvl],[max_lvl]) VALUES (2,'Chief Executive Officer',200,250) INSERT INTO [jobs] ([job_id],[job_desc],[min_lvl],[max_lvl]) VALUES (3,'Business Operations Manager',175,225) INSERT INTO [jobs] ([job_id],[job_desc],[min_lvl],[max_lvl]) VALUES (4,'Chief Financial Officier',175,250) INSERT INTO [jobs] ([job_id],[job_desc],[min_lvl],[max_lvl]) VALUES (5,'Publisher',150,250) INSERT INTO [jobs] ([job_id],[job_desc],[min_lvl],[max_lvl]) VALUES (6,'Managing Editor',140,225) INSERT INTO [jobs] ([job_id],[job_desc],[min_lvl],[max_lvl]) VALUES (7,'Marketing Manager',120,200) INSERT INTO [jobs] ([job_id],[job_desc],[min_lvl],[max_lvl]) VALUES (8,'Public Relations Manager',100,175) INSERT INTO [jobs] ([job_id],[job_desc],[min_lvl],[max_lvl]) VALUES (9,'Acquisitions Manager',75,175) INSERT INTO [jobs] ([job_id],[job_desc],[min_lvl],[max_lvl]) VALUES (10,'Productions Manager',75,165) INSERT INTO [jobs] ([job_id],[job_desc],[min_lvl],[max_lvl]) VALUES (11,'Operations Manager',75,150) INSERT INTO [jobs] ([job_id],[job_desc],[min_lvl],[max_lvl]) VALUES (12,'Editor',25,100) INSERT INTO [jobs] ([job_id],[job_desc],[min_lvl],[max_lvl]) VALUES (13,'Sales Representative',25,100) INSERT INTO [jobs] ([job_id],[job_desc],[min_lvl],[max_lvl]) VALUES (14,'Designer',25,100) SET IDENTITY_INSERT [jobs] OFF ALTER TABLE [jobs] CHECK CONSTRAINT ALL
Top| Incremental installation pack | ||
![]() |
SQL2SSv204.rar (v2.0.9) (85KB) | Just Executable file (If you previously setup full installation pack) |
| Full installation packs | ||
![]() |
SQL2SS.zip (3.5 MB) | Windows (MSI) Installer package, Setup without Installer Loader (v2.0.9) |
Rar |
SQL2SS_wIL.zip (6.5 MB) | Full Setup with Installer Loader (v2.0.9) |
| Keep Windows Updated
All Windows users should apply the latest Microsoft security updates to help make sure that their computers are as protected as possible. If you are not sure whether your software is up to date, visit the Microsoft Update Web site , scan your computer for available updates, and install any high-priority updates that are offered to you. If you have Automatic Updates enabled, the updates are delivered to you when they are released, but you have to make sure you install them. |
For Windows 98:
http://www.microsoft.com/downloads/release.asp?ReleaseID=32831
For Windows NT:
http://www.microsoft.com/downloads/release.asp?ReleaseID=32832
For Windows 2000/XP/2003: (optional)
Windows Installer 3.0 Redistributable
Top