Scripts

Technical Article

scrript to convert datatypes of multiple columns

generates an runs a select statement to convert all th olumns of a certain datatype in apirticular table to another datatype:eg all columns of type int to varchar etc the sp takes three parameters namely the table name, source data type and detination data type generates a select query ad executes it eg: exec ConvertTableTypes […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2007-07-10 (first published: )

218 reads

Technical Article

Script to find a string in SP/Function/View SQL

I mark my SQL with a 'Todo' symbol whenever I decide something needs work, but I don't have the time to do it right away. So I wrote this usp so that I can get a quick list of stored procedures, function and views that need some extra work.It also comes in handy whenever you […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2007-07-06 (first published: )

318 reads

Technical Article

Make a time value from a given float value

Clients asked me to show a more detailed and longer text which doesn't have to be edited. So I came up with the following solution/function.This function returns a varchar time value with a description containing how many days, hours and minutes. For example 100.25 returns :'100:15( 4 Days, 4 Hours, 15 Minutes )'.I hope somebody […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2007-07-04 (first published: )

159 reads

Technical Article

Script to simplify maintenance of sysproperties

This procedure will maintain the sysproperties table by wrapping system procedures:                • sp_addextendedproperty                • sp_dropextendedproperty                • sp_updateextendedproperty            The parameters are:                • @object    --    primary name of the object being to be maintained.                • @column    --    column or parameter […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2007-07-04

115 reads

Technical Article

Script to simplify maintenance of sysproperties

This procedure will maintain the sysproperties table by wrapping system procedures:                • sp_addextendedproperty                • sp_dropextendedproperty                • sp_updateextendedproperty            The parameters are:                • @object    --    primary name of the object being to be maintained.                • @column    --    column or parameter […]

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

You rated this post out of 5. Change rating

2007-07-04

461 reads

Technical Article

List all indexes with keys, description and size

This script combines functionality of sp_helpindex and sp_spaceused to list all tables with individual indexes, their keys and description  (sp_spaceused cannot do that) and size in MB per individual index (sp_helpindex cannot do that either). Feel free to use and modify as you see fit. Hope it can help.

★ ★ ★ ★ ★ ★ ★ ★ ★ ★

(9)

You rated this post out of 5. Change rating

2007-07-03 (first published: )

2,678 reads

Blogs

Why AI isn’t paying off yet, and what to invest in first

By

Why isn’t AI paying off yet? Drawing on lessons from digital transformation, Joyful Craftsmen...

Flyway Tips: Analytics Platforms (Snowflake and Databricks)

By

I’m really excited about some growth in Flyway support. I’ve been asking about this...

Paginated Reporting at Scale: Choosing the Right Microsoft Platform

By

"I've seen things you people wouldn't believe..."— Roy Batty, Nexus-6 Replicant, Blade Runner (1982)(2026-Nov-08) Yep,...

Read the latest Blogs

Forums

Pay for Performance

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Pay for Performance, which is...

Too Many Choices

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Too Many Choices

Table Partitioning in SQL Server: A Practical Guide to Managing Very Large Tables (VLDBs)

By sabyda

Comments posted to this topic are about the item Table Partitioning in SQL Server:...

Visit the forum

Question of the Day

Too Many Choices

I have a table, dbo.MasterBrands, with this data:

BrandID OfficialName
1       Samsung
2       Apple
3       Microsoft
4       Adidas
5       Coca-Cola
I run this query. What is returned for Coca-Cola?
SELECT CHOOSE(BrandID, 'Conglomerate', 'Tech and Design', 'Desktop', 'Apparel')
FROM dbo.MasterBrands;

See possible answers