Lock and Connection Management

Technical Article

RE: Is NULL comparison slow?

  • Reply

hmmm, What is the difference? Speed? Your solution gives about a 30ms decrease in time taken. AND (I.ErrorID >= @ErrNumStart OR @ErrNumStart = 0) -- Slow option AND (CASE WHEN I.ErrorID >= @ErrNumStart OR @ErrNumStart Is Null THEN 1 ELSE 0 END) = 1 -- fast option. Why would there be a difference? Your option […]

2003-05-19

Technical Article

RE: trimming trailing spaces and zeros from a string

  • Reply

Alternatively, try a user defined function: create function dbo.fn_RemoveTrailingZeros ( @string varchar(25) ) returns varchar(25) as begin declare @loop char(1) set @loop = 'Y' while @loop = 'Y' begin if right(@string,1) not in ('0','.') begin set @loop = 'N' end else set @string = left(@string,len(@string)-1) end return (@string) end go select dbo.fn_RemoveTrailingZeros('123456.7890') select dbo.fn_RemoveTrailingZeros('123.000') Jeremy

You rated this post out of 5. Change rating

2003-05-19

Technical Article

Script to kill the top blocker and report what it was doing.

  • Script

This script identifies the blocking locks at the top of the blocking chain and kills them. Specifically, it reports what the top blocking spids are doing, kills them, waits three seconds and then reports on current blocking status.  If you have a situation where single connections are causing a huge blocking chain and you want […]

4.75 (4)

You rated this post out of 5. Change rating

2003-05-12

2,949 reads

Technical Article

RE: MQSeries Interface

  • Reply

if everything else isn't an option for you (writing extended stored procedures), you can reside to use the MQSeries-Client automation interface (MQAX200.DLL) and the MSSQL functions to access automation objects (sp_oacreate, sp_oagetproperty, sp_oasetproperty, sp_oamethod). For info on programming the interface, check the red book available at ibm for free (pdf). can also send it to […]

You rated this post out of 5. Change rating

2003-05-12

1 reads

Technical Article

Restrict simultaneous access to resources

  • Script

This set of procedures allow you to control simultaneous access to any resource you are using. It mimics the behaviour of a Semaphore in programming.A typical problem where you need this, is when you have a computational intensive procedure you only want to be started a limited number of times.First, add a record to the […]

You rated this post out of 5. Change rating

2003-05-07

267 reads

Blogs

SQL Saturday Boston 2024 Slides

By

Thanks to everyone that came to my talks. Slides are below. Best Practices for...

Small Data SF 2024

By

I can’t remember how I heard about Small Data SF 2024, but it caught...

A New Word: Moledro

By

moledro – n. a feeling of resonant connection with an author or artist you’ll...

Read the latest Blogs

Forums

7 sept, scheduled book

By philip.scott

Comments posted to this topic are about the item 7 sept, scheduled book

7 sept, schedlued article

By philip.scott

Comments posted to this topic are about the item 7 sept, schedlued article

6 sept, published book

By philip.scott

Comments posted to this topic are about the item 6 sept, published book

Visit the forum

Question of the Day

Azure Data Lake Storage Gen 2

Azure Data Lake Storage Gen 2 is built on ...?

See possible answers