Scripts

Technical Article

SP_WHO_3 - A Very Powerful Utility for All DBAs

SP_WHO_3 is a very powerful utility for all DBAs. It displays processes connected to the system and what they are doing. It can find blocking processes, can return the Input Buffer for everything in the recordset returned, and provides immense filtering and sorting capabilities. It's designed to be extremely efficient, yet it provides many more […]

You rated this post out of 5. Change rating

2006-01-17 (first published: )

2,411 reads

Technical Article

List any Object In Any Database On Server

I found my self in a fimilar situation where I wanted to modify a table but was not sure how heavily it was used. So I started out with a script that just searched for a table. Then I tought to my self...self...What about all those times you want to expand a column or drop […]

You rated this post out of 5. Change rating

2006-01-16 (first published: )

430 reads

Technical Article

SQL 2000 Data & Log file info for all DB's

Returns information about all the data / log files on a server, such as total file size, % used & free, etc.Can be set to filter out db's you don't want to monitor.When edited to allow the "update usage", numbers reported will be more accurate.Note: if you edit to allow update usage and intend to […]

You rated this post out of 5. Change rating

2006-01-12 (first published: )

363 reads

Technical Article

Script Table Data to Insert Statements

This script will create a series of insert statements for a given table. It does not support every single data type in every way and has some limitations. If you add any enhancements, please send them to me at bbyrd@intellithought.com so I can update it here. Update (28 Feb 2005): Added support/Fixed bug with smalldatetime […]

4.25 (8)

You rated this post out of 5. Change rating

2006-01-11 (first published: )

4,940 reads

Technical Article

User-Defined string Functions Transact-SQL

GETWORDCOUNT, GETWORDNUM, AT, RAT, OCCURS,CHRTRAN, STRFILTER, PADC, PADR, PADL, PROPER, RCHARINDEX etc. AT, PADL, PADR, CHRTRAN, PROPER are similar to functions Oracle PL/SQL INSTR, LPAD, RPAD, TRANSLATE, INITCAP. In my humble opinion, it will be convinient to apply such functions for writing of stored procedures and User-Defined Functions on Transact-SQL. Please, download the file http://www.universalthread.com/wconnect/wc.dll?LevelExtreme~2,2,27115

You rated this post out of 5. Change rating

2006-01-10 (first published: )

1,554 reads

Technical Article

Find All Code with Rollback Tran but No Begin Tran

This simple script identifies all objects which have a rollback transaction statement without a requisite begin transaction statement. If a rollback statement is issued without a begin statement, then the code will generate an error. Triggers are not included in the list since they can have a rollback without a begin. This script can be […]

You rated this post out of 5. Change rating

2006-01-09 (first published: )

350 reads

Technical Article

Script To Get the Report Execution log, ex. timetaken .

this script lists the report Execution History ex: timetaken to render, retreive data, number of records retreived and their size etc.. in descending order of its execution timeReports the ReportName, its Path , TimeTaken to execute the report, retreive the data, render the report, total count of rows returned and the total data returned in […]

5 (1)

You rated this post out of 5. Change rating

2006-01-06 (first published: )

239 reads

Technical Article

Scripting extended properties

I use these to manage the addition and removal of extended properties on all tables and columns in my company's dbs.Rather than writing complicated joins or calling functions every time, I use views on sysobjects and INFORMATION_SCHEMA tables. I tried to make these scripts as flexible as possible so you can reuse them in procedures, […]

5 (1)

You rated this post out of 5. Change rating

2006-01-05 (first published: )

1,238 reads

Technical Article

List user's permissions

With this script you can see the permissions that every user-defined role and every user without a dbrole has.The list could get very large and hard to manage, but it helped me to build the roles of an app that didn't had any role defined.Hope it'll be usefull to someone

2 (1)

You rated this post out of 5. Change rating

2006-01-02 (first published: )

714 reads

Blogs

Scaling SQL Server 2025 Vector Search with Load-Balanced Ollama Embeddings

By

SQL Server 2025 introduces native support for vector data types and external AI models....

Advice I Like: Fear and Imagination

By

Fear is fueled by a lack of imagination. The antidote to fear is not...

Cloud Data Driven User Group 2025 – Slides & Scripts

By

The slidedeck and the SQL scripts for the session Indexing for Dummies can be...

Read the latest Blogs

Forums

How to use data pre-computed in previous ETL SSIS Nodes?

By rafa040500

I'm building ETL packages in SSIS. My data comes from an OLE DB Source...

Building AI Governance and Policies- First Steps

By dbakevlar

Comments posted to this topic are about the item Building AI Governance and Policies-...

Simple delete causes table scan on other tables with foreign key

By askcoffman

Why is sql doing a full scan VS seeking on the index? I've included...

Visit the forum

Question of the Day

Checking Identities

The DBCC CHECKIDENT command is used when working with identity values. I have a table with 10 rows in it that looks like this:

TravelLogID CityID  StartDate   EndDate
1           1       2025-01-11  2025-01-16
2           2       2025-01-11  2025-01-16
3           3       2025-01-11  2025-01-16
4           4       2025-01-11  2025-01-16
5           5       2025-01-11  2025-01-16
6           6       2025-01-11  2025-01-16
7           7       2025-01-11  2025-01-16
8           8       2025-01-11  2025-01-16
9           9       2025-01-11  2025-01-16
10          10      2025-01-11  2025-01-16
The docs for DBCC CHECKIDENT say this if I run with only the table parameter: "If the current identity value for a table is less than the maximum identity value stored in the identity column, it is reset using the maximum value in the identity column. " I run this code:
DELETE dbo.TravelLog WHERE TravelLogID >= 9
GO
DBCC CHECKIDENT(TravelLog, RESEED)
GO
INSERT dbo.TravelLog
(
    CityID,
    StartDate,
    EndDate
)
VALUES
(4, '2025-09-14', '2025-09-17')
GO
What is the identity value for the new row inserted by the insert statement above?

See possible answers