Truncate all tables in a database
This script creates a temp table of all the tables in a database and loops through a cursor to truncate them.
2003-11-20
298 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
298 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
511 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
511 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
253 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
563 reads
This is a bummed version of many of the "csv creating" scripts I've seen. No need to use a temp table or loop; the string can be built with one select statement (Select @String = isnull(@String + ',','') + Column From Table)
2003-11-10
377 reads
Use SQL-DMO to find database size used for more than one sql server in your enviroment.
2003-11-10
184 reads
Sometimes it's necessary to strip non-numeric characters from the string, so you can convert to integer without error. Often it happens when you want to use stored procedure, especially system procedures. The output there can be already with some characters (MB, KB and such), but you want this result to be used for your own […]
2003-11-10
1,327 reads
This will make a comma seperated list from a column using 2 select statements.
2003-11-07
203 reads
This stored proc notify the user(s) if the data/log file grew. When you execute it for the first time it will get the data/log files sizes and inserts in a table. Next time when you run the script if will compare the current size with the previous files size. This script must need sqlmail configured […]
2003-11-07
1,493 reads
By Vinay Thakur
This blog series on Audit/Compliance/Security, this is first blog where we would discuss about...
In the previous post, we've built a SQL Server 2025 sandbox in an OrbStack...
By Steve Jones
Thanks to everyone for attending my talk today at Day of data Baton Rouge...
Via WhatsApp+62 821-8200-174 Cyber 2, Gedung Menara Karya, Jl. H. R. Rasuna Said Jl....
Via WhatsApp+62 821-8200-174 Gedung C3 Lt. 1-3 Komplek, Jl. Puri Indah Raya No.1-3 Blk...
Yeah, I know this is a 2022 forum, but I don't see a 2025...
If I use the -k parameter with a number after it, what does this change in SQL Server?
See possible answers