Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


I am Having tables T1 and T2 both having same data how to
check (or) compare the data in both table are same?

Answers were Sorted based on User's Feedback



I am Having tables T1 and T2 both having same data how to check (or) compare the data in both tabl..

Answer / asharaf ali

(SELECT * FROM @T1
EXCEPT
SELECT * FROM @T2)
UNION
(SELECT * FROM @T2
EXCEPT
SELECT * FROM @T1)

If the above query returned no records, the data in both table are same.

Is This Answer Correct ?    7 Yes 1 No

I am Having tables T1 and T2 both having same data how to check (or) compare the data in both tabl..

Answer / 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

I am Having tables T1 and T2 both having same data how to check (or) compare the data in both tabl..

Answer / thakur singh rawat

(select * from T1
minus
select * from T2)
union
(select * from T2
minus
select * from T1)

If no rows returns then it means that the two tables
contain the same values or say same.

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More SQL Server Interview Questions

What happens if null values are involved in bitwise operations?

0 Answers  


Explain system views?

0 Answers  


What do you mean by sql server 2005 express management tools?

0 Answers  


What are indexes? When do you need to create Indexes?

4 Answers   CarrizalSoft Technologies, HP,


What is the datatype returned by count(*)

22 Answers   247Customer, Asian CERC,


What is the difference between seek predicate and predicate?

0 Answers  


Explain concepts of analysis services?

0 Answers  


as a part of your job, what are the dbcc commands that you commonly use for database maintenance? : Sql server database administration

0 Answers  


What is the role that is required for killing a process What is the role that is required for creating a linked server

1 Answers   CarrizalSoft Technologies, IBM,


I am Having tables T1 and T2 both having same data how to check (or) compare the data in both table are same?

3 Answers  


How do I create a stored procedure in dbml?

0 Answers  


How to execute a sql statement using mssql_query()?

0 Answers  


Categories