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
 General SQL Server Forums
 New to SQL Server Programming
 Problem with backslash in server name

Author  Topic 

brianmuth
Starting Member

2 Posts

Posted - 2010-05-22 : 15:26:23
My Server instance has a backslash. When I try to truncate a table with the fully qualified table name, as in:

DELETE FROM MYSERVER\NODE1.STODATABASE.dbo.Junk

I get a syntax error: Incorrect syntax near '\'.

Double quotes doesn't correct the issue.

What is the correct form?

Thanks.

Kristen
Test

22859 Posts

Posted - 2010-05-22 : 16:11:54
Try [...] around the individual parts of the name?

[server].[database].[owner].[table]
Go to Top of Page

brianmuth
Starting Member

2 Posts

Posted - 2010-05-22 : 16:35:51
awesome! That worked. Thanks a lot!!!
Go to Top of Page

jeffw8713
Aged Yak Warrior

819 Posts

Posted - 2010-05-22 : 16:36:02
If QUOTED_IDENTIFIER is ON, you can replace the brackets with double-quotes. Each part of the name needs to be quoted with either brackets or quotes. Either of these will work:

[MYSERVER\NODE1].STODATABASE.dbo.Junk
"MYSERVER\NODE1".STODATABASE.dbo.Junk

Jeff
Go to Top of Page
   

- Advertisement -