anybody have an idea how to call a server through a stored procedure...
ex)
from my asp, i connect to sql server then call a stored procedure...in the stored procedure i want to connect to a remote database (jdedwards) and bring back tables to use in that procedure that eventually is used for output.
how do you make the connection to jde?You can do it through either linked server or remote server. Either way, you need to register the 2nd server on the first server. Provided permision is granted, you then run query in the 'select * from serverName.dbName.owner.tableName' format.|||thanks!
but now HOW DO I register my sql server to connect to a non Sql Server....the only way I can connect to the other Database is through ODBC? In other words, I need my sql server's stored procedure to ODBC to a non SQL server; i.e., AS/400.
Showing posts with label idea. Show all posts
Showing posts with label idea. Show all posts
Tuesday, March 20, 2012
Sunday, March 11, 2012
Calling a sp from a UDF
Dear folks,
Is it possible? We are getting a error message from QA.
Let me know any thought/idea/link about this.
Regards,
Enric"Enric" <Enric@.discussions.microsoft.com> wrote in message
news:372F7226-3FF0-42D2-A446-9B87691685BD@.microsoft.com...
> Dear folks,
> Is it possible? We are getting a error message from QA.
> Let me know any thought/idea/link about this.
> Regards,
> Enric|||"Enric" <Enric@.discussions.microsoft.com> wrote in message
news:372F7226-3FF0-42D2-A446-9B87691685BD@.microsoft.com...
> Dear folks,
> Is it possible? We are getting a error message from QA.
> Let me know any thought/idea/link about this.
> Regards,
> Enric
From the BOL
The types of statements that are valid in a function include:
a.. DECLARE statements can be used to define data variables and cursors
that are local to the function.
b.. Assignments of values to objects local to the function, such as using
SET to assign values to scalar and table local variables.
c.. Cursor operations that reference local cursors that are declared,
opened, closed, and deallocated in the function. FETCH statements that
return data to the client are not allowed. Only FETCH statements that assign
values to local variables using the INTO clause are allowed.
d.. Control-of-flow statements.
e.. SELECT statements containing select lists with expressions that assign
values to variables that are local to the function.
f.. UPDATE, INSERT, and DELETE statements modifying table variables that
are local to the function.
g.. EXECUTE statements calling an extended stored procedure.
So it looks like you can call extended sprocs, but not local sprocs.
Rick Sawtell
MCT, MCSD, MCDBA|||Only extended procedures can be executed from user-defined functions. Can't
you include the logic from your procedure in the UDF?
ML
http://milambda.blogspot.com/|||"Enric" <Enric@.discussions.microsoft.com> wrote in message
news:372F7226-3FF0-42D2-A446-9B87691685BD@.microsoft.com...
> Dear folks,
> Is it possible? We are getting a error message from QA.
> Let me know any thought/idea/link about this.
> Regards,
> Enric
From BOL:
The following statements are allowed in the body of a multi-statement
function. Statements not in this list are not allowed in the body of a
function: ...
Assignment statements.
Control-of-Flow statements.
DECLARE statements defining data variables and cursors that are local to the
function.
SELECT statements containing select lists with expressions that assign
values to variables that are local to the function.
Cursor operations referencing local cursors that are declared, opened,
closed, and deallocated in the function. Only FETCH statements that assign
values to local variables using the INTO clause are allowed; FETCH
statements that return data to the client are not allowed.
UPDATE, INSERT, and DELETE statements modifying table variables that are
local to the function.
EXECUTE statements calling an extended stored procedure.
Also from BOL:
User-defined functions cannot be used to perform a set of actions that
modify the global database state.|||No this is not possible.
HTH, jens Suessmeyer.|||Have not tried it, but couldn't you call a clr sproc from a clr UDF?
William Stacey [MVP]
"Enric" <Enric@.discussions.microsoft.com> wrote in message
news:372F7226-3FF0-42D2-A446-9B87691685BD@.microsoft.com...
| Dear folks,
|
| Is it possible? We are getting a error message from QA.
| Let me know any thought/idea/link about this.
|
| Regards,
|
| Enric
Is it possible? We are getting a error message from QA.
Let me know any thought/idea/link about this.
Regards,
Enric"Enric" <Enric@.discussions.microsoft.com> wrote in message
news:372F7226-3FF0-42D2-A446-9B87691685BD@.microsoft.com...
> Dear folks,
> Is it possible? We are getting a error message from QA.
> Let me know any thought/idea/link about this.
> Regards,
> Enric|||"Enric" <Enric@.discussions.microsoft.com> wrote in message
news:372F7226-3FF0-42D2-A446-9B87691685BD@.microsoft.com...
> Dear folks,
> Is it possible? We are getting a error message from QA.
> Let me know any thought/idea/link about this.
> Regards,
> Enric
From the BOL
The types of statements that are valid in a function include:
a.. DECLARE statements can be used to define data variables and cursors
that are local to the function.
b.. Assignments of values to objects local to the function, such as using
SET to assign values to scalar and table local variables.
c.. Cursor operations that reference local cursors that are declared,
opened, closed, and deallocated in the function. FETCH statements that
return data to the client are not allowed. Only FETCH statements that assign
values to local variables using the INTO clause are allowed.
d.. Control-of-flow statements.
e.. SELECT statements containing select lists with expressions that assign
values to variables that are local to the function.
f.. UPDATE, INSERT, and DELETE statements modifying table variables that
are local to the function.
g.. EXECUTE statements calling an extended stored procedure.
So it looks like you can call extended sprocs, but not local sprocs.
Rick Sawtell
MCT, MCSD, MCDBA|||Only extended procedures can be executed from user-defined functions. Can't
you include the logic from your procedure in the UDF?
ML
http://milambda.blogspot.com/|||"Enric" <Enric@.discussions.microsoft.com> wrote in message
news:372F7226-3FF0-42D2-A446-9B87691685BD@.microsoft.com...
> Dear folks,
> Is it possible? We are getting a error message from QA.
> Let me know any thought/idea/link about this.
> Regards,
> Enric
From BOL:
The following statements are allowed in the body of a multi-statement
function. Statements not in this list are not allowed in the body of a
function: ...
Assignment statements.
Control-of-Flow statements.
DECLARE statements defining data variables and cursors that are local to the
function.
SELECT statements containing select lists with expressions that assign
values to variables that are local to the function.
Cursor operations referencing local cursors that are declared, opened,
closed, and deallocated in the function. Only FETCH statements that assign
values to local variables using the INTO clause are allowed; FETCH
statements that return data to the client are not allowed.
UPDATE, INSERT, and DELETE statements modifying table variables that are
local to the function.
EXECUTE statements calling an extended stored procedure.
Also from BOL:
User-defined functions cannot be used to perform a set of actions that
modify the global database state.|||No this is not possible.
HTH, jens Suessmeyer.|||Have not tried it, but couldn't you call a clr sproc from a clr UDF?
William Stacey [MVP]
"Enric" <Enric@.discussions.microsoft.com> wrote in message
news:372F7226-3FF0-42D2-A446-9B87691685BD@.microsoft.com...
| Dear folks,
|
| Is it possible? We are getting a error message from QA.
| Let me know any thought/idea/link about this.
|
| Regards,
|
| Enric
Wednesday, March 7, 2012
call sp_MSget_repl_commands(29, ?, 0, 7500000)
any idea why i'm getting this error on replication?
call sp_MSget_repl_commands(29, ?, 0, 7500000)
Violation of PRIMARY KEY constraint 'PK__@.snapshot_seqnos__2813BD1E'.
Cannot insert duplicate key in object '#271F98E5'.One of the target objects (being replicated) already has a row that replication is trying to insert. That is a bad thing.
You need to discover which object is complaining, and what row is being inserted. Look at the replication tasks, in the job history to see the details of the problem.
-PatP
call sp_MSget_repl_commands(29, ?, 0, 7500000)
Violation of PRIMARY KEY constraint 'PK__@.snapshot_seqnos__2813BD1E'.
Cannot insert duplicate key in object '#271F98E5'.One of the target objects (being replicated) already has a row that replication is trying to insert. That is a bad thing.
You need to discover which object is complaining, and what row is being inserted. Look at the replication tasks, in the job history to see the details of the problem.
-PatP
Labels:
call,
constraint,
database,
error,
idea,
key,
microsoft,
mysql,
oracle,
primary,
replicationcall,
server,
sp_msget_repl_commands,
sql,
violation
Saturday, February 25, 2012
call a program (activex exe, dll or something) from a script
Is it possible to do this? I am evaluating a bunch of possible solutions to
a problem. Someone came up with this idea, but could not remember for
certain if it possible.
Thanks.1. Lookup the sp_OAxxxxxx routines in SQL Online Books and it will show you
how to create COM objects and call method and set properties
2. Lookup xp_cmdshell on how to launch processes
3. Write an extended stored proc to have tighter control over what is
happening (inside your proc you can call CreateProcess() API and do many
other things)
All three of these options have security/stability implications. Let me
know if you need more details on a specific option.
Mike
"Stephanie" <IwishICould@.NoWay.com> wrote in message
news:O8qomUBTFHA.2916@.TK2MSFTNGP15.phx.gbl...
> Is it possible to do this? I am evaluating a bunch of possible solutions
to
> a problem. Someone came up with this idea, but could not remember for
> certain if it possible.
> Thanks.
>
a problem. Someone came up with this idea, but could not remember for
certain if it possible.
Thanks.1. Lookup the sp_OAxxxxxx routines in SQL Online Books and it will show you
how to create COM objects and call method and set properties
2. Lookup xp_cmdshell on how to launch processes
3. Write an extended stored proc to have tighter control over what is
happening (inside your proc you can call CreateProcess() API and do many
other things)
All three of these options have security/stability implications. Let me
know if you need more details on a specific option.
Mike
"Stephanie" <IwishICould@.NoWay.com> wrote in message
news:O8qomUBTFHA.2916@.TK2MSFTNGP15.phx.gbl...
> Is it possible to do this? I am evaluating a bunch of possible solutions
to
> a problem. Someone came up with this idea, but could not remember for
> certain if it possible.
> Thanks.
>
Subscribe to:
Posts (Atom)