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 would you go about developing a ssrs report?
What is lock escalation? : sql server database administration
Explain trigger and its types?
How do I open a .db file?
What are the different types of replication you can set up in sql server?
What is data source view or dsv? : sql server analysis services, ssas
How many types of the database links?
Do you have any idea about the tcl commands?
What is database replication? What are the different types of replication you can set up in sql server?
What is inner join? Explain with an example?
How to make a column nullable?
How to check if stored procedure is running in sql server?
Which feature in sql server 2008 has surprised you? You can name just one. : sql server database administration
Where sql server usernames and passwords are stored in a sql server?
What are 3 ways to get a count of the number of records in a table?