String Parsing
User Defined function to parse a string with known delimiters and return back the substing in the position.Takes string,delimiter and position as parameters. Can be used directly in TSQL code.
2003-03-27
328 reads
User Defined function to parse a string with known delimiters and return back the substing in the position.Takes string,delimiter and position as parameters. Can be used directly in TSQL code.
2003-03-27
328 reads
When you want to export a table structure to T-SQL, everyone always points you to Enterprise Manager, or a script that calls BCP.Sometimes, a developer either doesn't have access to those tools, or just doesn't want to use them (like me) out of spite.I made this T-SQL because it was educational, and noone else seems […]
2003-03-26
4,007 reads
This procedure helps to find the status of all the trigger (i.e Enabled/Disabled) for a given database. If no database name is provided then it uses the default database.This script is tested on SQL Server 7.0/2000 only.
2003-03-25
279 reads
This stored procedure shrinks all database files within the current database, including the unused portion of transaction log. This procedure is especially useful for multi-file databases.
2003-03-24
201 reads
This script reindexes all tables in all databases. Execute the script with the desired fill factor and it will do the rest. There is an option to exclude databases from the reindex. This makes it easy to reindex all newly created databases. Great for the Development environment when Developers are creating database all the time.
2003-03-23
1,946 reads
This script will obscure email addresses from robots even ones that ignore the tags to not snoop. Usually robots that ignore the tags, and the robots.txt file are used by spammers. They pull down the SOURCE of your page and scrape the email addresses from them. This script breaks the mail href into its base […]
2003-03-23
95 reads
The three functions here can be used to store Bit Masks as Integers.These are functions to convert an integer into a binary string. This can be useful if you store Bit Masks in your database as integers.For example .. '00000000000011111001001001110011' to 1020531Each Bit could represent an ON or OFF value. One integer columncould be equivalent […]
2003-03-21
3,860 reads
A Procedure gather Server Statistic per day or per run this Procedure.Output: Table TBL_SERVERSTATISTICS. You can use the results to analyze SQL-Server performance problems. You can analyze what changed after install new hardware or software, add or remove Application/DB/File/Index/Table etc.Recommendations: Run a Procedure once every day.Warning: If sql-server restarted after last run a Procedurecurrent running […]
2003-03-13
1,046 reads
Each week you are required to run various reports based on table entries made during the week preceding latest Sunday. Use this SQL7/2000 procedure (can be a UDF in SQL2K) to retrieve the latest midnight of a specified day of the week as illustrated below: Declare @StartDate datetime, @EndDate datetime Exec DBAservice.dbo.uspGetLatestWkDayMidnight @pDate = '1998-05-06', […]
2003-03-13
307 reads
This script creates a stored proc to verify all backups in a media set and load their history into MSDB. I use this frequently when I get backup files from clients and want to use Enterprise Manager's intelligent restore selection to quickly get the database restored on a test machine.
2003-03-11
301 reads
By Steve Jones
One of the neat enhancements made to Flyway was the addition of state-based workflows...
I did a couple of posts previously on dumping/restoring Azure PostgreSQL databases and also...
By Brian Kelley
Most of us know that spending a lot of time on social media and...
our client wants to implement Third Party SQL Monitoring tool to monitor SQL server...
I have a powerQuery that reads and transforms a table in a PDF. Works...
Good Afternoon. I have a Table where each Record: 1) Represents an Appointment. 2)...