User-defined Data Type Basics
This article discusses an often-overlooked feature of SQL Server called user-defined data types.
2002-12-17
8,238 reads
This article discusses an often-overlooked feature of SQL Server called user-defined data types.
2002-12-17
8,238 reads
Here are a couple of handy date functions that pretty much describe themselves. You can use these to figure out how many days are left in a month.
2002-12-08
647 reads
This user-defined function converts a number to character format and adds leading zeroes to pad the field to a specified length. useful for displaying SSNs or other numeric fields where the leading 0's are significant but the field is stored as numeric.To use:select dbo.zPad(, )make sure your length includes an extra column for the sign. […]
2002-12-05
445 reads
This is a handy function that converts a number (integer) into its word format. This might be handy if you need to print a check formatted number in words. Currently it supports an integer but it would be almost nothing to convert to support a bigint or decimal.The components are1) a table named PlaceValue that […]
2002-12-04
402 reads
Convert a decimal number to IBM EBCDIC packed decimal format. If for some reason you need to export a number to IBM systems in native format, you can define a SQL Server field as binary(8) and Pack() your decimal number into it. Then IBM mainframes and COBOL/CICS systems can read the numbers from your data […]
2002-12-04
568 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...
WhatsApp CS 628218520153 ITC ROXY MAS, Jl. Kh Hasyim Ashari No.125 Basement 13, RW.8,...
WhatsApp CS 628218520153 Jl. Sukarjo Wiryopranoto No.28 C, RT.1/RW.1, Kb. Klp., Kecamatan Gambir, Kota...
WhatsApp CS 628218520153 Jl. KH Fachrudin 36 Blok D/23, Kp. Bali, Kecamatan Tanah Abang,...
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