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
What are synonyms?
What are data files?
How do I find the sql server database version?
What are the steps to process a single select statement?
What is difference between joins and subqueries?
What is index, cluster index and nonclustered index?
Define cross join in sql server joins?
you want to be sure that queries in a database always execute at the maximum possible speed. To achieve this goal you have created various indexes on tables which other statement will keep the database in good condition? : Sql server administration
What is Command line parameters in PLSQL.?
What is the difference between a local and a global temporary table?
What are sub reports and how to create them?
What is the federation in sql azure?
What are date and time data types in ms sql server?
What is #table in sql server?
What options are there to delete rows on the publisher and not on the subscriber? : sql server replication