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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accessing SQL Server Databases That Have a - in Database Name 1

Status
Not open for further replies.

JohnBates

MIS
Feb 27, 2000
1,995
US
hi,

I should tell you I know nothing about XML; I'm a SQL Server DBA trying to understand a problem our web developers have identified.

We have a SQL Server(2000)database named W-security.

Apparently when, while in another database, they call a stored procedure that resides in W-security, they get an error. But if the database name is Wsecurity (no hyphen)
it works ok.

I don't have much info, but is there something about the - special character that causes problems in XML. (It works ok when we execute it in T-SQL)

[W_security].dbo.usp_Change_Password 'testadmin', 'SE.205.133.70.99.166.36.225'

We have also tried it without brackets:
W_security.dbo.usp_Change_Password 'testadmin', 'SE.205.133.70.99.166.36.225'

Does anyone know of a login/connection problem that happens when the SQL Server database name contains a hyphen ?

Thanks, John


 
You cannot have a hyphen in a table or database name in SQL. Use square brackets around the database name:
[W-security] like you used when you used an underscore.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top