FirstDayOfMonth() and LastDayOfMonth() functions
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
619 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
619 reads
Purpose: To compare two strings with a supplied operator and return true if the strings evaluate to true using the operator provided. This is useful for stored procs to use instead of dynamic sql. YAY! Allowing for the operator and value to be passed in as parms. So that the user on the front end […]
2002-12-07
859 reads
This UDF and its equivalent stored procedure will return the size of a stored procedure, view, rule or user defined function in bytes .
2002-12-07
102 reads
This SP will decrypt Stored Procedures, Views or Triggers that were encrypted using "with encryption" There are 2 versions: one for SP's only and the other one for SP's, triggers and views version 1: INPUT: object name (stored procedure, view or trigger) version 2: INPUT: object name (stored procedure, view or trigger), object type('T'-trigger, 'P'-stored […]
2002-12-06
1,963 reads
There is a requirement here to take a number (such as 124995) and express it in words. We needed a function to do this, as it would be used in an existing document generation system.I have developed the enclosed two functions to do this. Note that the function does not, currently, cater for negative numbers, […]
2002-12-06
142 reads
Sometimes people want a Stored Proc with optional parameters. A lot of times people will use a coalesce for this. The problem with optional paremeters is that the query plan will never be an exact mach for that specific query. ( You never know what paremeters are filled..... )To solve this problem look at the […]
2002-12-06
453 reads
This is a collection of 123 TSQL functions for professional, academic or learning purposes. There are many conversions hexadecimal/octal/binary/Roman numerals, mathematical functions such as hyperbolic, logic and trigonometric. Combinatorial functions such as combinations, permutations (factorial), arrangements. Other interesting functions include turning a number into plain English, Morse code, EBCDIC and vice-versa, Levenshtein Distance (linguistics), encryption, […]
2002-12-05
1,027 reads
T-SQL which scripts out all linked and remote servers. Works on SQL 7.0 and 2000. Remote login password is only decrypted on SQL 7.0.
2002-12-05
10,677 reads
2002-12-05
214 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
416 reads
By Steve Jones
One of the language changes in SQL Server 2025 that I’ve seen a lot...
By Steve Jones
I hosted this month, but I decided to put my own entry in as...
By Chris Yates
I get asked a lot about why or how I began working with databases...
Recently stood up a 2022 Enterprise server. Have 8 publications with subscriptions on a...
Hey, I've not done a cube for many years but I find myself supporting...
Comments posted to this topic are about the item Implementing PostgreSQL with Python for...
I get a new SQL Server instance from my build team. How can I tell if the instance was installed using a slipstream installation later?
See possible answers