I am Having tables T1 and T2 both having same data how to
check (or) compare the data in both table are same?
Answer Posted / saravanan p
Declare @chkSameTable int
Select @chkSameTable=count(*) from
((SELECT * FROM ##SameTable
EXCEPT
SELECT * FROM ##SameTable1)
UNION
(SELECT * FROM ##SameTable1
EXCEPT
SELECT * FROM ##SameTable)) DrvTable
If @chkSameTable=0
Print N'The Two Tables are having Same data'
Else
Print N'The Two Tables are having Diferent data'
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
How to create a ddl trigger using "create trigger" statements?
When we should use and scope of @@identity?
What is data mart? : sql server analysis services, ssas
How the authentication mode can be changed?
Why use “in” clause in sql server?
You have a table ‘test’ which is a copy of northwind employee table you have written a trigger to update the field ‘hiredate’ with the current date
tell me what are the steps you will take to improve performance of a poor performing query? : Sql server database administration
What are the 3 types of schema?
Explain subquery and state its properties?
in a table is b in column k (manikanta,sivananda,muralidhar) i want result like (mnikanta,sivnanda,murlidhar) please slove it
How to recompile stored procedure at run time?
What is difference between temp table and cte?
What is the security principal at the database level that represents your session?
Name few endpoints exposed by ssrs 2012?
What are out-of-range errors with date and time literals?