Technical Article

Modified SP_who

Here is a modified SP_WHO procedurewhich returns more information about the current session.I forgot all the thing that i have added to the sproc, but the last addition shows the last executed TSQL statement.There might be a better solution to get the values from DBCC rowset, thou I did not have time to think everything […]

You rated this post out of 5. Change rating

2002-05-28

704 reads

Technical Article

Procedure for Random Numbers

Here is handy procedure to generate random number.I find it useful when I generate large amount of test data in a database.For example if you need to create a Customer Data and what they have purchased in the last month to run perfrmance tests on large amount of data an set up necessary indexes.You can […]

You rated this post out of 5. Change rating

2002-05-13

648 reads

Technical Article

Cursorless Cursor

Here is as sample of implementing cursor.In some cases my tests showed that this approach performs better than native cursors in SQL Server.All you have to do is move the dataset into a temp table with a new Identity column and then use a simple loop to extract the data as you would do normally […]

4.5 (2)

You rated this post out of 5. Change rating

2002-05-06

1,962 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