Posts

Showing posts from September, 2005

Understanding DBCC SHOWCONTIG

Image
DBCC SHOWCONTIG is a wonderful tool which helps you to understand quite a bit more about your system than is obvious at first glance. And, frankly, the documentation doesn't use terminology that makes it very obvious either. So, this article will focus on a few of the big ideas behind the tool using SQL Server, and how you can use it to better understand what is going on inside your SQL Server box. Probably one of the most significant performance problems found in databases is centered around table data fragmentation. One situation that may be analogous to table fragmentation might be an index at the end of a large book. A single index entry in such a book might point to several pages scattered throughout the book. You must then scan each page for the specific information you require. This differs significantly from the index of the phone book which stores its data in sorted order. A typical query for the name "Jones" might span multiple consecutive pages, but are always

Deleting Duplicate Records

Image
Following steps used to delete duplicate records 1. Identify duplicates select au_lname, au_fname, city, state, count(*) from dup_authors group by au_lname, au_fname, city, state having count(*) > 1 order by count(*) desc, au_lname, au_fname 2. Temp Table and Truncate select distinct * into #holding from dup_authors 3. Rename and Copy Back sp_rename 'dup_authors', 'temp_dup_authors' 4. Create a Primary Key (prevention) -- Add a new column -- In real life I'd put an index on it Alter table dup_authors add NewPK int NULL Article from SQLTeam, more

SQL Server CE

Image
SQL Server CE is available as a download for use with SQL Server 2000 from the Microsoft Web site and as part of Microsoft''s eMbedded Visual Tools 3.0. If you don''t have SQL Server 2000 and just want to take SQL Server CE out for a spin, use the eMbedded Visual Tools version. Both come with the Windows CE version of Query Analyzer, which provides a way to create and administer databases on the Windows CE device. Those unfamiliar with Query Analyzer will find its GUI relatively intuitive. Article by Edmond Woychowsky, more