Thanks Simon, actually, I just remembered BOL after I made the post. I
found the syntax for CREATE DATABASE "DBName". I ran it in query
analyzer to test it and it worked fine. So I figured I'd make a stored
procedure out of it, but it's bombing on that line saying there's an
incorrect syntax. Do you see a problem with my code here? Thanks
again.
CREATE PROCEDURE CreateNewClientDatabase
@pDBName varchar (128)
AS
if not exists(select dbid from master.sysdatabases where name =
@pDBName)
CREATE DATABASE @pDBName
else
raiserror("Database already exists.",3)
if @@error = 0
return 0
else
return -1
*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!