Click here to Skip to main content
15,890,690 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have set datetime column in sql defaultly getdate() but i have goto insert a row it will be show the Error is
SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59
I cant understood this any body help me please
Posted
Comments
Rob Philpott 12-Feb-15 12:02pm    
The error is quite explicit. Please provide some sample SQL, it's unclear what you are trying to describe.
CHill60 12-Feb-15 12:09pm    
Please do not repost the same question. You were asked to supply the SQL you are using by members responding to your first post. How do you expect us to help you if you will not supply the information we need?

1 solution

Odd - I just checked it using my system, and it works fine:
SQL
USE [Testing]
GO

/****** Object:  Table [dbo].[Users]    Script Date: 02/12/2015 17:28:32 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[Users](
	[id] [int] IDENTITY(1,1) NOT NULL,
	[Email] [nvarchar](max) NOT NULL,
	[dt] [datetime] NOT NULL
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[Users] ADD  CONSTRAINT [DF_User_dt]  DEFAULT (getdate()) FOR [dt]
GO

id	Email	dt
1	MyUser	2015-02-12 17:27:48.127

So what am I doing that differs from you?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900