Miscellaneous

Technical Article

Search for a value in a numeric variable list

  • Script

When you have a variable that hold a comma separated numbers like '1,2,3' and you have a table with a column that has the value that should match a number in that list, you can use this script to avoid building a string and then executing it.You have to convert the columnID to varchar, the […]

You rated this post out of 5. Change rating

2002-05-20

377 reads

Technical Article

Get total file size of backup for last full backup

  • Script

The information for backup size is stored in the backup_size column of the backupset table in the msdb database as the total bytes for that backup. This script allow you to look at the total back to tape or file so you can plan space needs for those devices. This is a simple piece of […]

5 (1)

You rated this post out of 5. Change rating

2002-05-14

4,584 reads

Technical Article

Procedure for Random Numbers

  • Script

Here is handy procedure to generate random number.I find it useful when I generate large amount of test data in a database.For example if you need to create a Customer Data and what they have purchased in the last month to run perfrmance tests on large amount of data an set up necessary indexes.You can […]

You rated this post out of 5. Change rating

2002-05-13

657 reads

Technical Article

Parse a delimited string, return n-th value

  • Script

This UDF will parse a string delimited by the character you specify and return the value in the n-th position you requested.Example:select dbo.fn_parse('this string', ' ', 1) --> 'this'select dbo.fn_parse('this string', ' ', 2) --> 'string'select dbo.fn_parse('this string', ' ', 3) --> NULLselect dbo.fn_parse('this  string', ' ', 2) --> ''

1 (1)

You rated this post out of 5. Change rating

2002-05-10

487 reads

Blogs

A Couple Quick GENERATE_SERIES Tests

By

I had someone reach out about generate_series() recently, saying they hadn’t realized this was...

How I passed the DP-700 Exam

By

I recently took and passed the DP-700 exam, which is required for the Microsoft...

Which approach to take: Build it, buy it, cloud it?

By

As a Consultant, I would typically answer with – it depends! Then a typical...

Read the latest Blogs

Forums

Dynamic T-SQL Script Parameterization Using Python

By omu

Comments posted to this topic are about the item Dynamic T-SQL Script Parameterization Using...

How to Download and Restore AdventureWorks 2019 Database

By Noman072

Comments posted to this topic are about the item How to Download and Restore...

Tracking Table Sizes

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Tracking Table Sizes

Visit the forum

Question of the Day

Counting Bits IV

What does this code return in SQL Server 2022+?

select bit_count(2.4)
 

See possible answers