Miscellaneous

Technical Article

UDF Random Password Generator

  • Script

UDF Random Password GeneratorYou can not use the RAND function directly from a User Defined Function. So the UDF I wrote "fn_RandomPassword" uses the view "view_RandomPassword8" to get the random charaters.Having the random password generator is useful if you need to insert a large number of users into a table with random passwords assigned.For example […]

5 (2)

You rated this post out of 5. Change rating

2003-08-07

377 reads

Technical Article

Capture useful info about your SQL Server dbs

  • Script

The server goes down and you are scrambling to remember settings, file names, locations, etc. about your databases on that server. This script captures that useful information before a serious problem occurs. I run it as an OSQL (ISQL) job and send the output file to my backup folder so the infomation goes to tape […]

4.5 (2)

You rated this post out of 5. Change rating

2003-08-07

673 reads

SQLServerCentral Article

Review of Murachs SQL for SQL Server

  • Article

Andy rates this one 4.5 out of 5 stars and likes it enough to recommend it's use at work. This is a book that should teach a developer how to use the key abilities of SQL. If you're looking for a book to guide your beginning/intermediate developers, this might be it.

You rated this post out of 5. Change rating

2003-08-06

3,610 reads

Technical Article

Proper Case function for DTS Transformation

  • Script

This VBS function will convert a string into Proper Case (i.e. This Is Proper Case) during the execution of the DTS package.  Wrap the DTSSource function with the PropCase function and the result is a Proper Case transformationexampleFunction Main()    DTSDestination("Field1") = PropCase(DTSSource("Col019"))    Main = DTSTransformStat_OKEnd Function

You rated this post out of 5. Change rating

2003-08-05

211 reads

Technical Article

sp_dba_spacealert_dmo.vbs

  • Script

This vbscript is used to alert and email receipients on Filegroup space usageOuput:  '% Space Avail. , Space Avail. Filesize, MaxSize, FileName, DBname, FileGroupThe process takes three arguments - SqlserverName , Threshold for percentage of available space to check ,Mininum MaxFileSize to checkExecute the script either from the command line or schedule the script via […]

You rated this post out of 5. Change rating

2003-08-01

344 reads

Technical Article

MZTools - Addin for VB6

  • Article

Freeware! This add-in gives you some great extra features when working in VB6. It has a tab index setter, options to add a chunk of error handling code, a simple code analyzer that gives you some metrics, and my favorite - an option to identify unused code and variables. If you're still using VB6 it's worth trying.

2003-07-30

1,541 reads

Blogs

The CDO’s Playbook for AI Driven Decision Making

By

The New Arena of Leadership The role of the Chief Data Officer is no...

sp_snapshot – The easy way to take database snapshots of one or more databases – V3.0

By

Presenting you with an updated version of our sp_snapshot procedure, allowing you to easily...

SELECT *

By

SELECT * feels convenient, but in SQL Server it bloats I/O, burns network bandwidth,...

Read the latest Blogs

Forums

Recursive Select - What is this really doing

By Leo.Miller

I've noticed several instances of what looks like a recursive insert with the format:...

Cleaning Up the Cloud

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Cleaning Up the Cloud

The Maximum Value in the Identity Column

By Steve Jones - SSC Editor

Comments posted to this topic are about the item The Maximum Value in the...

Visit the forum

Question of the Day

The Maximum Value in the Identity Column

I have a table with this data:

TravelLogID CityID StartDate  EndDate
1           1      2025-01-01 2025-01-06
2           2      2025-01-01 2025-01-06
3           3      2025-01-01 2025-01-06
4           4      2025-01-01 2025-01-06
5           5      2025-01-01 2025-01-06
I run this code:
SELECT IDENT_CURRENT('TravelLog')
I get the value 5 back. Now I do this:
SET IDENTITY_INSERT dbo.TravelLog ON
INSERT dbo.TravelLog
(
    TravelLogID,
CityID,
    StartDate,
    EndDate
)
VALUES
(25, 5, '2025-09-12', '2025-09-17')
SET IDENTITY_INSERT dbo.TravelLog OFF
I now run this code.
DBCC CHECKIDENT(TravelLog)
GO
INSERT dbo.TravelLog
(
    CityID,
    StartDate,
    EndDate
)
VALUES
(4, '2025-10-14', '2025-10-17')
GO
What is the value for TravelLogID for the row I inserted for CityID 4 and dates starting on 14 Oct 2025?  

See possible answers