July 17, 2017 at 9:08 pm
hi
i want to do something like this, is it possible?if not what other option
EXECUTE sp_executesql @emp
except
EXECUTE sp_executesql @dept
both emp and dept has select statement,with same number of columns
July 17, 2017 at 10:23 pm
coool_sweet - Monday, July 17, 2017 9:08 PMhi
i want to do something like this, is it possible?if not what other option
EXECUTE sp_executesql @emp
except
EXECUTE sp_executesql @dept
both emp and dept has select statement,with same number of columns
Try something like this
CREATE TABLE #emp (...);
INSERT INTO #emp (...)
EXECUTE sp_executesql @emp;
CREATE TABLE #dept (...);
INSERT INTO #dept (...)
EXECUTE sp_executesql @dept;
SELECT * FROM #emp
EXCEPT
SELECT * FROM #dept
July 18, 2017 at 1:50 pm
coool_sweet - Monday, July 17, 2017 9:08 PMhi
i want to do something like this, is it possible?if not what other option
EXECUTE sp_executesql @emp
except
EXECUTE sp_executesql @dept
both emp and dept has select statement,with same number of columns
First, no. You have to put the data into tables first. Second, without seeing what the output from each of the procedures looks like, just because they have the same number of columns doesn't mean that the EXCEPT makes any sense.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply