Find the value of a name/value pair in a string
It has always bothered that there is not a NameValuePair function in SQL.
2007-05-23 (first published: 2007-05-16)
174 reads
It has always bothered that there is not a NameValuePair function in SQL.
2007-05-23 (first published: 2007-05-16)
174 reads
DESCRIPTION:This procedure produces a SELECT statement which explicitly lists all fields for 'tablename' with fieldname and alias as the column name. The SELECT it produces is ready to run or if you need to join several tables just copy the column names off the SELECT it generates. I use this a lot when I create […]
2007-05-22 (first published: 2007-05-19)
181 reads
This is just a quick method to determine the backup mode of all databases on a server. No cursor involed.
2007-05-18 (first published: 2007-05-07)
425 reads
A simple script to find the database recovery model. Cut & paste into Query Analyser
2007-05-17 (first published: 2007-05-08)
2,973 reads
This code provides a way of monitoring the growth of all your databases within a single instance. The first part is the creation of a monitoring table with the initial load of current databases and sizes. The second part is the SQL that can be put in a scheduled job to automate the growth monitoring.It […]
2007-05-16 (first published: 2007-05-08)
24,353 reads
This is a generalised Function that will return a String in Proper Case [Camel Case]. Means Afetr every space, first later will be in UPPER Case.Example:Input String: 'microSoft sql server'Output String: 'Microsoft Sql Server'
2007-05-09 (first published: 2007-04-19)
21,811 reads
This function will return you the month-end date. Input parameter may be any date of that month for which you want to calculate month-end.Example:Input: '2-20-2004' Output: '2-29-2004'Input: '2-15-2004' Output: '2-29-2004'Input: '3-20-2004' Output: '3-31-2004'Input: '3-30-2004' Output: '3-31-2004'
2007-05-08 (first published: 2007-04-19)
1,323 reads
2007-05-07 (first published: 2007-04-20)
233 reads
To Retreive List of Default Constraints from current database with PRINT or DROP
2007-05-04 (first published: 2007-04-20)
541 reads
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" […]
2007-05-03 (first published: 2003-03-06)
798 reads
By Steve Jones
Thanks to everyone who attended my sessions today at SQL Saturday Boston 2025. I’ve...
SQL Server 2025 introduces native support for vector data types and external AI models....
By Steve Jones
Fear is fueled by a lack of imagination. The antidote to fear is not...
I'm building ETL packages in SSIS. My data comes from an OLE DB Source...
Comments posted to this topic are about the item Building AI Governance and Policies-...
Why is sql doing a full scan VS seeking on the index? I've included...
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-16The 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') GOWhat is the identity value for the new row inserted by the insert statement above? See possible answers