Additional Articles


External Article

Clustering for Indexes

There is nothing spectacular about using indexes per say. However, on many occasions I have come across a variety of SQL coders that never consider validating that the index they think they are using is efficient or even being used at all. We can all put indexes on the columns that we think will be required to satisfy individual queries, but how do we know if they will ever be used. You see, if the underlying table data is constructed, contains, or is ordered in a particular way, our indexes may never be used. One of the factors around the use of an index is its clustering factor and this is what this article is about.

2004-12-23

3,412 reads

External Article

Cursors with SQL 2000 Part 1

This series of articles will examine the purposes, uses, and optimization of cursors in SQL 2000. SQL languages are designed so groups of records, or sets, can be manipulated easily and quickly. The speed at which groups of data can be altered, updated and deleted, demonstrates why working with sets is the preferred method. However, there are places where cursors are a better choice.

2004-12-20

2,572 reads

Technical Article

Optimizing Your SQL Code with SQL Server 2005

A common complaint of database administrators (DBAs) is that performance bottlenecks are not among those problems that one can fix "by just throwing hardware at it." Thus, database servers must provide tools and techniques to help administrators address this issue. On that aspect, SQL Server 2005 does not disappoint.

2004-12-16

2,373 reads

Technical Article

Auto Fix Orphaned Users

Add this procedure to the master database, it can then be executed from any DB to fix orphaned users (very useful when moving back to development). Using sp_msforeachdb with the proc allows you to resolve orphaned users in all databases in a single command: SP_MSFOREACHDB "USE ?; EXEC SP_AUTOFIX_USERS;"

You rated this post out of 5. Change rating

2004-12-15 (first published: )

2,829 reads

Technical Article

Easy Package Configuration

One of the age old problems in DTS is moving packages between your development, test and production environments. Typically a series of manual edits needs to be done to all the packages to make sure that all the connection objects are pointing to the correct physical servers. This is time consuming and gives rise to the possibility of human error, particularly if the solution incorporates many DTS packages. Many companies have provided their own custom solutions for managing this problem but these are still workarounds for a problem that is inherently DTS's.

2004-12-14

1,761 reads

Blogs

T-SQL Tuesday #180: Avoid Perfect for Good Enough

By

I'm listening to Effortless by Greg McKeon (link to author's page) through Audible.com. He...

Book Review – Humanizing Data Strategy by Tiankai Feng

By

This book was making its rounds on social media, and the concept seems interesting...

Monday Monitor Tips: Tracking The Cost of Instances

By

One of the things that I’ve been asked in every operations situation is what...

Read the latest Blogs

Forums

Does SSRS Report with Stored Procedure execute SQL string?

By danyeungw

I declare @Where based on the input parameter in the stored procedure. Set @SQL...

SQL Server Constrained Delegation

By cw255

Hi, hoping someone can help. We're in the process of migrating to a new...

Get Sum and Last month sum

By GrassHopper

I want to get the sum and I want to get the sum of...

Visit the forum

Question of the Day

Comparing Images

I am building an ETL process between these tables in SQL Server 2022 set to 160 compatibility level:

CREATE TABLE Image_Staging
( imageid     INT NOT NULL CONSTRAINT Image_StagingPK PRIMARY KEY
, imagestatus TINYINT
, imagebinary IMAGE);
GO

CREATE TABLE Images
( imageid       INT NOT NULL CONSTRAINT ImagesPK PRIMARY KEY
, imagestatus   TINYINT
, imagemodified DATETIME
, imagebinary   IMAGE);
GO
I want to run this query to check if the images already loaded exist. This will help me decide if I need to insert or update an image. What happens with this query?
SELECT i.imageid
FROM
  dbo.Image_Staging AS ist
  INNER JOIN dbo.Images AS i
    ON ist.imagebinary = i.imagebinary;

See possible answers