Read the registry using T-SQL
This script uses the extended stored procedure xp_instance_regread to read a value from the registry
2004-02-20
1,483 reads
This script uses the extended stored procedure xp_instance_regread to read a value from the registry
2004-02-20
1,483 reads
Indexes and table Statistics play a big role in an OLTP database for better query performance. Maintaining statistics on a weekly basis is important but a heavily updated database tables need more emphasis on Statistics and frequent updates. Instead of trying to issue “sp_updatestats” for the entire database, you can choose tables which are heavily […]
2004-02-17
1,988 reads
This stored procedure is created from the need to copy rows from a table with new value. The script itself will create stored procedure proc_copyrows.The parameters are@TableName: the table name@FilterField: filter field, default is null, means no filter@SourceValue: the value of filter field from source data to be copied@DestinationValue: the new value of filter field@SourceDB: […]
2004-02-13
265 reads
Generate an html-excel file with any table. Does not need Excel to generate , because does not use Excel automation
2004-02-12
436 reads
Search all text fields in a database for a literal string.Outputs SQL statements to query analyser window, which can then be run in a new window.
2004-02-10
207 reads
Stored procedure to search every field in the database for a string literal. Run the stored procedure in Query analyser, which will output sql statements to do the search. The output of these searches will be the update sql, which again should be pasted into a query analyser window. As the stored procedures do not […]
2004-02-10
265 reads
This script outputs the data in chronological order from the current SQL Server log.Output columns are: Log Entry Time, Event Source, Log Entry Text. This data matches with the data that can be seen under the SQL Server logs view in Enterprise Manager.The script is stand alone, but could easily be parameterised to work as […]
2004-02-10
887 reads
Generate an html-excel file with any table. Does not need Excel to generate , because does not use Excel automation.
2004-02-08
530 reads
sp_XTAB (prototype) produces pivoted (crosstab) views/output with a minimum of fuss.No messing with code, just tell XTAB what you want to pivot.Tested to 764 pivoted columns, XTAB can generate up to 63000 characters of dynamic sql. Example (deliberately over-simplified)----------------------updated 27 January 2004Use NorthwindEXEC sp_XTAB 'Northwind','xtEMPL_COUNTRY','Orders','EmployeeID','ShipCountry', '', 'OrderID','COUNT','NULL', '', 'SELECT xtEMPL_COUNTRY.* FROM xtEMPL_COUNTRY' -- Include optional […]
2004-01-24
392 reads
Function to allow for checking if an IP address is a private IP address. Will convert the IP to a bigint equivalent if within the private range, otherwise it will return null if IP is a public address.Requires function IPStringToNumber which is included in the post
2004-01-23
1,306 reads
By Steve Jones
I had an idea for an animated view of a sales tool, and started...
Next Monday, February 9, 2026, my one-day live online training SQL Server Query Tuning...
By Steve Jones
One of the features we advocates have been advocating for is a better way...
Comments posted to this topic are about the item Delta Lake: The Definitive Guide:...
Comments posted to this topic are about the item Databricks Data Intelligence Platform: Unlocking...
Comments posted to this topic are about the item Storytelling with Data: Let's Practice!
In SQL Server 2025, what is returned from this code:
DECLARE @message VARCHAR(50) = 'Hello SQL Server 2025!'; DECLARE @encoded VARCHAR(MAX); SET @encoded = BASE64_ENCODE(CAST(@message AS VARBINARY(1000))); SELECT BASE64_DECODE(@encoded)See possible answers