2005-09-28 (first published: 2004-09-23)
275 reads
2005-09-28 (first published: 2004-09-23)
275 reads
This UDF takes a delimited string and parses it into "words" which are returned as rows in a table. The table returned indicates the position of each element in the source string, and converts values to integer and numeric formats if possible.The script contains examples on how to use the function.the original version was written […]
2005-09-26 (first published: 2004-08-10)
636 reads
This function will increment the given alpha numeric string in sequential order up to 100 characters. (The length can be easily modified)
2005-09-22 (first published: 2005-02-14)
2,596 reads
Here's a quick and dirty function for parsing strings based on a delimiter (As in a varchar field with comma delimited text). I'm hoping for feedback on a more efficient means of doing this.Also,4 functions for comparing two delimited lists of strings. Many may ask why these are needed, but that's a very long explanation […]
2005-09-21 (first published: 2004-08-25)
258 reads
This is a function that takes a start date and end date as parameters and returns the number of weekdays (Monday to Friday) in between. This function assumes that Sunday is set as the first day of the week. Adapted from a vb function that I wrote to calculate standard salary costs for billing purposes. […]
2005-09-19 (first published: 2004-10-16)
300 reads
This script will document tables (including constraints and triggers, row counts, sizes on disk), views (including all used fields), stored procedures (including used fields and parameters), database users, database settings and server settings.This script has been cobbled together from several others found on this site, so they deserve the recognition, not me 🙂Simply execute it […]
2005-09-16 (first published: 2004-09-02)
376 reads
Use this script to navigate your recordset a page at a time containing a specific number of records and in a specified order.I use the supplier table of the northwind Database to demonstrate thisReturn List of suppliers, ordered by supplier desc, 10 records at a timeexecute prc_lov_SUPPLIERS "", "Suppliers", 1, 1 ''Page oneexecute prc_lov_SUPPLIERS "", […]
2005-09-08 (first published: 2002-05-02)
243 reads
Quando você restaura um banco ou 'atacha' ao seu servidor de outro servidor, pode ocorrer de o usuário que existe no banco não sincronizar com o login do SQL server anteriormente criado com DBO desse banco, então esse script faz exatamente isso, pega o SID do SQL e dá um UPDATE no SID do usuário […]
2005-09-06 (first published: 2005-08-30)
363 reads
This might not be the fastes script, in the world but it takes care of the McDonalds, O'Brian's, MacPherson's and the Jens-Michael's of the world.
2005-09-05 (first published: 2005-08-31)
294 reads
Many users during the process of insert or update get the following warning issued by SQL ServerWarning: The table 'TABLE NAME' has been created but its maximum row size (XXXX) exceeds the maximum number of bytes per row (8060). INSERT or UPDATE of a row in this table will fail if the resulting row length […]
2005-09-02 (first published: 2005-08-25)
332 reads
By Steve Jones
Fear is fueled by a lack of imagination. The antidote to fear is not...
The slidedeck and the SQL scripts for the session Indexing for Dummies can be...
By Chris Yates
Change is not a disruption in technology; it is the rhythm. New frameworks appear,...
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...
We have a report that has multiple tables that list the top 15 performers...
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