2004-09-25
56 reads
2004-09-25
56 reads
2004-09-25
580 reads
2004-09-25
76 reads
Many a times we need to split a string into its indivisual words and return a array like the Split function of Visal Basic which accepts a delimeter. Here is a script which assumes the delimeter to be the space character and works in a similar method.
2004-09-24 (first published: 2004-03-25)
153 reads
This functin returns the number of days in a month, given the month and the year. It does this by adding 1 month to the first of the month, substract 1 day and get the day part of the result.
2004-09-23 (first published: 2004-03-30)
104 reads
This is a simple stored procedure, for inclusion in your script writing efforts, that strips non-numeric data from a given varchar. This is most usefull in scripts used to clean-up data such as account numbers that may include spaces, dashes and the like.
2004-09-21
315 reads
To help maintain index quality, defragging of any given index is a good thing. This will defrag ALL indecies in the current DB. NOTE: Schedule for off-hours operations. For a massive re-write of indecies, change the remarking on "--IF @indid" lines to use reindex instead of just defragging.
2004-09-21
575 reads
Simple enough routine that I've had to write I don't know how many times in different languages. It does what it says in the title i.e. kills multiple occurences of the whitespace character, leaving one behind to tell the tale.
2004-09-20 (first published: 2004-05-21)
141 reads
Given SQL text (@sql_txt) that will return XML data, run that XML data against an XSL template (@xsl_file_nm), and save the output to the specified outputfile (@out_file_nm). If @xsl_file_nm is not specified, then output is just saved as XML.This script is very usefull, but not secure. One could easily overload any of the script input […]
2004-09-17
297 reads
This Simple Function Let u get the Word Format From Numeric Value. Its just like NumericToWord Function in some prog. Languages.Just Copy and Paste it in SQL Query Analyzer and build it.Your Views are always welcomed at mayursid@yahoo.co.in
2004-09-17
109 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,...
We have a tool called DB Moto that reads journals (like t-logs) and replicates...
Comments posted to this topic are about the item Don't Forget About Financial Skills
Comments posted to this topic are about the item Building a Simple SQL/AI Environment
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