SQLInsider Scripts

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)

2007-09-20

3,300 reads

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)

2006-09-25 (first published: )

587 reads

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 […]

2005-11-01 (first published: )

183 reads

Blogs

WIT Mental Health and Wellness Videos Posted

By

I was honored to speak at the WIT Mental Health and Wellness day last...

Daily Coping 13 May 2021

By

I started to add a daily coping tip to the SQLServerCentral newsletter and to...

#PowershellBasics: Comments and comment based help

By

I’ve talked about SQL Server comments before and how important they are. In PowerShell...

Read the latest Blogs

Forums

Limit database restores to specific drive locations

By DrJogalog

As there isn't an option to use a DDL trigger on a RESTORE query,...

VLOOKUP Equivalent in SQL

By Sarah1997

Hi there I have two tables, one with an ID and Amount (Table 1)...

The Gift of Asking Stupid Questions

By Steve Jones - SSC Editor

Comments posted to this topic are about the item The Gift of Asking Stupid...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers

Question of the Day

Container Logs

See possible answers