Show LF, CR , Space and Tabs in Stored Procedure
Word can do that. Why SQL not? Sometimes I want to see every space, horizontal tabulation, line feed or carriage return. It can help to write well formated store procedures.
2003-11-28
369 reads
Word can do that. Why SQL not? Sometimes I want to see every space, horizontal tabulation, line feed or carriage return. It can help to write well formated store procedures.
2003-11-28
369 reads
this procedure takes a character, tablename and columnname as input-parameter; on execution it removes the given leading character from the table-column - as well as leading blanks. small and easy but very helpful.
2003-11-27
155 reads
I pieced this script together from solutions I found on this and from Brian Knight's excellent book. It creates 3 tables: - tblDriveLogs. Collects free drivespace info for each drive for each time the script is run. - tblIndexLogs. Collects info on spaceused for each index and table. Please note that when only af single […]
2003-11-26
900 reads
This "script" truncates all user tables in a database (except dtproperties). It uses sp_msforeachtable stored procedure which cycles through each table in the database and performs the same query on each. Its useful in a number of different scenarios
2003-11-24
262 reads
2003-11-20
275 reads
This script creates a temp table of all the tables in a database and loops through a cursor to truncate them.
2003-11-20
286 reads
Persons Names,Addresses or any other master information if not entered with proper case . I mean if some records are with All caps ,some with all small or any other combination.You may be able to convert this data to proper case. Which will help you to show it in better looks on websites or in […]
2003-11-19
491 reads
This script starts in the master database, and then goes to each USER database and creates the DDL for each USER table in every database. You can then save the results or copy them to a new query window to run on another server.
2003-11-14
490 reads
This script will create another script that has all foreign key DDL that exists in a given database. You only have to run this, and then select the results of this script and paste it into another query window, or if for some reason you have lost your DDL this will enable you to retrieve […]
2003-11-12
241 reads
Hi guys What about a function that converts a number figure into words.This sample script is to demonstrate the procedural capabilities of SQL Server . Samples select fig2words(10) will give --Ten-- ,select fig2words(103) will give --one hundred and three -- The author uses much under utilized capability of SQL Server the recursive function calls to […]
2003-11-11
556 reads
By Chris Yates
Change is not a disruption in technology; it is the rhythm. New frameworks appear,...
No Scooby-Doo story is complete without footprints leading to a hidden passage. In SQL...
By James Serra
A bunch of new features for Microsoft Fabric were announced at the Microsoft Fabric Community...
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
Comments posted to this topic are about the item Checking Identities
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