How - create and use database directly after creation in SQL Server? -
i created sql script check if database exist, if exists deletes , re-creates. after connect directly after creation creating tables ..
here code not work. announces error message
msg 911, level 16, state 1, line 10 database 'arms2' not exist. make sure name entered correctly.
my script
if exists (select * sys.databases name = 'arms2') begin drop database arms2 print 'drop database arms2' end create database arms2; print 'create database arms2' use arms2 create table .....
put go statement after create...
... create database arms2; print 'create database arms2' go use arms2
Comments
Post a Comment