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

How would you go about developing a ssrs report?

166


What is lock escalation? : sql server database administration

1143


Explain trigger and its types?

1051


How do I open a .db file?

1022


What are the different types of replication you can set up in sql server?

1021


What is data source view or dsv? : sql server analysis services, ssas

984


How many types of the database links?

1052


Do you have any idea about the tcl commands?

947


What is database replication? What are the different types of replication you can set up in sql server?

946


What is inner join? Explain with an example?

1196


How to make a column nullable?

1093


How to check if stored procedure is running in sql server?

1028


Which feature in sql server 2008 has surprised you? You can name just one. : sql server database administration

916


Where sql server usernames and passwords are stored in a sql server?

970


What are 3 ways to get a count of the number of records in a table?

1056