Miscellaneous

Technical Article

Pad Number

  • Script

A simple UDF for padding out numbers with a specific character (eg: pad 3 to show as 003).Usefull when you can only sort as a text item or for formatting purposes.Script is similar to the SPACE() function but allow the padding character to be defined.Usage:dbo.padNumber('string to pad', padsize, padchar)eg:SELECT dbo.padNumber('53', 4, '0') as testNumReturns:testNum-------0053

You rated this post out of 5. Change rating

2003-07-25

201 reads

SQLServerCentral Article

Finding and Deleting Duplicate Data

  • Article

Bad data is almost a given, but true duplicate data can really cause you some headaches. How do you remove all the duplicates and still leave a 'keeper' record? If you think procedural code it's not too hard, but can you do a set based solution? Chris shows you show!

4.9 (10)

You rated this post out of 5. Change rating

2003-07-25

19,973 reads

Technical Article

Zip Code Radius Search

  • Script

Enter the starting zip code and the number of miles for a radius search and the SP will return all the zip codes within the number of miles specified.The data file can be found at http://www.census.gov/tiger/tms/gazetteer/zips.txtThe record layout van be found at http://www.census.gov/tiger/tms/gazetteer/zip90r.txt

You rated this post out of 5. Change rating

2003-07-24

2,466 reads

Technical Article

Generic paged data like MySQL LIMIT

  • Script

This works, however code is creating a live temp_1 table in the database instead of using a #temp_1 temporary table because is just would not work.The next idea I had was to use a unique table name per connection for temp_1, but I would really rather use temporary tables.I am hoping some SQL guru's can […]

You rated this post out of 5. Change rating

2003-07-22

129 reads

Technical Article

An alternative to self-joins

  • Script

Oftentimes there is a need to retrieve different types of the same object (e.g. contacts).  For example, in a Contacts database, you might have a Contact table containing many different types of contacts (employees, customers, suppliers, etc).  Typically, a user might need to see a report of all different types of contacts for an order […]

You rated this post out of 5. Change rating

2003-07-18

787 reads

Technical Article

Check if someone use a database or not

  • Script

I manage quite a few hundred databases across the company. Time to time I get a question if I can check wheather a database is beeing used or not, and if it is, by whom?There are probably a 1000 ways to do this, but I've created a script for creating a scheduled job that runs […]

You rated this post out of 5. Change rating

2003-07-15

2,655 reads

Blogs

Troubleshooting SQL Server – Starting with the Error Log

By

We’ve all been there. Someone walks up and asks, “Is SQL Server having issues?”...

From OLTP to Analytics: Bridging the Gap with Modern SQL Architectures

By

In the beginning, there was OLTP – Online Transaction Processing. Fast, reliable, and ruthlessly...

Free Online Sessions – Building the €100 DWH and Indexing for Dummies

By

I’m giving two online sessions soon on virtual events that are free to attend....

Read the latest Blogs

Forums

The Security of Old Tech

By Steve Jones - SSC Editor

Comments posted to this topic are about the item The Security of Old Tech

Revisiting SQL Server Window Functions- A Practical Walkthrough

By Chandan Shukla

Comments posted to this topic are about the item Revisiting SQL Server Window Functions-...

Tables with a SPARSE Column and Consumption

By dbakevlar

Comments posted to this topic are about the item Tables with a SPARSE Column...

Visit the forum

Question of the Day

Tables with a SPARSE Column and Consumption

True or False:  Tables with a SPARSE column consume more space than regular columns if most values are NOT NULL.

See possible answers