Click here to Skip to main content
15,899,314 members
Home / Discussions / Database
   

Database

 
AnswerRe: How to indent SQL statements? Pin
Colin Angus Mackay19-Feb-06 0:26
Colin Angus Mackay19-Feb-06 0:26 
GeneralRe: How to indent SQL statements? Pin
CWIZO19-Feb-06 1:40
CWIZO19-Feb-06 1:40 
GeneralRe: How to indent SQL statements? Pin
Paul Conrad19-Feb-06 7:45
professionalPaul Conrad19-Feb-06 7:45 
GeneralRe: How to indent SQL statements? Pin
sacoskun20-Feb-06 9:10
sacoskun20-Feb-06 9:10 
Questionmove table record Pin
sebastian yeok18-Feb-06 21:02
sebastian yeok18-Feb-06 21:02 
AnswerRe: move table record Pin
Colin Angus Mackay19-Feb-06 2:47
Colin Angus Mackay19-Feb-06 2:47 
QuestionDifference between two tables Pin
niceguyeddie199917-Feb-06 5:11
niceguyeddie199917-Feb-06 5:11 
AnswerRe: Difference between two tables Pin
Colin Angus Mackay17-Feb-06 5:35
Colin Angus Mackay17-Feb-06 5:35 
You could try something like this:
SELECT a.pk, b.pk
FROM FirstDatabase.dbo.TableName AS a
FULL OUTER JOIN SecondDatabase.dbo.TableName AS b WHERE a.pk = b.pk
WHERE a.pk IS NULL
OR b.pk IS NULL


pk = primary key, if you have a compound key then you will need all the columns that make up the primary key.

The results of the query should (I haven't tested it) return any rows that exist in one database, but don't in the other.

If you want to return all rows that have differences then you might want to add to the WHERE clause:
OR a.column1 <> b.column1
OR a.column2 <> b.column2
...and so on for each of the columns.



ColinMackay.net
Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?

GeneralRe: Difference between two tables Pin
niceguyeddie199917-Feb-06 5:38
niceguyeddie199917-Feb-06 5:38 
GeneralRe: Difference between two tables Pin
Colin Angus Mackay17-Feb-06 8:46
Colin Angus Mackay17-Feb-06 8:46 
QuestionUrgent: SQL Server log: Login succeeded for user 'APPL_ACCOUNT'. Connection: Non-Trusted. Pin
devvvy16-Feb-06 17:45
devvvy16-Feb-06 17:45 
AnswerRe: Urgent: SQL Server log: Login succeeded for user 'APPL_ACCOUNT'. Connection: Non-Trusted. Pin
Edbert P19-Feb-06 13:16
Edbert P19-Feb-06 13:16 
GeneralRe: Urgent: SQL Server log: Login succeeded for user 'APPL_ACCOUNT'. Connection: Non-Trusted. Pin
devvvy19-Feb-06 14:45
devvvy19-Feb-06 14:45 
GeneralRe: Urgent: SQL Server log: Login succeeded for user 'APPL_ACCOUNT'. Connection: Non-Trusted. Pin
Edbert P19-Feb-06 17:03
Edbert P19-Feb-06 17:03 
GeneralRe: Urgent: SQL Server log: Login succeeded for user 'APPL_ACCOUNT'. Connection: Non-Trusted. Pin
devvvy19-Feb-06 17:10
devvvy19-Feb-06 17:10 
AnswerAn answer... Pin
devvvy19-Feb-06 17:45
devvvy19-Feb-06 17:45 
QuestionPer-user connection string to get good perf, good idea? Pin
Judah Gabriel Himango16-Feb-06 10:04
sponsorJudah Gabriel Himango16-Feb-06 10:04 
AnswerRe: Per-user connection string to get good perf, good idea? Pin
Colin Angus Mackay16-Feb-06 12:52
Colin Angus Mackay16-Feb-06 12:52 
GeneralRe: Per-user connection string to get good perf, good idea? Pin
Judah Gabriel Himango16-Feb-06 15:45
sponsorJudah Gabriel Himango16-Feb-06 15:45 
GeneralPartitioning Pin
Edbert P16-Feb-06 16:20
Edbert P16-Feb-06 16:20 
GeneralRe: Partitioning Pin
Judah Gabriel Himango16-Feb-06 16:44
sponsorJudah Gabriel Himango16-Feb-06 16:44 
QuestionT- SQL Inner Select Pin
Greeky16-Feb-06 1:21
Greeky16-Feb-06 1:21 
AnswerRe: T- SQL Inner Select Pin
Colin Angus Mackay16-Feb-06 2:16
Colin Angus Mackay16-Feb-06 2:16 
QuestionUML modeling Pin
Klempie15-Feb-06 23:57
Klempie15-Feb-06 23:57 
AnswerRe: UML modeling Pin
Juan Pedro Prez16-Feb-06 2:05
Juan Pedro Prez16-Feb-06 2:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.