Scripts

Technical Article

Function to calculate Month End Date

This function will return you the month-end date. Input parameter may be any date of that month for which you want to calculate month-end.Example:Input: '2-20-2004'      Output: '2-29-2004'Input: '2-15-2004'      Output: '2-29-2004'Input: '3-20-2004'      Output: '3-31-2004'Input: '3-30-2004'      Output: '3-31-2004'

3.2 (5)

You rated this post out of 5. Change rating

2007-05-08 (first published: )

1,316 reads

Technical Article

Quickly Reveal DB Recovery Model on all Databases.

I wrote this little tool out of the frustratingly slow process one must endure to find out what database Recovery Model your SQL 2000 databases are currently set to. This tool will quickly reveal whether your database Recovery model is set to either "Simple", "Full", or "Bulk-Logged." Who has time to manually pull up "Properties" […]

4 (1)

You rated this post out of 5. Change rating

2007-05-03 (first published: )

787 reads

Technical Article

An old and new way to query Hierarchical data

This script uses an old mathematical way of doing hierarchical queries. The most common way of showing hierarchical data in SQL Server is by creating a stored procedure that calls itself. This is not a recent problem, in fact this programming technique has been around since the first programming languages. By using stacks, you can […]

1 (1)

You rated this post out of 5. Change rating

2007-05-02 (first published: )

573 reads

Technical Article

Find the database by table name

Here's the scenario: 1.  You have been given a script to run.2.  You do not know the database name.3.  You know which server.Substitute the word "TABLENAME" with the table name in the script and run in query analyzer.  This query will check every database on the server and return the name of the database with […]

2 (1)

You rated this post out of 5. Change rating

2007-04-26 (first published: )

471 reads

Technical Article

Script to generate replication procs for article

This script is basically a front-end for the sp_"scriptproc" stored procedures that ship with MSSQL.  This will allow you to create ALL of your procs (INS, UPD and DEL) on the fly using the article name instead of having to first search for the article ID.  It also uses sp_scriptdynamicupdproc where appropriate.  This facilitates quick […]

5 (1)

You rated this post out of 5. Change rating

2007-04-23 (first published: )

1,730 reads

Technical Article

Refreshing Views and Recompiling Stored Procs

When a table is modified by changing the order of fields or changing field type or adjusting field sizes etc, some of the dependent views (or views on views on views :)) may become invalid as they store some metadata in order to run more efficiently. These views would need to be refreshed with new […]

4.86 (7)

You rated this post out of 5. Change rating

2007-04-20 (first published: )

2,012 reads

Blogs

SQL Server Distributed Availability Groups and Kubernetes

By

A while back I wrote about how to use a Cross Platform (or Clusterless)...

Webcast Tomorrow on SQL Server Disaster Recovery

By

Tomorrow, November 19, 2024, at 1 PM EST, I'm giving a webcast on SQL...

SQL Server Quickie #48 – Azure SQL Managed Instance

By

Today I have uploaded SQL Server Quickie #48 to YouTube. This time I’m talking...

Read the latest Blogs

Forums

Converting job_id to join to another table.

By Brandie Tarvin

I need help, please! I have a monitoring table that pulls in information about...

SSMS 20.2 on Windows11 not able to connect to SQL 2005 ??

By Johan Bijnens

We still have a couple of dino's. What should I check to re-enable access...

Agent job security account

By onkarnath.tiwary

Hi All, I have few sql server agent scheduled jobs which are supposed to...

Visit the forum

Question of the Day

What's the Ceiling?

What do I get as the results from this code?

SELECT CEILING (999.999), CEILING (-999.999);

See possible answers