Using a temprary table as an array
This script is used to extract from a temprary table with long string all elements in an array formatlength of 15 chars is assumed.
2002-08-01
624 reads
This script is used to extract from a temprary table with long string all elements in an array formatlength of 15 chars is assumed.
2002-08-01
624 reads
Smooshing - The act of removing all non-alphanumeric characters from a string. We have found several areas of our application where we need to perform cleaning on strings. The following is a SQL function which can be used to remove any non-alphanumeric characters. To use the function create the script and then SELECT dbo.fn_SmooshIt('B?\RU.,C>}E') will […]
2002-07-26
554 reads
Instead of interactively running profiler, you can use built in stored procedures to obtain the same results. You can even schedule the execution of the trace and output to a designated output file.
2002-07-25
706 reads
Procedure 'p_find_string' allows users to specify any database on a server in searching for a specified character string. Supported for string-searching: table columns, view columns, trigger, function, and procedure code. Produces a report showing: object type, owner, object name, column id (for tables and views) or what line number (for triggers, functions, and procedures), and […]
2002-07-22
147 reads
Scalar function 'f_delimited' slices out of a passed-in string, from a specified position inside the string, that segment of it which is delimited on one or both sides by a specified delimiter.Example: Print out a segment of a 'syscomments.text' column for a stored procedure 'p_proc', representing a line of code (i.e., the segment of 'syscomments.text' […]
2002-07-22
117 reads
Scalar function 'f_contains' counts the number of times the first argument occurs within the second argument.Given: @arg1, @arg2 (both VARCHAR), @cnt INTSELECT @cnt = dbo.f_contains (@f_search_for = @arg1 , @f_container = @arg2)
2002-07-22
388 reads
Let's say you have 2 tables: a Contacts table and a PhoneNumbers table (which stores all the phone numbers for each contact). You are asked to write a query that returns each contact's name and a comma-delimited string of phone numbers for each contact, something like this:FirstName LastName PhoneNumbers--------- -------- --------------------------John […]
2002-07-22
1,032 reads
Using a Having clause I eliminate getting the EVEN rows and getting ovly the odd primary keysBy using Having (count(*) %2) = 0 I will get the even and not the odd.
2002-07-20
299 reads
Copy and paste this script into Query Analyzer and run it.Use this script to generate a simple security string of 0's and 1's.
2002-07-19
383 reads
Lists objects from database. Similar to 'dir' command from DOS 🙂Typical usage sp_dir 't' 'order*', 1 - returns list of all tables whose name start with 'order' plus their columns and data typessp_dir 'p' 'custom*_sp' - returns list of all stored procedures whose name start with 'custom' and end up with '_sp'For list of […]
2002-07-19
496 reads
By Steve Jones
With the AI push being everywhere, Redgate is no exception. We’ve been getting requests,...
By Steve Jones
fawtle – n. a weird little flaw built into your partner that somehow only...
AWS recently added support for Post-Quantum Key Exchange for TLS in Application Load Balancer...
Comments posted to this topic are about the item Where Your Value Separates You...
Comments posted to this topic are about the item Fixing the Error
Comments posted to this topic are about the item T-SQL in SQL Server 2025:...
On SQL Server 2025, I have a database that has this collation: SQL_Latin1_General_CP1_CI_AS. I decide I want to run this code:
SELECT UNISTR('*3041*308A*304C*3068 and good night', '*') AS 'A Classic';
I get this error:Msg 9844, Level 16, State 4, Line 24 The char/varchar input type uses an unsupported collation. Only a UTF8 collation is supported with char/varchar input type in UNISTR function.What is the easiest way to fix this error? See possible answers