Miscellaneous

Technical Article

Finding first/last day of month by a date

  • Script

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 […]

You rated this post out of 5. Change rating

2004-12-02 (first published: )

234 reads

SQLServerCentral Article

Versioning

  • Article

How many times has an application exploded because you upgraded or patched SQL Server? How many people were aware that a patch was applied? New author Andre Vigneau has dealt with this and gives us some code that our applications can use to check to see if anything has changed. It doesn't keep the code working, but it does allow you to inform users that something has changed.

You rated this post out of 5. Change rating

2004-10-21

5,768 reads

Technical Article

Calculate Weekdays Between 2 Dates (revised)

  • Script

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. […]

You rated this post out of 5. Change rating

2005-09-19 (first published: )

300 reads

Technical Article

Script to List Missing Identity Numbers

  • Script

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 […]

You rated this post out of 5. Change rating

2004-11-29 (first published: )

143 reads

Technical Article

Find and REMOVE string from stored procedures

  • Script

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 […]

You rated this post out of 5. Change rating

2004-11-26 (first published: )

283 reads

Technical Article

Dynamic Data Paging

  • Script

I've search high and low on the Internet for good examples of Paging Data in an application. However, none of the Examples were clean enough, or worked for all situations. For example, there are no examples of Data Paging for Tables with Composite Keys.This Script is able to page Data on any Table, using any […]

You rated this post out of 5. Change rating

2004-10-07

330 reads

Blogs

Troubleshooting SQL Server – Starting with the Error Log

By

We’ve all been there. Someone walks up and asks, “Is SQL Server having issues?”...

From OLTP to Analytics: Bridging the Gap with Modern SQL Architectures

By

In the beginning, there was OLTP – Online Transaction Processing. Fast, reliable, and ruthlessly...

Solving SQL Server Mysteries with a Whole Gang of Sleuths -Scooby Dooing Episode 4

By

One thing I’ve always loved about the Scooby-Doo cartoon is that he never solved...

Read the latest Blogs

Forums

SQL Server 2025 Jobs

By Do

Hello SQL Server 2022 16.0.4212.1 running on a Windows Server 2025 Std,V 24H2, SO...

how to optimise whole database full of table and sp in one go using githubcopilo

By rajemessage 14195

i have subscription of github copilot which i can access in vs 2022 comunity...

Password Guidance

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Password Guidance

Visit the forum

Question of the Day

Using table variables in T-SQL

What happens if you run the following code in SQL Server 2022+?

declare @t1 table (id int);

insert into @t1 (id) values (NULL), (1), (2), (3);

select count(*)
from @t1
where @t1.id is distinct from NULL;
 

See possible answers