I am using Installshield 2015 version.We have created a install script .msi project.
Under SQL Scripts Tab, we have created new SQL Connection.
I am providing CatalogName "NMC" and selected checkbox(Create catalog if absent).
I am running the below SQL Scripts to run against this Database(NMC).
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Account]') AND type in (N'U'))
BEGIN
PRINT 'Tables have already been created'
END
ELSE
BEGIN
/****** Object: Table [dbo].[Rights] ******/
CREATE TABLE [dbo].[Rights](
[RightId] [int] NOT NULL,
[Name] [nvarchar](50) NOT NULL,
CONSTRAINT [PK_Rights] PRIMARY KEY CLUSTERED
(
[RightId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
I want the Table created on the Database which is mentioned in Catalog(NMC).
Right now the script is executing against Master Database.
How can I execute the script against Catalog mentioned above?I don't want to use command "USE NMC" in SQL Script.
Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=myPassword;
- Andomar