• Good article. Updating the SQLServerName column could just as easily be updated in real-time through a default constraint:

    CREATE TABLE [dbo].[ErrLogData](

    [LogId] [int] IDENTITY(1,1) NOT NULL,

    [LogDate] [datetime] NULL,

    [ProcessInfo] [nvarchar](50) NULL,

    [LogText] [nvarchar](4000) NULL,

    [SQLServerName] [nvarchar](150) NOT NULL,

    PRIMARY KEY CLUSTERED

    (

    [LogId] ASC

    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]

    ) ON [PRIMARY]

    GO

    ALTER TABLE [dbo].ErrLogData] ADD CONSTRAINT [DF_dbo_ErrLogData_SQLServerName] DEFAULT (@@servername) FOR [SQLServerName]

    GO

    This way you could set up an SSIS job to loop through your more critical instances.


    James E Bothamley
    Sr DBA
    Supreme Court of Wyoming
    JBothamley@Courts.State.WY.US
    JamesBothamley@Wyoming.Com

    "Once in a while you can get shown the light
    in the strangest of places if you look at it right"

    JG 1942-1995 RIP