SQL Script Error - Could not locate entry in sysdatabases for database 'PIMTool'
Posted on 2011-03-07
I am getting the following error for the SQL Script below and I cannot figure out why. Any suggestions? Also, since I have two SQL server instances on my computer a LOCAL and a SQLExpress do I need to specify anything in the SQL script file when I executing this through a MSI installer. I receive the error message when I try running this script through Query Analyzer againast the SQLExpress instance.
Server: Msg 911, Level 16, State 1, Line 1
Could not locate entry in sysdatabases for database 'PIMTool'. No entry found with that name. Make sure that the name is entered correctly.
if exists (SELECT name FROM Master.dbo.sysdatabases WHERE name = N'PIMTool')
drop DATABASE [PIMTool];
IF not EXISTS (SELECT name FROM Master.dbo.sysdatabases WHERE name = N'PIMTool')
CREATE DATABASE [PIMTool];