Round Natural Numbers to the nearest Power of 10
An ITVF function that rounds a number to the nearest Power of 10
2017-05-15 (first published: 2017-05-05)
402 reads
An ITVF function that rounds a number to the nearest Power of 10
2017-05-15 (first published: 2017-05-05)
402 reads
2017-05-10 (first published: 2017-05-02)
400 reads
2017-05-09 (first published: 2017-05-03)
2,907 reads
Most comman scenario which we face on everyday basis is to fix the orphan database users at the database level. You need to go to each database and fix the orphan users at the each databases.
2017-05-03 (first published: 2017-04-20)
695 reads
This is quick script to ascertain datafile headroom based on current size of the data in a file against the max size (which needs to be set for this to work!)
2017-05-02 (first published: 2017-04-19)
402 reads
2017-05-01 (first published: 2017-04-19)
1,254 reads
End user has entered ‘goodmorning’ and ‘good morning’ interchangeably and it was causing logic failure at application level. So task was to replace ‘goodmorning’ with ‘good morning’ in database wherever it is there.
2017-04-28 (first published: 2017-04-10)
1,121 reads
This table valued function will quickly find the prime factors of any number up to 10 trillion
2017-04-26 (first published: 2017-04-06)
429 reads
Keeps a memory leak under control until the bug fix is developed and applied. Short term band aid.
2017-04-25 (first published: 2017-04-13)
573 reads
This script is for converting Char to nChar and varchar to nVarchar with the same length.
This process has reduced the manual work by 80% (approximately) in our case.
2017-04-24 (first published: 2017-04-10)
599 reads
By Steve Jones
I caught this interesting item over on Pinal Dave’s blog: Eleven Interview Questions that...
By Hemantgiri
I use color-coded connections in SSMS to distinguish Production, Pre-Production, UAT, and Development. But...
Comments posted to this topic are about the item Split Large Queries in Athena...
Comments posted to this topic are about the item Finding Trailing Spaces
I have some data in a SQL Server 2025 database. It looks like this for the dbo.Customer table:
CustomerID CustomerName PreferredName 1 Steve Steve 2 Andy Andy 3 Brian Brian 4 Allan Allan 5 Devin Devin 6 Steve Steve 7 Sally SallyI want to detect which names have a single trailing space. The CustomerName is a varchar() and the PreferredName is a CHAR(). Does this query detect the problem rows?
SELECT
CustomerID,
CustomerName,
PreferredName
FROM Customer
WHERE CustomerName <> RTRIM(CustomerName)
OR PreferredName <> RTRIM(PreferredName); See possible answers