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
Can you explain full-text query in sql server?
What are the different types of data sources in ssrs?
What are the advantages of partitioning?
Explain datetime2 data type in sal server 2008?
explain declarative management framework (dmf) in sql server 2008?
If you want to send some data from access database to sql server database. What are different component of ssis will you use?
How to modify an existing user defined function?
How to round a numeric value to a specific precision?
What are constraints?
Write a code to select distinct records without using the DISTINCT keyword.
What is the difference between web edition and business edition?
What are the types of subquery?
What do you know about system database? : SQL Server Architecture
How do I trace a query in sql server?
Sql server reporting services vs. Crystal reports.