Miscellaneous

SQLServerCentral Article

Review of IIS Admin Tool (No, its not a SQL article)

  • Article

Win XP Pro limits users to one web site, but developers often need to be able to switch between sites when coding locally. This free tool let's you easily do just that. Why an article on an IIS tool on a SQL site? We think it might be useful to you or someone on your team, and lots of SQL developers use IIS as well.

You rated this post out of 5. Change rating

2004-09-03

5,752 reads

Technical Article

Create an audit trigger on a table

  • Script

Sometimes you need an audit trigger on a table. I have created a generic trigger that will work for (almost)every table. if the audit table is not there yet, It will copy the table structure (but strip identity attributes) and put all the data in an AUDIT_ table.I believe this will work for almost every […]

5 (5)

You rated this post out of 5. Change rating

2004-09-02

1,609 reads

SQLServerCentral Article

InfoPath 2003 - Part 2

  • Article

Continuing with Dinesh Asanka's series on SQL Server and Infopath 2003, he shows us this time how to build a report that joins two tables and includes some conditional formatting. Infopath 2003 is part of Office 2003 and is a great quick and dirty tool for getting to your SQL Server data.

You rated this post out of 5. Change rating

2004-08-31

7,529 reads

Technical Article

Find strings in text of stored procedures

  • Script

Ussualy this kind of scripts queries sysobjects and syscomments like this:select distinct object_name(O.id)from syscomments as Cjoin sysobjects as O on O.id = C.id and o.type = 'P' -- search string only in stored procedureswhere C.text like '%insert into MyTable%'When the text of stored procedures, triggers, functions is over 4000 characters, it is saved in syscomments […]

You rated this post out of 5. Change rating

2004-08-26

245 reads

Technical Article

Failed Job Notification

  • Script

This script notifies the DBA or Developers with the list of failed jobs. This script useful if you want to use either Mater-Target server option or even single server to monitor the Target servers jobs. You must have SQL MAIL configured on the SQL Server.

You rated this post out of 5. Change rating

2006-02-20 (first published: )

2,099 reads

SQLServerCentral Article

Disaster in the Real World - Hurricane

  • Article

Hurricane Charlie had a pretty substantial impact on residents and businesses in Central Florida. Andy lives in the Orlando area and wrote up some notes on the various challenges he ran into it. Out of it you might find a couple things worth thinking about adding into your DR plan.

You rated this post out of 5. Change rating

2004-08-24

6,287 reads

Technical Article

Schema View

  • Script

Here is a simple view that is useful to pull basic data dictionary information out of your DB user tables. The description field is an extended property that I like to use for built in documentation of fields. This only works with 2000, 7 had a slightly different layout for the system tables.

You rated this post out of 5. Change rating

2004-10-27 (first published: )

336 reads

Technical Article

Where_Am_I

  • Script

This SP takes a string to be searched as input parameter, loops through all tables, views, Sp-s in the database andreturns the name of the object it was found and number of occurences

5 (1)

You rated this post out of 5. Change rating

2004-12-10 (first published: )

656 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