T-SQL

SQLServerCentral Article

When To Use the Order By Clause

  • Article

The ORDER BY clause is one of the basic keywords that defines the SQL Language. And it can help prevent strange results from being returned to the average user. Read on to see how and why this addition to your queries can help ensure more "ordered" results πŸ™‚

β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜…

(2)

You rated this post out of 5. Change rating

2004-05-19

11,526 reads

Technical Article

Foreign keys chain in a view. It may be useful.

  • Script

I made this view because I had to generate a sql server database fromΒ  an Oracle database and I had to knew the order in which I import tables.This view, which may be improved, contains the foreign key, the primary and detail table, the column and it's position and may be useful inΒ  many situations

β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜…

You rated this post out of 5. Change rating

2004-08-25 (first published: )

110 reads

Technical Article

Get all Tables and Columns for each Database

  • Script

This script will get the name of each database from master..sysdatabases, then use each database's Information Schemata to get the tables and columns in each of the databases. Several recent requests for assistance have used this to answer their needs. I ran it across 245 databases and pulled back 1.4 million results in about 30 […]

β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜…

(1)

You rated this post out of 5. Change rating

2004-04-15

1,336 reads

Technical Article

SP to search String in TEXT of SPs

  • Script

Well this is an addendum to my earlier post for searching a specific string in all the Stored Procedures defined in a database and returning the name of the stored procedure in which it is contained. This is optimized based on suggestion of Greg and I thank him for his advise.

β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜…

(1)

You rated this post out of 5. Change rating

2004-04-09

510 reads

Technical Article

SP to find text in code objects in all user db's.

  • Script

This script creates a stored procedure which helps to find text in all of your code objects in all your databases. It searches the code of SP's, UDF's, views, triggers, and it searches in all databases.Output is a result set with DbName, ObjectName and ObjectType.Advantages are- works reliable also with source codes longer than 4000 […]

β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜…

You rated this post out of 5. Change rating

2004-03-31

278 reads

Technical Article

Search For SPs which contain a specific String.

  • Script

This Stored Procedure is for Searching all the user defined Stored Procedures in a database for the existence of a specified string . This is especially useful when you have changed some Column name and want to Find the Column Name in all the Stored Procedures where it is used, so it will return you […]

β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜…

You rated this post out of 5. Change rating

2004-03-26

835 reads

Technical Article

Function to Return Age of a Person

  • Script

This Function is a small script to retrieve the age of personΒ  based on date of birth to a particular date.Eg.select dbo.GetDateofbirth ('01/01/1975',GETDATE())RETURNS29Years 2Months 24DaysΒ  that is the age.TESTED only on SQLSERVER 2000

β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜…

(1)

You rated this post out of 5. Change rating

2004-03-25

399 reads

Technical Article

Function To Retrieve Last Index

  • Script

This Function Enables the user to retrieve the Last Index of the character/string in a predetermined string.Eg If you want search for the Last Occurance of 'SQL' in 'SQL SERVER2000 USES ANSI SQL' thenSELECT dbo.LastIndexOf('SQL SERVER2000 USES ANSI SQL','SQL')will return 26.Tested Only in SQL SERVER2000

β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜… β˜…

(3)

You rated this post out of 5. Change rating

2004-03-25

2,807 reads

Blogs

Using Prompt AI for a Travel Data Analysis

By

I was looking back at my year and decided to see if SQL Prompt...

FinOps for Kubernetes: Leveraging OpenCost, KubeGreen, and Kubecost for Cost Efficiency

By

In the era of cloud-native applications, Kubernetes has become the default standard platform for...

2025 Wrapped for Steve

By

I’ve often done some analysis of my year in different ways. Last year I...

Read the latest Blogs

Forums

The North Star for the Year

By Steve Jones - SSC Editor

Comments posted to this topic are about the item The North Star for the...

Multiple Escape Characters

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Multiple Escape Characters

reaching ftp thru winscp but erroring in ssis ftp task connection

By stan

Hi, below i show various results trying to reach our ftp site (a globalscape...

Visit the forum

Question of the Day

Multiple Escape Characters

In SQL Server 2025, I run this code (in a database with the appropriate collation):

SELECT UNISTR('%*3041%*308A%*304C%*3068 and good night', '%*') AS 'A Classic';
What is returned?

See possible answers