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

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

188 reads

Blogs

How Long Will It Take to Learn SQL? The Truth Might Surprise You

By

In today's data-driven world, SQL (Structured Query Language) is a blazing-hot skill. It's your...

Flying Halfway Around the World to Australia

By

I leave tonight for Australia. I was in London 3 days ago, so this...

Dealing with Change – Two Resources

By

As I look at the state of information technology today, I see one constant:...

Read the latest Blogs

Forums

SSIS Execution Error

By Wecks

I am no SSIS expert and am struggling here I am hoping some of...

Pivot query

By Roust_m

Hi, I have the following table: CREATE TABLE [dbo].[UnitProdFinal]( [YearMonth] [int] NULL, [SerialNumber] [varchar](50)...

Table with FK(s) to other columns within the table

By BOR15K

Hello All, I have recently joined a project, where main, core tables with millions...

Visit the forum

Question of the Day

Using Table Hints in a Query

How many table hints can I include in a query?  

See possible answers