Hi mssql monsters, and monsters = )
The situation is this: fat is a stored procedure, there are several temporary tables, and everything. At the end of the procedure creates a result table with the desired data
DECLARE @search table ( .... )
INSERT INTO @search (...) select ... union select ....
I hranicu parameter
@a where [varchar](500)
the parameter looks like this:
SET @where = 'SELECT * FROM @search WHERE id > 0 AND name like "%apple%"'
and at the end of the procedure I'm trying to do this:
BUT as you know, the exec creates the context and the code does not see lying. table Demian Smith
Question — is it possible to do so in order to see the table(@search) inside exec?
How can you choose from this hranilki anything? (if you try to make the outside a temporary table and do
INSERT INTO @newTemp exec [dbo].[search_proc]
— gives an error about nested exec. (this procedure is already running, and insert them into table — time)