Home Microsoft SQL Server DigiMailing Contact

Query a named instance


When you query a named instance yo can get a syntax error when you don't place the brackets on the right place.

Sample query:
select top 10 * from servername\instancename.databasename.owner.tablename

Errors can be:
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near '\'.

OLE DB provider "SQLNCLI" for linked server "servername" returned message "Login timeout expired".
OLE DB provider "SQLNCLI" for linked server "servername" returned message "An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.".
Msg 2, Level 16, State 1, Line 0
Named Pipes Provider: Could not open a connection to SQL Server

You can solve this by placeing brackets arround the server-, instance name


top 10 * from [servername\instancename].databasename.owner.tablename

Last revision

  Query a named instance
SQL 2008 R2
Deprecated procedures in SQL2008
Reporting Services item-level role definitions
Create all your missing indexes
Converting datetime field
Start MSSQL Server Profiler at time
Replicating MSSQL Server views
Exploring Microsoft Sharepoint
The OLE DB provider "SQLNCLI10" for linked server indicates.
Mobile solar charger
Oracle to SQL Server replication
Cannot insert the value NULL into column
Undocumented Microsoft SQL Server 2008
Zoekmachine optimalisatie
SQL Servers hidden objects
Flash in Ajax
De hype die AJAX heet
Barcode scannen
MySQL; Gratis, makkelijk en snel!
sIFR; de combinatie tussen HTML en Flash