![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
I have an audit table which includes some columns with defaults based on system functions - but these do not always work.. table definition.. CREATE TABLE dbo.Audithistory ( event_time datetime NOT NULL DEFAULT getdate(), event_type int NOT NULL, dbname varchar(10) NOT NULL DEFAULT db_name(), severity integer NOT NULL, event_details varchar(500) NOT NULL, machine varchar(15) NULL DEFAULT host_name(), [systemuser] varchar(15) NULL DEFAULT system_user, CONSTRAINT PK_Audithistory PRIMARY KEY CLUSTERED ( event_time ) ) GO column machine [based on host_name()] is generally null. I was also previously having problems with the user and suser_name() functions (i was only expecting one to fire not both), but I'll see what happens with system_user If you have any ideas why this is happenning, I'm all ears.. Many thanks in advance, Andy |
#2
| |||
| |||
|
|
I have an audit table which includes some columns with defaults based on system functions - but these do not always work.. table definition.. |
|
column machine [based on host_name()] is generally null. |
|
I was also previously having problems with the user and suser_name() |
![]() |
| Thread Tools | |
| Display Modes | |
| |