This content originally appeared on DEV Community and was authored by Query Filter
-- First get the user IDs once (optional, for readability)
DECLARE @uid1 int, @uid2 int
SELECT @uid1 = uid FROM sysusers WHERE name = 'GLOBAL_COMET_US_1'
SELECT @uid2 = uid FROM sysusers WHERE name = 'GLOBAL_COMET_US_2'
SELECT 'ONLY_IN_US_1' AS location, t1.tabname
FROM sysobjects t1
LEFT JOIN sysobjects t2
ON t1.tabname = t2.tabname
AND t2.uid = @uid2
AND t2.type = 'U'
WHERE t1.uid = @uid1
AND t1.type = 'U'
AND t2.id IS NULL
UNION ALL
SELECT 'ONLY_IN_US_2' AS location, t2.tabname
FROM sysobjects t2
LEFT JOIN sysobjects t1
ON t2.tabname = t1.tabname
AND t1.uid = @uid1
AND t1.type = 'U'
WHERE t2.uid = @uid2
AND t2.type = 'U'
AND t1.id IS NULL
ORDER BY 1, 2
This content originally appeared on DEV Community and was authored by Query Filter
Print
Share
Comment
Cite
Upload
Translate
Updates
There are no updates yet.
Click the Upload button above to add an update.
APA
MLA
Query Filter | Sciencx (2025-12-02T21:46:49+00:00) compare4. Retrieved from https://www.scien.cx/2025/12/02/compare4/
" » compare4." Query Filter | Sciencx - Tuesday December 2, 2025, https://www.scien.cx/2025/12/02/compare4/
HARVARDQuery Filter | Sciencx Tuesday December 2, 2025 » compare4., viewed ,<https://www.scien.cx/2025/12/02/compare4/>
VANCOUVERQuery Filter | Sciencx - » compare4. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/12/02/compare4/
CHICAGO" » compare4." Query Filter | Sciencx - Accessed . https://www.scien.cx/2025/12/02/compare4/
IEEE" » compare4." Query Filter | Sciencx [Online]. Available: https://www.scien.cx/2025/12/02/compare4/. [Accessed: ]
rf:citation » compare4 | Query Filter | Sciencx | https://www.scien.cx/2025/12/02/compare4/ |
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.