August 15, 2001 at 12:00 am
Comments posted to this topic are about the content posted at http://www.sqlservercentral.com/columnists/bkelley/designoversight-preliminaryreview.asp
K. Brian Kelley
@kbriankelley
August 20, 2001 at 7:26 am
Brian
Great article Brian, only things worth adding:
a) FK columns that are not indexed
b) Cluster indexes on identity columns
c) No collected or stale statstics
Cheers
Chris
Chris Kempster
www.chriskempster.com
Author of "SQL Server Backup, Recovery & Troubleshooting"
Author of "SQL Server 2k for the Oracle DBA"
August 22, 2001 at 1:44 am
Brian
Here is another script to list all columns that have a "char" datatype where they possibly should be "varchar".
select sysobjects.name, sysusers.name, syscolumns.name
from syscolumns, sysobjects, sysusers
where syscolumns.type = 47
and syscolumns.id = sysobjects.id
and sysobjects.uid = sysusers.uid
and sysobjects.xtype = 'U'
order by 2,1
Chris Kempster
www.chriskempster.com
Author of "SQL Server Backup, Recovery & Troubleshooting"
Author of "SQL Server 2k for the Oracle DBA"
August 22, 2001 at 9:25 am
Sounds good, Chris, I like the suggestions and the script. Looks like I need to write a part II. 🙂
K. Brian Kelley
K. Brian Kelley
@kbriankelley
August 27, 2001 at 8:15 pm
Brian
Here is another classic problem... in a recent system consolidation I ended up with 6 or so tables that shared the same name but in different case. Perhaps a more advanced script would be to compare columns (maybe later!).
-- List possible duplicate tables based on table-name
select a.name
from sysobjects a, sysobjects b
where upper(a.name) = upper(b.name)
and a.id <> b.id
and a.xtype = 'U'
and b.xtype = 'U'
Chris Kempster
www.chriskempster.com
Author of "SQL Server Backup, Recovery & Troubleshooting"
Author of "SQL Server 2k for the Oracle DBA"
November 7, 2001 at 12:55 pm
I tried the query and got all tables.....with or without indexes and primary keys?????
November 7, 2001 at 1:25 pm
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply