Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Store Proc - Ref Database Name that begins with a number

Status
Not open for further replies.

Chao

MIS
Jun 17, 2002
27
US
Hi

I get a compilation error when trying to reference a database in my stored procedure. I am suspecting that it is becasue the database name begins with a digit. Does anybody know of any other approach to reference the database that begins with a number? I tried putting single and double quotes or maybe I am not using the correct syntax. Perhaps I should just rename the database. If so, is there such a utility?

CHAO
 
you can use sp_rename to rename a database. Look in BOL for usage. Have you tried brackets around the db name?

That usually does it:

[dbname].[owner].[object]

Craig
 
I used the sp_renamedb to rename the database. I think it is safer to stay away from object names that are not in the conventional format.

Thanks for your help
CHAO
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top