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,976 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,477 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

805 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

Query Intelligence in SQL Server 2025: What Developers Need to Know

By

When Microsoft announced SQL Server 2025, I was curious about what would truly change...

Finding and Killing Blockers with Redgate AI Tech

By

Redgate has a research arm, called the Foundry, that has been experimenting with AIs...

Back at Small Data SF in 2025

By

Today I’m in San Francisco at Small Data SF 2025. I went to the...

Read the latest Blogs

Forums

Large posts full of code not allowed anymore?

By Lowell

Several times now, I've seen a post asking for a solution. I've replied, and...

Data > Hype

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Data > Hype

Create and Read the Analysis Services Flight Recorder

By Pablo Echeverria

Comments posted to this topic are about the item Create and Read the Analysis...

Visit the forum

Question of the Day

Slipstream parameters

What parameters are needed to enable a slipstream installation for setup.exe (SQL Server setup)?

See possible answers