|
|
|
|
|
|
|
|
|
|
|
Methods to form complex strings for dynamic SQL execution
|
Total Hit (1552) |
This T-SQL script shows several techniques to form complex dynamic SQL strings. These eliminate to some extent the coding involved in concatenating string values and making sure to add single quotes appropriately between values. The methods discussed can make the code simpler to read & is less error
....Read More |
Rating
|
|
|
Tricks using a numbers table
|
Total Hit (1593) |
Solving most problems using a relational technique is more elegant and better in terms of performance. This script shows few examples that uses a Numbers table to solve some common problems. Keep a table with Numbers & it will prove very handy.
|
Rating
|
|
|
|
Example for encrypting data using XOR
|
Total Hit (1837) |
Functions to encrypt data in columns are not available in SQL Server (except undocumented ones that are risky to use & not supported). Here is one that shows how to do this using XOR.
«code LangId=6»DECLARE @pwd varchar(30) , @encryptkey int , @encryptedpwd varchar(30) , @charpos smallint;
SELE
....Read More |
Rating
|
|
|
Check a string for numeric digits only
|
Total Hit (1808) |
The ISNUMERIC function in SQL60/65/70 checks for decimal & integer values. Hence characters like D, E are valid float representations & similarly ','. This is a simple logic that can check only for numeric digits without using a loop of any kind.
|
Rating
|
|
|
|
Strip the tags out of a HTML string
|
Total Hit (1322) |
A relational technique to strip the HTML tags out of a string. This solution demonstrates how to use simple tables & search functions effectively in SQL Server to solve procedural / iterative problems.
|
Rating
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|