T-SQL

Technical Article

Copy rows generator

  • Script

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: […]

You rated this post out of 5. Change rating

2004-02-13

251 reads

Technical Article

XTAB - CROSSTAB UTILITY

  • Script

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 […]

You rated this post out of 5. Change rating

2004-01-24

381 reads

Technical Article

UDF For Extracting Actual Time From Two DateTime

  • Script

Hi guys,       I have created a script of User-Defined-Function to extract the calulated time from two given datetime inputs. But you have to pass THREE parameters like :-a)Start Datetimeb)End Datetimec)To display the format either in HH:MM:SS or HH.MM , we    use 'T'(HH:MM:SS) OR 'N'(HH.MM).   Please feel FREE to E-mail me at […]

You rated this post out of 5. Change rating

2004-01-14

128 reads

Technical Article

Generate Random Alphanumeric Strings

  • Script

This script will generate and populate a table variable with a stipulated number of unique 8 randomly generated character alphanumeric values. This can be useful in situations where one has to allocate passwords or unique id to users. It accepts one input parameter "@HowMany int" representing the number of these alphanumeric values to generate; default=500.Usage: […]

You rated this post out of 5. Change rating

2004-07-06 (first published: )

3,004 reads

Technical Article

Generating random numbers in a range, sql2k

  • Script

This script will generated random numbers within a choosen Upper and LowerBound. I'v created a random number (int's) generator since i couldnt find a script which exactly did what I was searching for. The RAND function seems to do repetive patterns, so i created a new function based on the NEWID function.After running the two […]

You rated this post out of 5. Change rating

2004-10-08 (first published: )

370 reads

Technical Article

Find Overlapping Jobs

  • Script

Script lists all overlapping jobs that ran on selected server within last @Hoursback hours.Basically, idea behind this is to find jobs that are running at the same time, because that might significantly slow down server, especially if you have jobs that are running during business hours. You can do the same by looking into Jobs […]

5 (3)

You rated this post out of 5. Change rating

2004-01-02

1,148 reads

Blogs

Friday Basics: the CIA Triad

By

In information security (INFOSEC), there several foundational concepts and principles. One of the ones...

A New Word: the standard blues

By

the standard blues– n. the dispiriting awareness that the twists and turns of your...

How Redgate Flyway Can Boost Your DevOps Journey

By

A brief introduction to the tool and its advantages for database migrations DevOps is...

Read the latest Blogs

Forums

client_app_name is empty in Extended Events output but present in sp_who2

By Pete Bishop

I'm tracing activity on one database and would like to include the client_app_name in...

How to compare data in customer table with other customers to find related cust

By Zond Sita

select Custno, Addr1, City, Res_Phone, Bus_Phone, Fax_Phone, Marine_Phone, Pager_Phone, Other_Phone, email1, email2 from customer...

process records in loop

By Bruin

I'm only processing 50,000 records not everything from the Table where there are 250,00...

Visit the forum

Question of the Day

The Marked Transaction

I want to mark a transaction in the log as a recovery point. How do I do this in my code if I use the transaction, myTran?

See possible answers