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?

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


Please Help Members By Posting Answers For Below Questions

Can you explain full-text query in sql server?

981


What are the different types of data sources in ssrs?

192


What are the advantages of partitioning?

1058


Explain datetime2 data type in sal server 2008?

870


explain declarative management framework (dmf) in sql server 2008?

956


If you want to send some data from access database to sql server database. What are different component of ssis will you use?

934


How to modify an existing user defined function?

1053


How to round a numeric value to a specific precision?

1033


What are constraints?

968


Write a code to select distinct records without using the DISTINCT keyword.

1068


What is the difference between web edition and business edition?

111


What are the types of subquery?

997


What do you know about system database? : SQL Server Architecture

948


How do I trace a query in sql server?

916


Sql server reporting services vs. Crystal reports.

124