Miscellaneous

Technical Article

Quickly Reveal DB Recovery Model on all Databases.

  • Script

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: )

798 reads

Technical Article

Quick and Dirty Server/Instance information

  • Script

I do a lot of SQL Server Desktop Edition instance testing and I cobbled together this script from BOL and other scripts I've seen posted.  It is intended to show version, service pack level, machine and instance name and the security type among other information.  Hopefully someone else may find it of use. 

You rated this post out of 5. Change rating

2003-02-27

244 reads

Technical Article

Generate Insert/Update/Delete Sprocs for a table

  • Script

A week ago I posted this script. It was a much simpeler version without error checking. Now all the sprocs return the same errors.    0 THERE WERE NO ERRORS  -99 UNEXPECTED NR OF RECORDS AFFECTED  0 THE SQL ERROR NUMBER Also with the insert statement the @ID is set. So you can retrieve the […]

You rated this post out of 5. Change rating

2003-02-25

401 reads

SQLServerCentral Article

Pro Developer : This is Business

  • Article

In his travels, Christopher Duncan has come to recognize a great many similarities between programmers and musicians. Both have the fire, passion and soul of the artist. And all too often, both are aweful when it comes to the business end of things. Business - you know, that aspect of your work where they actually pay you at the end of the day?

You rated this post out of 5. Change rating

2003-02-25

3,499 reads

Technical Article

Func. generates insert and select for large table

  • Script

Generates an insert statement including column list.  Useful for identity table data copying.  Just modify the code generated to select and insert the needed fields.  Saves time on large table inserts (also generates a select statement.  Use part or all of the SQL generated.  Saves development time when dealing with large tables.

You rated this post out of 5. Change rating

2003-02-21

181 reads

Technical Article

Script to Define User-Defined Data Types

  • Script

Our DBA and I (I'm a PowerBuilder programmer) decided to plunge head-first into UDTs. After reading the message boards, I thought maybe we could come up with a way to make them work. My solution is this stored proc. There are some assumptions made that work for our needs and some extra work that was […]

You rated this post out of 5. Change rating

2003-02-20

319 reads

Technical Article

Generate Insert/Update/Delete/Get  SPROCS

  • Script

This is a script that creates Insert / Update / Delete and Get stored procedures for a specific table.It will only work for tables with a unique primary key.Have a look at what is does, and if you like it, Vote for it. Maybe there are tons of sprocs out there that perform the same […]

4 (1)

You rated this post out of 5. Change rating

2003-02-19

274 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

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...

combining a param value with widcards in a foreach loop files property

By stan

Hi, it isnt clear from the web if something like this should work as...

Extract sql data in psh

By Sqladmin1

# Load ImportExcel module Import-Module ImportExcel -ErrorAction Stop # File paths $outFile = "C:\Reports\SQLReport.xlsx"...

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