Executing sql

Executing sql

Post by Russ » Wed, 03 Mar 2004 21:46:07



       Hi ALL,


               I believe to get it to work and act as a select staemant I need to do.






               When I do this is says sp not known .. and fails.

               how do I execute this.. it's part of an insert query if that helps.

           Thanks in advance Russ

 
 
 

Executing sql

Post by Jacco Schalkwij » Wed, 03 Mar 2004 21:51:38


You have to put the SQL string inside parentheses:


You might also want to read the following article:
http://www.sommarskog.se/dynamic_sql.html

--
Jacco Schalkwijk
SQL Server MVP


>        Hi ALL,


>                I believe to get it to work and act as a select staemant I
need to do.






>                When I do this is says sp not known .. and fails.

>                how do I execute this.. it's part of an insert query if
that helps.

>            Thanks in advance Russ


 
 
 

Executing sql

Post by Vishal Parka » Wed, 03 Mar 2004 21:54:38



Ex:

--
Vishal Parkar

 
 
 

Executing sql

Post by Roji. P. Thoma » Wed, 03 Mar 2004 21:57:02


http://www.sommarskog.se/dynamic_sql.html

--
Roji. P. Thomas
SQL Server Programmer

>        Hi ALL,


>                I believe to get it to work and act as a select staemant I
need to do.






>                When I do this is says sp not known .. and fails.

>                how do I execute this.. it's part of an insert query if
that helps.

>            Thanks in advance Russ

 
 
 

Executing sql

Post by Hermilso » Wed, 03 Mar 2004 22:06:05


Hi!

You can use somewhat this:




Hermilson Tinoco

 
 
 

1. Calling/Executing Execute SQL Task from DDQ

I have two tables that have a parent-child relation, and I am trying to
execute a Execute SQL Task (EST) on the child table, from inside the Row
Transform phase of the DDQ (over the parent table) to return a rowset of
child rows. The Workflow Properties of the EST are set to Disable This Task,
and I am using the following code in the DDQ:

set oPkg = DTSGlobalVariables.Parent
oPkg.Steps("EST").Execute(DTSSource("FieldName").Value)

Set ESTrowset = CreateObject("ADODB.RecordSet")
Set ESTrowset = DTSGlobalVariables("gvESTrowset").Value
While Not ESTrowset.EOF
    MsgText = MsgText + ESTrowset.Fields("ESTfield").Value
    ESTrowset.MoveNext
Wend
MsgBox MsgText

However, the Execute function on the EST causes the script to hang! Any
ideas why?

TIA,

Harjit S. Batra

2. Can someone give me some basic knowledge....

3. Execute DTS from asp.Net failure because that package contain execute SQL task

4. ODBC and Large Results?

5. Using Global Variables in Execute SQL Task (SQL 2000)

6. Java client for D4GL

7. Executing sql scripts on a SQL server from Access

8. sqlnet

9. Executing SQL Statements from Oracle to a linked SQL Server DB

10. Execute SQL Task Fail for 2 parametized SQL statement

11. Difference between SQL 6.5 and 7.0 ( when executing SQL query)

12. Show current executing SQL Statement

13. Executing SQL script file