Hi,
My customer has a complex system that is made of jobs, procedures and scripts that
should run almost every day.
The problem is that sometimes, some job can run "a little longer" and theother
procedures and scripts (and even jobs) should wait for jobs to end beforestarting.
Is there a way to call a sql job synchronously from T-SQL, from a dll or from some
language? Are there any sample code?
TIA,
Clment
No, jobs start asynchronously. You can have a bit in a table that gets
flipped to 1 when the job gets invoked (which only happens if the bit is
currently 0), and then flipped back upon successful completion.
"Clment Doss" <cdoss@.nospam.dhs.com.br> wrote in message
news:%23iivexDkIHA.4396@.TK2MSFTNGP04.phx.gbl...
Hi,
My customer has a complex system that is made of jobs, procedures and
scripts that
should run almost every day.
The problem is that sometimes, some job can run "a little longer" and the
other
procedures and scripts (and even jobs) should wait for jobs to end before
starting.
Is there a way to call a sql job synchronously from T-SQL, from a dll or
from some
language? Are there any sample code?
TIA,
Clment
|||Aaron Bertrand [SQL Server MVP] wrote:
> No, jobs start asynchronously. You can have a bit in a table that gets
> flipped to 1 when the job gets invoked (which only happens if the bit is
> currently 0), and then flipped back upon successful completion.
>
I could just check the job status every second. Not very "elegant" solution, but
something like:
startjob("JobName");
while checkjob("JobName")== __running__ {
sleep( 1000 ); // in ms
}
return checkjob("JobName")== __success__;
For optimal perfomance, is there a DLL I can use, or should I use T-SQL?
TIA,
Clment
|||You could also simply have each job in succession start the next job that is
supposed to fire as it's last step.
Kevin G. Boles
Indicium Resources, Inc.
SQL Server MVP
kgboles a earthlink dt net
"Aaron Bertrand [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:eh%23DT2DkIHA.2276@.TK2MSFTNGP05.phx.gbl...
> No, jobs start asynchronously. You can have a bit in a table that gets
> flipped to 1 when the job gets invoked (which only happens if the bit is
> currently 0), and then flipped back upon successful completion.
>
>
> "Clment Doss" <cdoss@.nospam.dhs.com.br> wrote in message
> news:%23iivexDkIHA.4396@.TK2MSFTNGP04.phx.gbl...
> Hi,
> My customer has a complex system that is made of jobs, procedures and
> scripts that
> should run almost every day.
> The problem is that sometimes, some job can run "a little longer" and the
> other
> procedures and scripts (and even jobs) should wait for jobs to end before
> starting.
> Is there a way to call a sql job synchronously from T-SQL, from a dll or
> from some
> language? Are there any sample code?
> TIA,
> Clment
>
|||>>
I could just check the job status every second.[vbcol=seagreen]
Ugh. If the job takes 20 minutes to run, then that is a LOT of wasted
resources. Why not update a flag somewhere only when the job has completed
(with a job you can mark this whether or not the originating step
succeeded)?
Showing posts with label system. Show all posts
Showing posts with label system. Show all posts
Sunday, March 11, 2012
Calling a sql job synchronously
Calling a sql job synchronously
Hi,
My customer has a complex system that is made of jobs, procedures and scr= ipts that should run almost every day.
The problem is that sometimes, some job can run "a little longer" and the= other procedures and scripts (and even jobs) should wait for jobs to end before= starting.
Is there a way to call a sql job synchronously from T-SQL, from a dll or = from some language? Are there any sample code?
TIA,
Cl=E9mentNo, jobs start asynchronously. You can have a bit in a table that gets
flipped to 1 when the job gets invoked (which only happens if the bit is
currently 0), and then flipped back upon successful completion.
"Clément Doss" <cdoss@.nospam.dhs.com.br> wrote in message
news:%23iivexDkIHA.4396@.TK2MSFTNGP04.phx.gbl...
Hi,
My customer has a complex system that is made of jobs, procedures and
scripts that
should run almost every day.
The problem is that sometimes, some job can run "a little longer" and the
other
procedures and scripts (and even jobs) should wait for jobs to end before
starting.
Is there a way to call a sql job synchronously from T-SQL, from a dll or
from some
language? Are there any sample code?
TIA,
Clément|||Aaron Bertrand [SQL Server MVP] wrote:
> No, jobs start asynchronously. You can have a bit in a table that gets= > flipped to 1 when the job gets invoked (which only happens if the bit i=s > currently 0), and then flipped back upon successful completion.
>
I could just check the job status every second. Not very "elegant" soluti=on, but something like:
startjob("JobName");
while checkjob("JobName")=3D=3D __running__ {
sleep( 1000 ); // in ms
}
return checkjob("JobName")=3D=3D __success__;
For optimal perfomance, is there a DLL I can use, or should I use T-SQL?
TIA,
Cl=E9ment|||You could also simply have each job in succession start the next job that is
supposed to fire as it's last step.
--
Kevin G. Boles
Indicium Resources, Inc.
SQL Server MVP
kgboles a earthlink dt net
"Aaron Bertrand [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:eh%23DT2DkIHA.2276@.TK2MSFTNGP05.phx.gbl...
> No, jobs start asynchronously. You can have a bit in a table that gets
> flipped to 1 when the job gets invoked (which only happens if the bit is
> currently 0), and then flipped back upon successful completion.
>
>
> "Clément Doss" <cdoss@.nospam.dhs.com.br> wrote in message
> news:%23iivexDkIHA.4396@.TK2MSFTNGP04.phx.gbl...
> Hi,
> My customer has a complex system that is made of jobs, procedures and
> scripts that
> should run almost every day.
> The problem is that sometimes, some job can run "a little longer" and the
> other
> procedures and scripts (and even jobs) should wait for jobs to end before
> starting.
> Is there a way to call a sql job synchronously from T-SQL, from a dll or
> from some
> language? Are there any sample code?
> TIA,
> Clément
>|||>>
I could just check the job status every second.
Ugh. If the job takes 20 minutes to run, then that is a LOT of wasted
resources. Why not update a flag somewhere only when the job has completed
(with a job you can mark this whether or not the originating step
succeeded)?
My customer has a complex system that is made of jobs, procedures and scr= ipts that should run almost every day.
The problem is that sometimes, some job can run "a little longer" and the= other procedures and scripts (and even jobs) should wait for jobs to end before= starting.
Is there a way to call a sql job synchronously from T-SQL, from a dll or = from some language? Are there any sample code?
TIA,
Cl=E9mentNo, jobs start asynchronously. You can have a bit in a table that gets
flipped to 1 when the job gets invoked (which only happens if the bit is
currently 0), and then flipped back upon successful completion.
"Clément Doss" <cdoss@.nospam.dhs.com.br> wrote in message
news:%23iivexDkIHA.4396@.TK2MSFTNGP04.phx.gbl...
Hi,
My customer has a complex system that is made of jobs, procedures and
scripts that
should run almost every day.
The problem is that sometimes, some job can run "a little longer" and the
other
procedures and scripts (and even jobs) should wait for jobs to end before
starting.
Is there a way to call a sql job synchronously from T-SQL, from a dll or
from some
language? Are there any sample code?
TIA,
Clément|||Aaron Bertrand [SQL Server MVP] wrote:
> No, jobs start asynchronously. You can have a bit in a table that gets= > flipped to 1 when the job gets invoked (which only happens if the bit i=s > currently 0), and then flipped back upon successful completion.
>
I could just check the job status every second. Not very "elegant" soluti=on, but something like:
startjob("JobName");
while checkjob("JobName")=3D=3D __running__ {
sleep( 1000 ); // in ms
}
return checkjob("JobName")=3D=3D __success__;
For optimal perfomance, is there a DLL I can use, or should I use T-SQL?
TIA,
Cl=E9ment|||You could also simply have each job in succession start the next job that is
supposed to fire as it's last step.
--
Kevin G. Boles
Indicium Resources, Inc.
SQL Server MVP
kgboles a earthlink dt net
"Aaron Bertrand [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:eh%23DT2DkIHA.2276@.TK2MSFTNGP05.phx.gbl...
> No, jobs start asynchronously. You can have a bit in a table that gets
> flipped to 1 when the job gets invoked (which only happens if the bit is
> currently 0), and then flipped back upon successful completion.
>
>
> "Clément Doss" <cdoss@.nospam.dhs.com.br> wrote in message
> news:%23iivexDkIHA.4396@.TK2MSFTNGP04.phx.gbl...
> Hi,
> My customer has a complex system that is made of jobs, procedures and
> scripts that
> should run almost every day.
> The problem is that sometimes, some job can run "a little longer" and the
> other
> procedures and scripts (and even jobs) should wait for jobs to end before
> starting.
> Is there a way to call a sql job synchronously from T-SQL, from a dll or
> from some
> language? Are there any sample code?
> TIA,
> Clément
>|||>>
I could just check the job status every second.
Ugh. If the job takes 20 minutes to run, then that is a LOT of wasted
resources. Why not update a flag somewhere only when the job has completed
(with a job you can mark this whether or not the originating step
succeeded)?
Wednesday, March 7, 2012
Call remote proc in TSQL
I have two SQL Servers, both in the same domain. My domain account is
defined as a system administrator on both. On one server I set up a linked
server definition to the other and told it to use "logins current security
context". On the second I created a procedure spHelloWorld in master that
creates a table and stuffs a message into it. I tested the proc on that
server and it works fine. I logged into the first server using Query
Analyser using my domain account. I then execute this :
exec RMTSRVRNAME.master.dbo.spHelloWorld.
I get back this error:
Server: Msg 18452, Level 14, State 1, Line 1
Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection.
I f I change the linked server propertyies to always use the sa/password of
the linked server it works fine. What am I missing here? Can't I use
windows authentication with linked servers?
Barry
Check out "Security Account Delegation" in the BOL.
Tom
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com
<barryfz@.home.com> wrote in message
news:uk2AGGPvEHA.2536@.TK2MSFTNGP11.phx.gbl...
I have two SQL Servers, both in the same domain. My domain account is
defined as a system administrator on both. On one server I set up a linked
server definition to the other and told it to use "logins current security
context". On the second I created a procedure spHelloWorld in master that
creates a table and stuffs a message into it. I tested the proc on that
server and it works fine. I logged into the first server using Query
Analyser using my domain account. I then execute this :
exec RMTSRVRNAME.master.dbo.spHelloWorld.
I get back this error:
Server: Msg 18452, Level 14, State 1, Line 1
Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection.
I f I change the linked server propertyies to always use the sa/password of
the linked server it works fine. What am I missing here? Can't I use
windows authentication with linked servers?
Barry
|||barry
EXEC sp_serveroption SERVER, 'data access' , 'true'
go
use pubs
go
create procedure proc_BARRY
select * from dbo.authors
go
select *
from OPENQUERY(OPUSPENGUIN,'exec pubs.dbo.proc_BARRY')
go
-- clean-up
drop procedure proc_BARRY
go
<barryfz@.home.com> wrote in message
news:uk2AGGPvEHA.2536@.TK2MSFTNGP11.phx.gbl...
> I have two SQL Servers, both in the same domain. My domain account is
> defined as a system administrator on both. On one server I set up a linked
> server definition to the other and told it to use "logins current security
> context". On the second I created a procedure spHelloWorld in master that
> creates a table and stuffs a message into it. I tested the proc on that
> server and it works fine. I logged into the first server using Query
> Analyser using my domain account. I then execute this :
> exec RMTSRVRNAME.master.dbo.spHelloWorld.
> I get back this error:
> Server: Msg 18452, Level 14, State 1, Line 1
> Login failed for user '(null)'. Reason: Not associated with a trusted SQL
> Server connection.
> I f I change the linked server propertyies to always use the sa/password
of
> the linked server it works fine. What am I missing here? Can't I use
> windows authentication with linked servers?
>
> Barry
>
|||Hi Barry ,
I wanted to post a quick note to see if you would like additional
assistance or information regarding this particular issue. Have you tried
Uri Dimant's statement? We appreciate your patience and look forward to
hearing from you!
Sincerely yours,
Michael Cheng
Online Partner Support Specialist
Partner Support Group
Microsoft Global Technical Support Center
Get Secure! - http://www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only, many thanks!
|||I have check out the recommendations suggested and found them useful but I
am still having a problem. What I have done now is made my remote server a
linked Server using Enterprise Manager and for now I have set the security
to map to the sa for all requests. The remote server is names Mikey. When I
run this:
select * from mikey.master.dbo.CPIRestoreDB
I get back the rows from the table
But when I run this:
exec mikey.master.dbo.spHelloWorld
I get:: Could not execute procedure on remote server 'mikey' because SQL
Server is not configured for remote access.
Why can't I run a sp?
Barry
|||barryfz@.home.com wrote:
> I have check out the recommendations suggested and found them useful
> but I am still having a problem. What I have done now is made my
> remote server a linked Server using Enterprise Manager and for now I
> have set the security to map to the sa for all requests. The remote
> server is names Mikey. When I run this:
> select * from mikey.master.dbo.CPIRestoreDB
> I get back the rows from the table
> But when I run this:
> exec mikey.master.dbo.spHelloWorld
> I get:: Could not execute procedure on remote server 'mikey'
> because SQL Server is not configured for remote access.
> Why can't I run a sp?
> Barry
AFAIK, in the linked server properties, check the box "RPC in", right?
|||Hi Barry,
Have you tried Zarko Jovanovic's suggestion? I wanted to post a quick note
to see if you would like additional assistance or information regarding
this particular issue. We appreciate your patience and look forward to
hearing from you!
Thank you for your patience and corporation. If you have any questions or
concerns, don't hesitate to let me know. We are always here to be of
assistance!
Sincerely yours,
Michael Cheng
Online Partner Support Specialist
Partner Support Group
Microsoft Global Technical Support Center
Get Secure! - http://www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only, many thanks!
defined as a system administrator on both. On one server I set up a linked
server definition to the other and told it to use "logins current security
context". On the second I created a procedure spHelloWorld in master that
creates a table and stuffs a message into it. I tested the proc on that
server and it works fine. I logged into the first server using Query
Analyser using my domain account. I then execute this :
exec RMTSRVRNAME.master.dbo.spHelloWorld.
I get back this error:
Server: Msg 18452, Level 14, State 1, Line 1
Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection.
I f I change the linked server propertyies to always use the sa/password of
the linked server it works fine. What am I missing here? Can't I use
windows authentication with linked servers?
Barry
Check out "Security Account Delegation" in the BOL.
Tom
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com
<barryfz@.home.com> wrote in message
news:uk2AGGPvEHA.2536@.TK2MSFTNGP11.phx.gbl...
I have two SQL Servers, both in the same domain. My domain account is
defined as a system administrator on both. On one server I set up a linked
server definition to the other and told it to use "logins current security
context". On the second I created a procedure spHelloWorld in master that
creates a table and stuffs a message into it. I tested the proc on that
server and it works fine. I logged into the first server using Query
Analyser using my domain account. I then execute this :
exec RMTSRVRNAME.master.dbo.spHelloWorld.
I get back this error:
Server: Msg 18452, Level 14, State 1, Line 1
Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection.
I f I change the linked server propertyies to always use the sa/password of
the linked server it works fine. What am I missing here? Can't I use
windows authentication with linked servers?
Barry
|||barry
EXEC sp_serveroption SERVER, 'data access' , 'true'
go
use pubs
go
create procedure proc_BARRY
select * from dbo.authors
go
select *
from OPENQUERY(OPUSPENGUIN,'exec pubs.dbo.proc_BARRY')
go
-- clean-up
drop procedure proc_BARRY
go
<barryfz@.home.com> wrote in message
news:uk2AGGPvEHA.2536@.TK2MSFTNGP11.phx.gbl...
> I have two SQL Servers, both in the same domain. My domain account is
> defined as a system administrator on both. On one server I set up a linked
> server definition to the other and told it to use "logins current security
> context". On the second I created a procedure spHelloWorld in master that
> creates a table and stuffs a message into it. I tested the proc on that
> server and it works fine. I logged into the first server using Query
> Analyser using my domain account. I then execute this :
> exec RMTSRVRNAME.master.dbo.spHelloWorld.
> I get back this error:
> Server: Msg 18452, Level 14, State 1, Line 1
> Login failed for user '(null)'. Reason: Not associated with a trusted SQL
> Server connection.
> I f I change the linked server propertyies to always use the sa/password
of
> the linked server it works fine. What am I missing here? Can't I use
> windows authentication with linked servers?
>
> Barry
>
|||Hi Barry ,
I wanted to post a quick note to see if you would like additional
assistance or information regarding this particular issue. Have you tried
Uri Dimant's statement? We appreciate your patience and look forward to
hearing from you!
Sincerely yours,
Michael Cheng
Online Partner Support Specialist
Partner Support Group
Microsoft Global Technical Support Center
Get Secure! - http://www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only, many thanks!
|||I have check out the recommendations suggested and found them useful but I
am still having a problem. What I have done now is made my remote server a
linked Server using Enterprise Manager and for now I have set the security
to map to the sa for all requests. The remote server is names Mikey. When I
run this:
select * from mikey.master.dbo.CPIRestoreDB
I get back the rows from the table
But when I run this:
exec mikey.master.dbo.spHelloWorld
I get:: Could not execute procedure on remote server 'mikey' because SQL
Server is not configured for remote access.
Why can't I run a sp?
Barry
|||barryfz@.home.com wrote:
> I have check out the recommendations suggested and found them useful
> but I am still having a problem. What I have done now is made my
> remote server a linked Server using Enterprise Manager and for now I
> have set the security to map to the sa for all requests. The remote
> server is names Mikey. When I run this:
> select * from mikey.master.dbo.CPIRestoreDB
> I get back the rows from the table
> But when I run this:
> exec mikey.master.dbo.spHelloWorld
> I get:: Could not execute procedure on remote server 'mikey'
> because SQL Server is not configured for remote access.
> Why can't I run a sp?
> Barry
AFAIK, in the linked server properties, check the box "RPC in", right?
|||Hi Barry,
Have you tried Zarko Jovanovic's suggestion? I wanted to post a quick note
to see if you would like additional assistance or information regarding
this particular issue. We appreciate your patience and look forward to
hearing from you!
Thank you for your patience and corporation. If you have any questions or
concerns, don't hesitate to let me know. We are always here to be of
assistance!
Sincerely yours,
Michael Cheng
Online Partner Support Specialist
Partner Support Group
Microsoft Global Technical Support Center
Get Secure! - http://www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only, many thanks!
Call remote proc in TSQL
I have two SQL Servers, both in the same domain. My domain account is
defined as a system administrator on both. On one server I set up a linked
server definition to the other and told it to use "logins current security
context". On the second I created a procedure spHelloWorld in master that
creates a table and stuffs a message into it. I tested the proc on that
server and it works fine. I logged into the first server using Query
Analyser using my domain account. I then execute this :
exec RMTSRVRNAME.master.dbo.spHelloWorld.
I get back this error:
Server: Msg 18452, Level 14, State 1, Line 1
Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection.
I f I change the linked server propertyies to always use the sa/password of
the linked server it works fine. What am I missing here? Can't I use
windows authentication with linked servers?
BarryCheck out "Security Account Delegation" in the BOL.
Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com
<barryfz@.home.com> wrote in message
news:uk2AGGPvEHA.2536@.TK2MSFTNGP11.phx.gbl...
I have two SQL Servers, both in the same domain. My domain account is
defined as a system administrator on both. On one server I set up a linked
server definition to the other and told it to use "logins current security
context". On the second I created a procedure spHelloWorld in master that
creates a table and stuffs a message into it. I tested the proc on that
server and it works fine. I logged into the first server using Query
Analyser using my domain account. I then execute this :
exec RMTSRVRNAME.master.dbo.spHelloWorld.
I get back this error:
Server: Msg 18452, Level 14, State 1, Line 1
Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection.
I f I change the linked server propertyies to always use the sa/password of
the linked server it works fine. What am I missing here? Can't I use
windows authentication with linked servers?
Barry|||barry
EXEC sp_serveroption SERVER, 'data access' , 'true'
go
use pubs
go
create procedure proc_BARRY
select * from dbo.authors
go
select *
from OPENQUERY(OPUSPENGUIN,'exec pubs.dbo.proc_BARRY')
go
-- clean-up
drop procedure proc_BARRY
go
<barryfz@.home.com> wrote in message
news:uk2AGGPvEHA.2536@.TK2MSFTNGP11.phx.gbl...
> I have two SQL Servers, both in the same domain. My domain account is
> defined as a system administrator on both. On one server I set up a linked
> server definition to the other and told it to use "logins current security
> context". On the second I created a procedure spHelloWorld in master that
> creates a table and stuffs a message into it. I tested the proc on that
> server and it works fine. I logged into the first server using Query
> Analyser using my domain account. I then execute this :
> exec RMTSRVRNAME.master.dbo.spHelloWorld.
> I get back this error:
> Server: Msg 18452, Level 14, State 1, Line 1
> Login failed for user '(null)'. Reason: Not associated with a trusted SQL
> Server connection.
> I f I change the linked server propertyies to always use the sa/password
of
> the linked server it works fine. What am I missing here? Can't I use
> windows authentication with linked servers?
>
> Barry
>|||Hi Barry ,
I wanted to post a quick note to see if you would like additional
assistance or information regarding this particular issue. Have you tried
Uri Dimant's statement? We appreciate your patience and look forward to
hearing from you!
Sincerely yours,
Michael Cheng
Online Partner Support Specialist
Partner Support Group
Microsoft Global Technical Support Center
---
Get Secure! - http://www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only, many thanks!|||I have check out the recommendations suggested and found them useful but I
am still having a problem. What I have done now is made my remote server a
linked Server using Enterprise Manager and for now I have set the security
to map to the sa for all requests. The remote server is names Mikey. When I
run this:
select * from mikey.master.dbo.CPIRestoreDB
I get back the rows from the table
But when I run this:
exec mikey.master.dbo.spHelloWorld
I get:: Could not execute procedure on remote server 'mikey' because SQL
Server is not configured for remote access.
Why can't I run a sp'
Barry|||barryfz@.home.com wrote:
> I have check out the recommendations suggested and found them useful
> but I am still having a problem. What I have done now is made my
> remote server a linked Server using Enterprise Manager and for now I
> have set the security to map to the sa for all requests. The remote
> server is names Mikey. When I run this:
> select * from mikey.master.dbo.CPIRestoreDB
> I get back the rows from the table
> But when I run this:
> exec mikey.master.dbo.spHelloWorld
> I get:: Could not execute procedure on remote server 'mikey'
> because SQL Server is not configured for remote access.
> Why can't I run a sp'
> Barry
AFAIK, in the linked server properties, check the box "RPC in", right?|||Hi Barry,
Have you tried Zarko Jovanovic's suggestion? I wanted to post a quick note
to see if you would like additional assistance or information regarding
this particular issue. We appreciate your patience and look forward to
hearing from you!
Thank you for your patience and corporation. If you have any questions or
concerns, don't hesitate to let me know. We are always here to be of
assistance!
Sincerely yours,
Michael Cheng
Online Partner Support Specialist
Partner Support Group
Microsoft Global Technical Support Center
---
Get Secure! - http://www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only, many thanks!
defined as a system administrator on both. On one server I set up a linked
server definition to the other and told it to use "logins current security
context". On the second I created a procedure spHelloWorld in master that
creates a table and stuffs a message into it. I tested the proc on that
server and it works fine. I logged into the first server using Query
Analyser using my domain account. I then execute this :
exec RMTSRVRNAME.master.dbo.spHelloWorld.
I get back this error:
Server: Msg 18452, Level 14, State 1, Line 1
Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection.
I f I change the linked server propertyies to always use the sa/password of
the linked server it works fine. What am I missing here? Can't I use
windows authentication with linked servers?
BarryCheck out "Security Account Delegation" in the BOL.
Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com
<barryfz@.home.com> wrote in message
news:uk2AGGPvEHA.2536@.TK2MSFTNGP11.phx.gbl...
I have two SQL Servers, both in the same domain. My domain account is
defined as a system administrator on both. On one server I set up a linked
server definition to the other and told it to use "logins current security
context". On the second I created a procedure spHelloWorld in master that
creates a table and stuffs a message into it. I tested the proc on that
server and it works fine. I logged into the first server using Query
Analyser using my domain account. I then execute this :
exec RMTSRVRNAME.master.dbo.spHelloWorld.
I get back this error:
Server: Msg 18452, Level 14, State 1, Line 1
Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection.
I f I change the linked server propertyies to always use the sa/password of
the linked server it works fine. What am I missing here? Can't I use
windows authentication with linked servers?
Barry|||barry
EXEC sp_serveroption SERVER, 'data access' , 'true'
go
use pubs
go
create procedure proc_BARRY
select * from dbo.authors
go
select *
from OPENQUERY(OPUSPENGUIN,'exec pubs.dbo.proc_BARRY')
go
-- clean-up
drop procedure proc_BARRY
go
<barryfz@.home.com> wrote in message
news:uk2AGGPvEHA.2536@.TK2MSFTNGP11.phx.gbl...
> I have two SQL Servers, both in the same domain. My domain account is
> defined as a system administrator on both. On one server I set up a linked
> server definition to the other and told it to use "logins current security
> context". On the second I created a procedure spHelloWorld in master that
> creates a table and stuffs a message into it. I tested the proc on that
> server and it works fine. I logged into the first server using Query
> Analyser using my domain account. I then execute this :
> exec RMTSRVRNAME.master.dbo.spHelloWorld.
> I get back this error:
> Server: Msg 18452, Level 14, State 1, Line 1
> Login failed for user '(null)'. Reason: Not associated with a trusted SQL
> Server connection.
> I f I change the linked server propertyies to always use the sa/password
of
> the linked server it works fine. What am I missing here? Can't I use
> windows authentication with linked servers?
>
> Barry
>|||Hi Barry ,
I wanted to post a quick note to see if you would like additional
assistance or information regarding this particular issue. Have you tried
Uri Dimant's statement? We appreciate your patience and look forward to
hearing from you!
Sincerely yours,
Michael Cheng
Online Partner Support Specialist
Partner Support Group
Microsoft Global Technical Support Center
---
Get Secure! - http://www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only, many thanks!|||I have check out the recommendations suggested and found them useful but I
am still having a problem. What I have done now is made my remote server a
linked Server using Enterprise Manager and for now I have set the security
to map to the sa for all requests. The remote server is names Mikey. When I
run this:
select * from mikey.master.dbo.CPIRestoreDB
I get back the rows from the table
But when I run this:
exec mikey.master.dbo.spHelloWorld
I get:: Could not execute procedure on remote server 'mikey' because SQL
Server is not configured for remote access.
Why can't I run a sp'
Barry|||barryfz@.home.com wrote:
> I have check out the recommendations suggested and found them useful
> but I am still having a problem. What I have done now is made my
> remote server a linked Server using Enterprise Manager and for now I
> have set the security to map to the sa for all requests. The remote
> server is names Mikey. When I run this:
> select * from mikey.master.dbo.CPIRestoreDB
> I get back the rows from the table
> But when I run this:
> exec mikey.master.dbo.spHelloWorld
> I get:: Could not execute procedure on remote server 'mikey'
> because SQL Server is not configured for remote access.
> Why can't I run a sp'
> Barry
AFAIK, in the linked server properties, check the box "RPC in", right?|||Hi Barry,
Have you tried Zarko Jovanovic's suggestion? I wanted to post a quick note
to see if you would like additional assistance or information regarding
this particular issue. We appreciate your patience and look forward to
hearing from you!
Thank you for your patience and corporation. If you have any questions or
concerns, don't hesitate to let me know. We are always here to be of
assistance!
Sincerely yours,
Michael Cheng
Online Partner Support Specialist
Partner Support Group
Microsoft Global Technical Support Center
---
Get Secure! - http://www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only, many thanks!
Call remote proc in TSQL
I have two SQL Servers, both in the same domain. My domain account is
defined as a system administrator on both. On one server I set up a linked
server definition to the other and told it to use "logins current security
context". On the second I created a procedure spHelloWorld in master that
creates a table and stuffs a message into it. I tested the proc on that
server and it works fine. I logged into the first server using Query
Analyser using my domain account. I then execute this :
exec RMTSRVRNAME.master.dbo.spHelloWorld.
I get back this error:
Server: Msg 18452, Level 14, State 1, Line 1
Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection.
I f I change the linked server propertyies to always use the sa/password of
the linked server it works fine. What am I missing here? Can't I use
windows authentication with linked servers?
BarryCheck out "Security Account Delegation" in the BOL.
--
Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com
<barryfz@.home.com> wrote in message
news:uk2AGGPvEHA.2536@.TK2MSFTNGP11.phx.gbl...
I have two SQL Servers, both in the same domain. My domain account is
defined as a system administrator on both. On one server I set up a linked
server definition to the other and told it to use "logins current security
context". On the second I created a procedure spHelloWorld in master that
creates a table and stuffs a message into it. I tested the proc on that
server and it works fine. I logged into the first server using Query
Analyser using my domain account. I then execute this :
exec RMTSRVRNAME.master.dbo.spHelloWorld.
I get back this error:
Server: Msg 18452, Level 14, State 1, Line 1
Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection.
I f I change the linked server propertyies to always use the sa/password of
the linked server it works fine. What am I missing here? Can't I use
windows authentication with linked servers?
Barry|||barry
EXEC sp_serveroption SERVER, 'data access' , 'true'
go
use pubs
go
create procedure proc_BARRY
select * from dbo.authors
go
select *
from OPENQUERY(OPUSPENGUIN,'exec pubs.dbo.proc_BARRY')
go
-- clean-up
drop procedure proc_BARRY
go
<barryfz@.home.com> wrote in message
news:uk2AGGPvEHA.2536@.TK2MSFTNGP11.phx.gbl...
> I have two SQL Servers, both in the same domain. My domain account is
> defined as a system administrator on both. On one server I set up a linked
> server definition to the other and told it to use "logins current security
> context". On the second I created a procedure spHelloWorld in master that
> creates a table and stuffs a message into it. I tested the proc on that
> server and it works fine. I logged into the first server using Query
> Analyser using my domain account. I then execute this :
> exec RMTSRVRNAME.master.dbo.spHelloWorld.
> I get back this error:
> Server: Msg 18452, Level 14, State 1, Line 1
> Login failed for user '(null)'. Reason: Not associated with a trusted SQL
> Server connection.
> I f I change the linked server propertyies to always use the sa/password
of
> the linked server it works fine. What am I missing here? Can't I use
> windows authentication with linked servers?
>
> Barry
>|||Hi Barry ,
I wanted to post a quick note to see if you would like additional
assistance or information regarding this particular issue. Have you tried
Uri Dimant's statement? We appreciate your patience and look forward to
hearing from you!
Sincerely yours,
Michael Cheng
Online Partner Support Specialist
Partner Support Group
Microsoft Global Technical Support Center
---
Get Secure! - http://www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only, many thanks!|||I have check out the recommendations suggested and found them useful but I
am still having a problem. What I have done now is made my remote server a
linked Server using Enterprise Manager and for now I have set the security
to map to the sa for all requests. The remote server is names Mikey. When I
run this:
select * from mikey.master.dbo.CPIRestoreDB
I get back the rows from the table
But when I run this:
exec mikey.master.dbo.spHelloWorld
I get:: Could not execute procedure on remote server 'mikey' because SQL
Server is not configured for remote access.
Why can't I run a sp'
Barry|||barryfz@.home.com wrote:
> I have check out the recommendations suggested and found them useful
> but I am still having a problem. What I have done now is made my
> remote server a linked Server using Enterprise Manager and for now I
> have set the security to map to the sa for all requests. The remote
> server is names Mikey. When I run this:
> select * from mikey.master.dbo.CPIRestoreDB
> I get back the rows from the table
> But when I run this:
> exec mikey.master.dbo.spHelloWorld
> I get:: Could not execute procedure on remote server 'mikey'
> because SQL Server is not configured for remote access.
> Why can't I run a sp'
> Barry
AFAIK, in the linked server properties, check the box "RPC in", right?|||Hi Barry,
Have you tried Zarko Jovanovic's suggestion? I wanted to post a quick note
to see if you would like additional assistance or information regarding
this particular issue. We appreciate your patience and look forward to
hearing from you!
Thank you for your patience and corporation. If you have any questions or
concerns, don't hesitate to let me know. We are always here to be of
assistance!
Sincerely yours,
Michael Cheng
Online Partner Support Specialist
Partner Support Group
Microsoft Global Technical Support Center
---
Get Secure! - http://www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only, many thanks!
defined as a system administrator on both. On one server I set up a linked
server definition to the other and told it to use "logins current security
context". On the second I created a procedure spHelloWorld in master that
creates a table and stuffs a message into it. I tested the proc on that
server and it works fine. I logged into the first server using Query
Analyser using my domain account. I then execute this :
exec RMTSRVRNAME.master.dbo.spHelloWorld.
I get back this error:
Server: Msg 18452, Level 14, State 1, Line 1
Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection.
I f I change the linked server propertyies to always use the sa/password of
the linked server it works fine. What am I missing here? Can't I use
windows authentication with linked servers?
BarryCheck out "Security Account Delegation" in the BOL.
--
Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com
<barryfz@.home.com> wrote in message
news:uk2AGGPvEHA.2536@.TK2MSFTNGP11.phx.gbl...
I have two SQL Servers, both in the same domain. My domain account is
defined as a system administrator on both. On one server I set up a linked
server definition to the other and told it to use "logins current security
context". On the second I created a procedure spHelloWorld in master that
creates a table and stuffs a message into it. I tested the proc on that
server and it works fine. I logged into the first server using Query
Analyser using my domain account. I then execute this :
exec RMTSRVRNAME.master.dbo.spHelloWorld.
I get back this error:
Server: Msg 18452, Level 14, State 1, Line 1
Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection.
I f I change the linked server propertyies to always use the sa/password of
the linked server it works fine. What am I missing here? Can't I use
windows authentication with linked servers?
Barry|||barry
EXEC sp_serveroption SERVER, 'data access' , 'true'
go
use pubs
go
create procedure proc_BARRY
select * from dbo.authors
go
select *
from OPENQUERY(OPUSPENGUIN,'exec pubs.dbo.proc_BARRY')
go
-- clean-up
drop procedure proc_BARRY
go
<barryfz@.home.com> wrote in message
news:uk2AGGPvEHA.2536@.TK2MSFTNGP11.phx.gbl...
> I have two SQL Servers, both in the same domain. My domain account is
> defined as a system administrator on both. On one server I set up a linked
> server definition to the other and told it to use "logins current security
> context". On the second I created a procedure spHelloWorld in master that
> creates a table and stuffs a message into it. I tested the proc on that
> server and it works fine. I logged into the first server using Query
> Analyser using my domain account. I then execute this :
> exec RMTSRVRNAME.master.dbo.spHelloWorld.
> I get back this error:
> Server: Msg 18452, Level 14, State 1, Line 1
> Login failed for user '(null)'. Reason: Not associated with a trusted SQL
> Server connection.
> I f I change the linked server propertyies to always use the sa/password
of
> the linked server it works fine. What am I missing here? Can't I use
> windows authentication with linked servers?
>
> Barry
>|||Hi Barry ,
I wanted to post a quick note to see if you would like additional
assistance or information regarding this particular issue. Have you tried
Uri Dimant's statement? We appreciate your patience and look forward to
hearing from you!
Sincerely yours,
Michael Cheng
Online Partner Support Specialist
Partner Support Group
Microsoft Global Technical Support Center
---
Get Secure! - http://www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only, many thanks!|||I have check out the recommendations suggested and found them useful but I
am still having a problem. What I have done now is made my remote server a
linked Server using Enterprise Manager and for now I have set the security
to map to the sa for all requests. The remote server is names Mikey. When I
run this:
select * from mikey.master.dbo.CPIRestoreDB
I get back the rows from the table
But when I run this:
exec mikey.master.dbo.spHelloWorld
I get:: Could not execute procedure on remote server 'mikey' because SQL
Server is not configured for remote access.
Why can't I run a sp'
Barry|||barryfz@.home.com wrote:
> I have check out the recommendations suggested and found them useful
> but I am still having a problem. What I have done now is made my
> remote server a linked Server using Enterprise Manager and for now I
> have set the security to map to the sa for all requests. The remote
> server is names Mikey. When I run this:
> select * from mikey.master.dbo.CPIRestoreDB
> I get back the rows from the table
> But when I run this:
> exec mikey.master.dbo.spHelloWorld
> I get:: Could not execute procedure on remote server 'mikey'
> because SQL Server is not configured for remote access.
> Why can't I run a sp'
> Barry
AFAIK, in the linked server properties, check the box "RPC in", right?|||Hi Barry,
Have you tried Zarko Jovanovic's suggestion? I wanted to post a quick note
to see if you would like additional assistance or information regarding
this particular issue. We appreciate your patience and look forward to
hearing from you!
Thank you for your patience and corporation. If you have any questions or
concerns, don't hesitate to let me know. We are always here to be of
assistance!
Sincerely yours,
Michael Cheng
Online Partner Support Specialist
Partner Support Group
Microsoft Global Technical Support Center
---
Get Secure! - http://www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only, many thanks!
Subscribe to:
Posts (Atom)