ComfortablyNumb
asked on
TSQL Insert With Just Default Values
Hi Experts,
Don't know if this is possible. Have a table with just an ID and datetime so both are set with defaults.
All I want to do is to increment the table with a record every time a particular web page is reached.
So how do you write the INSERT statement without any passed values?
Regs,
Numb
Don't know if this is possible. Have a table with just an ID and datetime so both are set with defaults.
CREATE TABLE [dbo].[tb_ErrorLog](
[errorLogID] [int] IDENTITY(1,1) NOT NULL,
[errorLogDate] [datetime] NOT NULL,
CONSTRAINT [PK_tb_ErrorLog] PRIMARY KEY CLUSTERED
(
[errorLogID] 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].[tb_ErrorLog] ADD CONSTRAINT [DF_tb_ErrorLog_errorLogDate] DEFAULT (getdate()) FOR [errorLogDate]
GO
All I want to do is to increment the table with a record every time a particular web page is reached.
So how do you write the INSERT statement without any passed values?
Regs,
Numb
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
As simple as that! cheers
([errorLogDate])
VALUES
(default)