Thursday, 6 November 2014

Get The list of Tables Without Primary Keys

Get The list of Tables Without Primary Keys

SELECT Name FROM sysobjects 
WHERE ID NOT IN (SELECT b.Id FROM Sysconstraints b, sysobjects c WHERE c.type ='k' AND c.Id=b.constid) AND 
type ='U' ORDER BY name

No comments:

Post a Comment