Re: EXEC(sqlstatement) Resultset usage

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Anith Sen (anith_at_bizdatasolutions.com)
Date: 11/12/04


Date: Fri, 12 Nov 2004 12:13:28 -0600


>> How do I, from within the same stored procedure, use the result of a sql
>> statement after executing it using the EXEC() command?

If you are referring to the resultset, you can use a #temp table or use a
pass through query. If you are referring to the return value as with a
procedure, you can use a local variable. If you are referring to an value to
be returned as a result of an assignment you may want to use sp_ExecuteSQL
procedure. For details, refer to: KBA 262499 or check section "substituting
parameter values" under the topic "Using sp_ExecuteSQL" in SQL Server Books
Online.

-- 
Anith 


Relevant Pages

  • Re: SQL Parameterized Command versus Custom String
    ... I would use the EXEC String ... command object is trying to execute so you can test it against SQL ... SQL Profiler? ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Cannot open SQL 2000 default database
    ... 1> EXEC sp_default 'mylogin', ... I have to type EXIT or type ctrl-C to get out of the SQL editor. ... error as I did before the error, as though I didn't type the command prompt ... I assume here that you run OSQL on the SQL Server machine itself, ...
    (microsoft.public.sqlserver.connect)
  • Re: Problem in event procedure - help please!
    ... Since Match is a table in your query, it's fields should be available to the ... > "If you are referring to the table called Match and you ... > The SQL was my attempt to do this. ... >>the MatchDate field, you will need to do something to ...
    (microsoft.public.access.formscoding)
  • Re: attribute name conflicts
    ... but I think the "user types" you are referring to are the ... The SQL Syntax ... The first relational DBMS I dealt with, ...
    (comp.databases.theory)
  • Re: Bitwise And
    ... I referred to "AND" in Queries / SQL. ... "In JET, ...". ... "Tom Ellison" wrote in message ... > Perhaps you were referring to the use of And in a query. ...
    (microsoft.public.access.queries)