« Simple EventLog entry writing | Main | Application properties sample values »

MSDE, database distribution, osql command line tool.

osql is the simple command line tool for processing .sql files.

An existing database can be emptied, shrunk, detached and then connected with a connection string such as:

data source=PELL\VSDOTNET;AttachDBFilename=c:\tone\kzdev\vsp\jobsearch\jobsearch0.mdf;initial catalog=JobSearch;integrated security=SSPI;persist security info=False;workstation id=localhost;packet size=4096

 

A very simple batch file for running osql:

@echo on

set server=PELL\VSDOTNET

set newdbname=JobSearch

osql -e -d master -S %server% -E -Q "create database %newdbname%"

osql -e -d %newdbname% -S %server% -E -i "JobSearch.sql"

 

 

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)