SQL Script Error - Could not locate entry in sysdatabases for database 'PIMTool'
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.
use Master;
if exists (SELECT name FROM Master.dbo.sysdatabases WHERE name = N'PIMTool')
drop DATABASE [PIMTool];
GO
IF not EXISTS (SELECT name FROM Master.dbo.sysdatabases WHERE name = N'PIMTool')
CREATE DATABASE [PIMTool];
GO
use PIMTool;
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
if exists (SELECT name FROM Master.dbo.sysdatabases WHERE name = N'PIMTool')
BEGIN
drop DATABASE [PIMTool];
END
GO