This script finds the first day of previous, current and next month as well as last day of previous, current and next month.The calculation is based on the ISO date format which makes it independant of the date format used on the SQL Server.The calculation is performed from a date - it can be altered […]
2004-12-02 (first published: 2004-10-21)
234 reads
This is a function that takes a start date and end date as parameters and returns the number of weekdays (Monday to Friday) in between. This function assumes that Sunday is set as the first day of the week. Adapted from a vb function that I wrote to calculate standard salary costs for billing purposes. […]
2005-09-19 (first published: 2004-10-16)
300 reads
I have a table named employees with an identity column named id. Also,last_name is a column in the table named employees. I created the employeestable and inserted 9 rows in it. If I do a select * from employees, theoutput looks like this:id last_name1 a2 b3 c4 d5 e6 f7 g8 h9 iThen I deleted […]
2004-11-29 (first published: 2004-10-13)
143 reads
The following functions returns the number of years, months and days between two dates. The first returns a table format, and the second returns 1 value at a time
2004-12-01 (first published: 2004-10-13)
186 reads
This script extends the "Find strings in text of stored procedures" Script by LiviuB and and now finds thestring and removes it. You may modify script to just comment out the text.This script removes the text (in this case 'set dateformat dmy') from all non-system stored procedures in a database.Modify the variable @searchstring to contain […]
2004-11-26 (first published: 2004-10-13)
283 reads