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,307 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: )

593 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: )

192 reads

Blogs

THAT Conference 2024 in Wisconsin Dells

By

I’m headed back to Wisconsin Dells next week for THAT! Conference 2024. This is...

7 Best Online Advanced SQL Training Courses to Learn in 2024

By

The world runs on data, and SQL is the key to unlocking its secrets....

Calling a REST Endpoint from Azure SQL DB

By

External REST endpoint invocation in Azure SQL DB went GA in August 2023. Whereas...

Read the latest Blogs

Forums

Issues adding and updating a column

By richardmgreen1

Hi all   I'm hoping someone will able to say "you're an idiot because....."...

Deadlocks with UPDATE statements using serializable transaction isolation level

By zoggling

We are seeing frequent deadlocks occurring due to a particular stored procedure that is...

Use Polybase with ODBC to create external table

By blom0344

I'm trying to use the installed Polybase service on an  SQL 2019 server to...

Visit the forum

Question of the Day

The Last DBCC Date

How can I easily get the last DBCC CheckDB date from T-SQL in SQL Server 2022?

See possible answers