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

What are synonyms?

962


What are data files?

1042


How do I find the sql server database version?

1008


What are the steps to process a single select statement?

942


What is difference between joins and subqueries?

1120


What is index, cluster index and nonclustered index?

995


Define cross join in sql server joins?

1022


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

1082


What is Command line parameters in PLSQL.?

1131


What is the difference between a local and a global temporary table?

1121


What are sub reports and how to create them?

139


What is the federation in sql azure?

97


What are date and time data types in ms sql server?

1094


What is #table in sql server?

1043


What options are there to delete rows on the publisher and not on the subscriber? : sql server replication

1216