Scripts

Technical Article

Find maximum values for all "int" columns

/******************************************************** "CheckAllInts" Find all columns in all user tables in a database defined as "int", and get the maximum value for the column. Uses a cursor and logs the results to a table. (One-time CREATE TABLE statement at top of script). Successive runs over an appropriate period of time would allow one to find how […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2005-04-11 (first published: )

363 reads

Technical Article

getCalendarQTR

The script returns the quarter and year of a date submitted in the form of '105' - first quarter of 2005 - and is useful for grouping data by calendar quarter. Easy to modify for fiscal quarters.

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2005-04-07 (first published: )

110 reads

Technical Article

SQLCalcEngine - evaluate numeric expression

SQLCalcEngine - evaluate numeric expression similar to the VB eval function.The basic concept is to pass a string containing a numeric expression such as ((2+3)*(4/9)) and receive a numeric value back. The algorithm is based loosely on material found at http://www.arstdesign.com/articles/expression_evaluation.html, as well as material found in the book "Writing Compilers and Interpreters" by Ronald […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2005-03-31 (first published: )

346 reads

Technical Article

Get all user information at the database level

This is based on Clint Herring's work and was better than what I was using ;). It has one user definded variable @path that is where to store the files generated. It will make one file per database and one master file to restore all user permissions into that database. Used mostly for DR and […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2005-03-30 (first published: )

1,044 reads

Technical Article

Import network computer EventLogs to SQL table

Creates the required table and stored procedure to facilitate the import ofEvent Log WARNING and FAILURE entries from a target computer into a SQL using Microsoft's LogParserfor monitoring and analysis.In order to import and analyze a number of computers' Event Logs, you should create a scheduled taskwith a series of steps that each execute this […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2005-03-28 (first published: )

1,303 reads

Technical Article

usp_exec_tsql_strfile

Executes a file containing T-SQL code without using OSQL. The file can be up to 80,000 characters. Each line in the file should be no more than 256 characters. (Customize the code as needed.) The DOS Type command is used to retrieve the code. Embedded "go"s are removed so don't expect termination behavior. The only […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2005-03-25 (first published: )

558 reads

Technical Article

Verify Directory Exists and Create if Necessary

This script will check to see if a directory exists and if it does not then it will create the directory. I did not create this as a stored procedure but it certainly could be. I tend to just place this as one of my job steps so I can create a backup file of […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2005-03-24 (first published: )

685 reads

Blogs

Goodbye, Microsoft

By

A few years ago I took a new job at Microsoft, working as a...

The SUM of Nothing: #SQLNewBlogger

By

I caught this interesting item over on Pinal Dave’s blog: Eleven Interview Questions that...

How to Move the SSMS Status Bar to the Top and Color-Code SQL Server Connections

By

I use color-coded connections in SSMS to distinguish Production, Pre-Production, UAT, and Development. But...

Read the latest Blogs

Forums

Buy driver’s license to legally drive in any EU country.

By docsmaster

Buy driver’s license to legally drive in any EU country.   We will help...

review about registered documents.

By docsmaster

review about registered documents. Hello have you been wondering how to get your documents...

Review about how people can get documents online without any stress

By docsmaster

Review about how people can get documents online without any stress, Get driving license...

Visit the forum

Question of the Day

RegEx Functions IV

I have this data in a table in a SQL Server 2025 database:

EmailAddressID EmailAddress
7              dylan0@ADVENTURE-WORKS.COM
8              Diane1@ADVENTURE-WORKS.COM
If I run this query, which row(s) are returned?
SELECT top 10
 *
 FROM person.EmailAddress
 WHERE REGEXP_LIKE(EmailAddress, '^D', 'i')
 AND BusinessEntityID IN (7,8)

See possible answers