ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   To Refer this Site to Your Friends   Click Here
Google
 
Categories  >>  Software  >>  Databases  >>  SQL Server
 
 


 

 
 Oracle interview questions  Oracle Interview Questions
 SQL Server interview questions  SQL Server Interview Questions
 MS Access interview questions  MS Access Interview Questions
 MySQL interview questions  MySQL Interview Questions
 Postgre interview questions  Postgre Interview Questions
 Sybase interview questions  Sybase Interview Questions
 DB Architecture interview questions  DB Architecture Interview Questions
 DB Administration interview questions  DB Administration Interview Questions
 DB Development interview questions  DB Development Interview Questions
 SQL PLSQL interview questions  SQL PLSQL Interview Questions
 Databases AllOther interview questions  Databases AllOther Interview Questions
Question
I am Having tables T1 and T2 both having same data how to 
check (or) compare the data in both table are same?
 Question Submitted By :: Grj
I also faced this Question!!     Rank Answer Posted By  
 
  Re: I am Having tables T1 and T2 both having same data how to check (or) compare the data in both table are same?
Answer
# 1
(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 ?    2 Yes 1 No
Asharaf Ali
 
  Re: I am Having tables T1 and T2 both having same data how to check (or) compare the data in both table are same?
Answer
# 2
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
Saravanan P
 
 
 

 
 
 
Other SQL Server Interview Questions
 
  Question Asked @ Answers
 
HOW TO RENAME A COLUMN NAME  2
how to delete duplicate rows from table in sql server HCL8
How do you persist objects, permissions in tempdb  1
difference between sql server2000 and sql server2005 KPMG1
what is physical sort data and logical sort data in index?  2
What are constraints? Explain different types of constraints?  6
Hello all, I have data like :- year amt 2004 10 2005 20 2006 30 Now i want output as:- 2004 2005 2006 10 30 60 but i have to use here group by on year.So, i need a single query within that i can find.  2
select empid empname from employee What is the result for the about query?  4
SQL stops working in every 15 days displaying message that database log file is full. Log file size is 3.95 GB. It is happening after shrinking the database also. What is solution to overcome this problem. Please help me as it's urgent.  5
How to create logins using windows Authentication mode?  2
What all db objects can be found in MSDB database of a SQL Server instance? Accenture1
When do we use the UPDATE_STATISTICS command?  3
What are the two types of concurrency?  2
how to give input dynamically to a insert statement in sqlserver HCL2
Alternative way to DetDate() function?  4
when we use function instead of procedure? plz tell me the situation with ex?  1
What is Covering Indexes? Plz explain with example  2
Is it possible to allow NULL values in foreign key? I s it possible to use different constraints for the same column in the table (i.e) (id int NOT NULL,UNIQUEUE)  1
What is WITH CHECK OPTION Karur-Vysya-Bank-KVB2
Can you link only other SQL Servers or any database servers such as Oracle?  1
 
For more SQL Server Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com