Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Database creation with hyphen using stored procedure

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-08-02 : 08:59:55
Srinivas writes "Hi!

How do I create a database with a hyphen in the database name for eg 'abc-com' using a stored procedure.

I get an error when i use the following statements inside a stored procedure.


declare @DBName as varchar(50)
set @DBName = "abc-com"
CREATE DATABASE @DBName

This doesn't work even if i use the exec command

exec(" create database " + @DBName )

thanks in advance.
Srinivas

System configuration;
win 2000
sql 2000"
   

- Advertisement -