J
Jason MacKenzie
I have a question about populating a datatable from a stored proc. I have a
dynamic Sql statement that I'm building that I execute using the exec
command to populate a temporary table. I then do a select from that table.
Here is a simple example of what I'm talking about
SET @SQL ='SELECT * INTO dbo.TempTable FROM Table;
EXEC (@SQL)
SELECT * FROM dbo.TempTable
GO
In QA everything seems to work fine but my datatable never has any rows in
it (no exception is thrown). I'm thinking it must be because it stops after
the EXEC command.
I've noticed a similar phenomenon when using PRINT for debugging purposes
and forgetting to comment it out.
Is this behaviour by design? Any advice is appreciated,
Jason
dynamic Sql statement that I'm building that I execute using the exec
command to populate a temporary table. I then do a select from that table.
Here is a simple example of what I'm talking about
SET @SQL ='SELECT * INTO dbo.TempTable FROM Table;
EXEC (@SQL)
SELECT * FROM dbo.TempTable
GO
In QA everything seems to work fine but my datatable never has any rows in
it (no exception is thrown). I'm thinking it must be because it stops after
the EXEC command.
I've noticed a similar phenomenon when using PRINT for debugging purposes
and forgetting to comment it out.
Is this behaviour by design? Any advice is appreciated,
Jason