SQLInsider Scripts

Technical Article

A Simply way to implement Audit Trail in SQL 2005

  • Script

In a recent project, I need to record audit trail for some tables (for Insert, Update and Delete).Using SQL 2005's XML datatype and the XML support it is very covenienet to use triggers to perform the audit trail requirement. I create one table (Table_Audit)  to hold all audit trial data. One stored procedure is created […]

5 (2)

You rated this post out of 5. Change rating

2007-09-20

3,306 reads

Technical Article

Get Foreign Key of all the tables for Sqlserver DB

  • Script

This script will create two views and select the data from the TableReferences view. This view will give list of all the foreignkeys of the selected database with its constraint name, the table name and column name(s) on which the constraint is created and the referencing table name and column name(s).

5 (2)

You rated this post out of 5. Change rating

2006-09-25 (first published: )

591 reads

Technical Article

IP Numeric To String

  • Script

A user defined function that converts an integer value to an IP address in dot notation format. This is performed by promoting a 32 bit signed integer value to a signed 64 bit bigint and converted to a binary representation of the integer. The purpose of this script is to allow the storage of an […]

You rated this post out of 5. Change rating

2005-11-01 (first published: )

189 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

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...

get all txt files $filenameAndPath = code please help

By juliava

Hello I need to get txt files from directory and send email, when I...

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