This one is stumping me.. please help.
I put together a DB with lots of tables, sprocs, etc..
Now I want to wrap it up into one nice little .SQL which will generate
everything for a user. To that end, I went into Enterprise Manager, and
selected "Generate SQL script".
All is well until someone wants to execute it on a machine where SQL is not
installed in the same DIR where I have SQL installed. So.. how do I generate
a CREATE script which is smart enough to create the DB in the same physical
path where SQL is installed for that particular user?
Have I lost you yet? Here is a snippet of the DDL:
<paste>
IF EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name = N'MyNewDB')
DROP DATABASE [MyNewDB]
GO
CREATE DATABASE [MyNewDB] ON (NAME = N' MyNewDB _Data', FILENAME =
N'C:\Program Files\Microsoft SQL Server\MSSQL\data\ MyNewDB_Data.MDF' , SIZE
= 34, FILEGROWTH = 10%) LOG ON (NAME = N' MyNewDB_Log', FILENAME =
N'C:\Program Files\Microsoft SQL Server\MSSQL\data\ MyNewDB.LDF' , SIZE =
344, FILEGROWTH = 10%)
COLLATE SQL_Latin1_General_CP1_CI_AS
GO
</paste>
OK.. how do I make the areas in BOLD write to <%SQLSERVERINSTALLPATH%>, or
something like that?
Thanks!
/Ty