Answer the question
In order to leave comments, you need to log in
Mssql dynamic where inside stored procedure?
Hello mssql monsters and monsters = )
The situation is this: there is a thick stored procedure, there are several temporary tables and everything in general. At the end of the procedure, a table is created with the resulting desired data
DECLARE @search table ( .... )<br/>
INSERT INTO @search (...) select ... union select ....<br/>
@where [varchar](500)
SET @where = 'SELECT * FROM @search WHERE id > 0 AND name like ''%apple%'''
EXEC(@words)
INSERT INTO @newTemp exec [dbo].[search_proc]
gives an error about nested execs. (In the procedure of this very one, there is already an execution and inserting them into tables - temporary)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question