We tried to use the embedded â'EXEC SQL CONNECT TO servername.dbname USER uname.passwordâ' but we kept getting the error message: â'Server: Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword 'TO'.â'
We tried the upper / lower case of the â'connect toâ', with / without the " around the server name, database name, user name, but none of them work. What did we do wrong?
Thanks in advance for your help.This does not in any way seem to be valid SQL Server SQL language construct...
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"RC5640808" <RC5640808@.discussions.microsoft.com> wrote in message
news:532A0CB3-51DC-46FE-AD74-E3FA921B3471@.microsoft.com...
> We tried to use the embedded "EXEC SQL CONNECT TO servername.dbname USER uname.password" but we
kept getting the error message: "Server: Msg 156, Level 15, State 1, Line 1
> Incorrect syntax near the keyword 'TO'."
> We tried the upper / lower case of the "connect to", with / without the " around the server name,
database name, user name, but none of them work. What did we do wrong?
> Thanks in advance for your help.
>|||I see, this is embedded SQL, supposed to be run through a precompiler. I suppose that you have below
inside some C-program and you get the error message when you run the c-program through the
precompiler? Is that the case?
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"RC5640808" <RC5640808@.discussions.microsoft.com> wrote in message
news:AB147E8A-3A19-4BDD-9B6C-D47F02C1C020@.microsoft.com...
> This is how it documented in the BOL or the URL below:
> connect to:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/esqlforc/ec_6_erf_01_1g1b.asp
> set connection:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/esqlforc/ec_6_erf_01_5pda.asp
>
>
> "Tibor Karaszi" wrote:
> > This does not in any way seem to be valid SQL Server SQL language construct...
> >
> > --
> > Tibor Karaszi, SQL Server MVP
> > http://www.karaszi.com/sqlserver/default.asp
> > http://www.solidqualitylearning.com/
> >
> >
> > "RC5640808" <RC5640808@.discussions.microsoft.com> wrote in message
> > news:532A0CB3-51DC-46FE-AD74-E3FA921B3471@.microsoft.com...
> > > We tried to use the embedded "EXEC SQL CONNECT TO servername.dbname USER uname.password" but
we
> > kept getting the error message: "Server: Msg 156, Level 15, State 1, Line 1
> > > Incorrect syntax near the keyword 'TO'."
> > >
> > > We tried the upper / lower case of the "connect to", with / without the " around the server
name,
> > database name, user name, but none of them work. What did we do wrong?
> > >
> > > Thanks in advance for your help.
> > >
> >
> >
> >
No comments:
Post a Comment