I want to call my stored procedure from VB with a new table name each time and get a recordset back. My stored procedure look something like this:
CREATE procedure upSU_CrossCheck
@tbl nvarchar(10)
as
declare @sqlstring nvarchar(500)
declare @paradef nvarchar(500)
declare @paratbl nvarchar(10)
set @sqlstring = N'
SELECT Country, Ship FROM ' + @tbl
set @paratbl = @tbl
set @paradef = N'@tbl nvarchar(10)'
EXEC sp_executesql @sqlstring, @paradef, @tbl = @paratbl
However I do not get a recordset back when I execute it. If I run it from VB it tells me that the recordset is not open. How do I do that?
CREATE procedure upSU_CrossCheck
@tbl nvarchar(10)
as
declare @sqlstring nvarchar(500)
declare @paradef nvarchar(500)
declare @paratbl nvarchar(10)
set @sqlstring = N'
SELECT Country, Ship FROM ' + @tbl
set @paratbl = @tbl
set @paradef = N'@tbl nvarchar(10)'
EXEC sp_executesql @sqlstring, @paradef, @tbl = @paratbl
However I do not get a recordset back when I execute it. If I run it from VB it tells me that the recordset is not open. How do I do that?