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
You have to store user responses of ‘yes’ and ‘no’ what kind of data type is best suited for this task?
What is key attribute?
write an SQL query to list the employees who joined in the month of January?
Explain various On-Delete options in a DB table. Which is the default option?
How to check parameter value in stored procedure sql server?
What are triggers? How many triggers you can have on a table? How to invoke a trigger on demand?
how to control the amount of free space in your index pages? : Sql server database administration
Where is trigger in sql server?
Do you know what is openxml in sql server?
What is the default value of an integer data type in sql server 2005?
What is difference between count (*) and count 1?
What are partitioned views?
how to invoke a trigger on demand? : Sql server database administration
what is normalization? Explain different levels of normalization? : Sql server database administration
What is field in algebra?