Showing posts with label square. Show all posts
Showing posts with label square. Show all posts

Sunday, March 11, 2012

Connecting to another SQL Server Instance

For Server 'instance' names, becasue of the backslash '', you need to put t
he server\instance name in square brackets. For example:
Select
Column1
, Column2
, etc.
From [UMDPSMB7V\SQLSERVERALT].dbo.Rmtest.Table1
Note: It's bad form to use SELECT *. Much better to list the columns you wan
t. If future needs cause any changes in the database, you code is less likel
y to 'break'.
--
Arnie Rowland, YACE*
"To be successful, your heart must accompany your knowledge."
*Yet Another certification Exam
"rmcompute" <rmcompute@.discussions.microsoft.com> wrote in message news:B79703B6-DABD-4D7F-9
2E7-E7E056D66CA3@.microsoft.com...
>I created another instance of SQL Server and am trying to access a table on
> it from the other server. I set up the code listed below and got the erro
r,
> Line 1: Incorrect syntax near ''. I tried removing the '' and then it
> indicated, Could not find server 'UMDPSMB7VSQLSERVERALT' in sysservers. I
s
> it possible to do this ?
>
> Code: Select * From UMDPSMB7V\SQLSERVERALT.dbo.Rmtest.Table1
>I created another instance of SQL Server and am trying to access a table on
it from the other server. I set up the code listed below and got the error,
Line 1: Incorrect syntax near '\'. I tried removing the '\' and then it
indicated, Could not find server 'UMDPSMB7VSQLSERVERALT' in sysservers. Is
it possible to do this ?
Code: Select * From UMDPSMB7V\SQLSERVERALT.dbo.Rmtest.Table1|||For Server 'instance' names, becasue of the backslash '', you need to put t
he server\instance name in square brackets. For example:
Select
Column1
, Column2
, etc.
From [UMDPSMB7V\SQLSERVERALT].dbo.Rmtest.Table1
Note: It's bad form to use SELECT *. Much better to list the columns you wan
t. If future needs cause any changes in the database, you code is less likel
y to 'break'.
--
Arnie Rowland, YACE*
"To be successful, your heart must accompany your knowledge."
*Yet Another certification Exam
"rmcompute" <rmcompute@.discussions.microsoft.com> wrote in message news:B79703B6-DABD-4D7F-9
2E7-E7E056D66CA3@.microsoft.com...
>I created another instance of SQL Server and am trying to access a table on
> it from the other server. I set up the code listed below and got the erro
r,
> Line 1: Incorrect syntax near ''. I tried removing the '' and then it
> indicated, Could not find server 'UMDPSMB7VSQLSERVERALT' in sysservers. I
s
> it possible to do this ?
>
> Code: Select * From UMDPSMB7V\SQLSERVERALT.dbo.Rmtest.Table1
>|||It worked. Thank you.
"Arnie Rowland" wrote:
[vbcol=seagreen]
> For Server 'instance' names, becasue of the backslash '', you need to put
the server\instance name in square brackets. For example:
> Select
> Column1
> , Column2
> , etc.
> From [UMDPSMB7V\SQLSERVERALT].dbo.Rmtest.Table1
> Note: It's bad form to use SELECT *. Much better to list the columns you w
ant. If future needs cause any changes in the database, you code is less lik
ely to 'break'.
>
> --
> Arnie Rowland, YACE*
> "To be successful, your heart must accompany your knowledge."
> *Yet Another certification Exam
>
> "rmcompute" <rmcompute@.discussions.microsoft.com> wrote in message news:B7
9703B6-DABD-4D7F-92E7-E7E056D66CA3@.microsoft.com...

Wednesday, March 7, 2012

Connecting to a second instance of SQL

There are no invalid characters. Even so I tried enclosing in square brackets
and still no joy.
Its a puzzle !
Si
"Arnie Rowland" wrote:

> Does the Instance Name contain any invalid character, such as '-'?
> Try enclosing the instance name in square brackets, e.g.,
> [MyServer\MyInstance].
> --
> Arnie Rowland, Ph.D.
> Westwood Consulting, Inc
> Most good judgment comes from experience.
> Most experience comes from bad judgment.
> - Anonymous
> You can't help someone get up a hill without getting a little closer to the
> top yourself.
> - H. Norman Schwarzkopf
>
> "Simon" <Simon@.discussions.microsoft.com> wrote in message
> news:A5D1AFBD-54F6-4600-A7EA-215AEFD7A1C6@.microsoft.com...
>
>
Is UDP 1434 open between the SQL Server you are registering
on and the named instance you are trying to register? That
could be what's causing your problems.
You could try an alias and see if that works -
On the SQL Server box where you are trying to register the
named instance, use the Client Network Utility to create an
alias to the named instance and specify the port number
(check the listening port on the named instance).
In that scenario with the alias, you are specifying the port
so you would bypass the SQL Server Resolution Service and
going through UDP 1434.
-Sue
On Mon, 30 Oct 2006 01:20:02 -0800, Simon
<Simon@.discussions.microsoft.com> wrote:
[vbcol=seagreen]
>There are no invalid characters. Even so I tried enclosing in square brackets
>and still no joy.
>Its a puzzle !
>Si
>"Arnie Rowland" wrote: