Home Microsoft SQL Server DigiMailing Contact
    Keyword



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

select

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




Syntax
Last revision
News

  Query a named instance
Sybase+ASE+silent+install
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
VMware
Zoekmachine optimalisatie
SQL Servers hidden objects
FckEditor
Flash in Ajax
De hype die AJAX heet
Barcode scannen
MySQL; Gratis, makkelijk en snel!
PHP
sIFR; de combinatie tussen HTML en Flash