T-SQL QUESTION

  • Thread starter Thread starter keithb
  • Start date Start date
K

keithb

What is the general form for a stored procedure that does two select
statements and returns a true indication if all of the records from one
select statement are included the records returned by the other select
statment?

Thanks,

Keith
 
if you are using 2005, then

if exists(select * from table1
except
select * from table2)
return 0
if exists(select * from table2
except
select * from table1)
return 0

return 1


-- bruce (sqlwork.com)
 
You should always be able to combine this type of logic in a single
statement

Jeff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top