diddydustin
Programmer
Hey guys,
I need to create a DTS that accepts a strQuery as user input, compares it exclusively with another query, then return what is left. Once the results are back, I need it to insert this into a table.
Of course I would also need to validate the user input query.
I'm having some trouble with this-- here's what I got so far:
INSERT INTO tblQueItem (intQueID, chrISBN)
((EXEC (@strQuery))
EXCEPT
(SELECT intQueID, chrISBN
FROM vwReportQue
WHERE intQueID = @intQueID))
which returns:
Server: Msg 156, Level 15, State 1, Procedure spExec_tblQuery, Line 16
Incorrect syntax near the keyword 'EXEC'.
Server: Msg 170, Level 15, State 1, Procedure spExec_tblQuery, Line 16
Line 16: Incorrect syntax near ')'.
Server: Msg 170, Level 15, State 1, Procedure spExec_tblQuery, Line 20
Line 20: Incorrect syntax near ')'.
I've also tried Execute sp_executesql and sp_execute but get the same error.
Of course the code above is not validating anything yet.
Any help would be appreciated!
Thanks
Dustin
I need to create a DTS that accepts a strQuery as user input, compares it exclusively with another query, then return what is left. Once the results are back, I need it to insert this into a table.
Of course I would also need to validate the user input query.
I'm having some trouble with this-- here's what I got so far:
INSERT INTO tblQueItem (intQueID, chrISBN)
((EXEC (@strQuery))
EXCEPT
(SELECT intQueID, chrISBN
FROM vwReportQue
WHERE intQueID = @intQueID))
which returns:
Server: Msg 156, Level 15, State 1, Procedure spExec_tblQuery, Line 16
Incorrect syntax near the keyword 'EXEC'.
Server: Msg 170, Level 15, State 1, Procedure spExec_tblQuery, Line 16
Line 16: Incorrect syntax near ')'.
Server: Msg 170, Level 15, State 1, Procedure spExec_tblQuery, Line 20
Line 20: Incorrect syntax near ')'.
I've also tried Execute sp_executesql and sp_execute but get the same error.
Of course the code above is not validating anything yet.
Any help would be appreciated!
Thanks
Dustin