T-SQL

Technical Article

TextToDecimal

  • Script

SUMMARY:This UDF script takes a text value(nvarchar) and returns a decimal(18,6) number. If the text value can't be interpreted as numeric, the UDF returns NULL.-----------------------------------------------USAGE: SET @MyDecimal = dbo.TextToDecimal('-$123,456.73')@MyDecimal will now be -123456.730000SET @MyDecimal = dbo.TextToDecimal('-$123,4560.73') --bad number format@MyDecimal will now be NULL------------------------------------------------------DESCRIPTION:The ISNUMERIC function incorrectly returns 1 (True) for many non-numeric text values. Even […]

5 (1)

You rated this post out of 5. Change rating

2005-11-02 (first published: )

185 reads

Technical Article

Add users to Windows NT Group

  • Script

This scripts adds the users to the specified Windows NT Group.This will be helpful if we want to give the access to group of users to a sql server, which is runing with Windows Authentication. Create a NT group and give the access on SQL and run this script it adds the user into the […]

You rated this post out of 5. Change rating

2005-10-10 (first published: )

465 reads

Technical Article

List of Indexes and indexed columns in a Database

  • Script

This scripts creates a view which will returns all the indexes and columns covered in the index for all the tables in a database.It returns only the user created indexes. Removes the statistics created on table (where indid > 0).

You rated this post out of 5. Change rating

2005-08-24 (first published: )

192 reads

Blogs

Redgate Summit Comes to the Windy City

By

I love Chicago. I went to visit three times in 2023: a Redgate event,...

Non-Functional Requirements

By

I have found that non-functional requirements (NFRs) can be hard to define for a...

Techorama 2024 – Slides

By

You can find the slidedeck for my Techorama session “Microsoft Fabric for Dummies” on...

Read the latest Blogs

Forums

Change IN for EXSITS

By Edvard Korsbæk

I have had a hard time to understand how to use EXISTS. I Always...

Error while an ADF pipeline runs stored procedures against Azure SQL Server MI

By river1

Dears, We are using Azure Data factory pipes to run some stored procedures against...

Clear Trace - Asking for SQL Server 2008

By rameshbabu.chejarla

Hi, I have SQL Server 2019 installed and when go the Clear Trace database...

Visit the forum

Question of the Day

The "ORDER BY" clause behavior

Let’s consider the following script that can be executed without any error on both SQL Sever and PostgreSQL. We define the table t1 in which we insert three records:

create table t1 (id int primary key, city varchar(50));

insert into t1 values (1, 'Rome'), (2, 'New York'), (3, NULL);
If we execute the following query, how will the records be sorted in both environments?
select city

from t1

order by city;

See possible answers