Snargables (11/20/2013)
How can u have the same tablename in sysobjects w/ different id's. It's making one of my processes fail. The difference in the records is the uid. I didnt think this could happen. doesn't happen in sys.objects though--this returns two tables and the count = 2 for each
select name,count(*)
from dbo.sysobjects
where xtype='u'
group by name
having count(*)>1
schemaname + tablename are unique, so you can have multiple tables with the same name, but under different schemas.
when you are running multiple schemas, your scripts must be a bit smarter and take that into consideration
select MIN(schema_name(object_id)),
MAX(schema_name(object_id)),
name
from sys.tables
group by name
having count(*)>1
Lowell