I have create script which is automatically generated by Scripter.Script()
method.
But if want to get rid of file paths included in the script. Which property is need to be set while using Scripter class to generate script ?
SQL Script:
CREATE DATABASE [ContactManager] ON PRIMARY
( NAME = N'ContactManager', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA\ContactManager.mdf' , SIZE = 8192KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
LOG ON
( NAME = N'ContactManager_log', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA\ContactManager.ldf' , SIZE = 5184KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
GO
but now I want to generate script without primary statement like below:
CREATE DATABASE [ContactManager] GO