Question : smallmoney to money datatype

I have a asp web prgram that was written for sql using a key called TIMEID.  It is a time clock program and every entry recorded has a timeid with a time punch.  It stopped working yesterday and through my troubleshooting I discovered the developer used smallmoney as the datatype for the timeid field.  It reached its maximum number yesterday (214748.00) and the program gives me this message  --Microsoft OLE DB Provider for ODBC Drivers error '80040e57'
[Microsoft][ODBC SQL Server Driver][SQL Server]Arithmetic overflow error converting expression to data type smallmoney.
/stimegreeting.asp, line 96

Can I simply change the column TIMEID to a money type?  How will that affect my program.  Here is the create script for the table? If I could do this, what would the alter statement be?
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
CREATE TABLE [dbo].[TimeSheet](
	[timeID] [smallmoney] NOT NULL,
	[ActivityDate] [smalldatetime] NULL,
	[CliID] [int] NULL,
	[HID] [int] NULL,
	[ClientName] [varchar](255) NULL,
	[CurrentStatus] [smallint] NULL CONSTRAINT [DF__TimeSheet__Curre__4AB81AF0]  DEFAULT ((0)),
	[STATUS_IN] [smallint] NULL CONSTRAINT [DF__TimeSheet__STATU__4BAC3F29]  DEFAULT ((0)),
	[STATUS_OUT] [smallint] NULL CONSTRAINT [DF__TimeSheet__STATU__4CA06362]  DEFAULT ((0)),
	[STATUS_MEETING] [smallint] NULL CONSTRAINT [DF__TimeSheet__STATU__4D94879B]  DEFAULT ((0)),
	[STATUS_CONF] [smallint] NULL CONSTRAINT [DF__TimeSheet__STATU__4E88ABD4]  DEFAULT ((0)),
	[STATUS_LUNCH] [smallint] NULL CONSTRAINT [DF__TimeSheet__STATU__4F7CD00D]  DEFAULT ((0)),
	[STATUS_OFF] [smallint] NULL CONSTRAINT [DF__TimeSheet__STATU__5070F446]  DEFAULT ((0)),
	[STATUS_VAC] [smallint] NULL CONSTRAINT [DF__TimeSheet__STATU__5165187F]  DEFAULT ((0)),
	[Back_At] [varchar](15) NULL,
	[STATUS_MSG] [varchar](80) NULL,
	[OooReason] [smallint] NULL CONSTRAINT [DF_TimeSheet_OooReason]  DEFAULT ((0)),
	[tssAddDate] [smalldatetime] NULL,
	[tssCreateUser] [int] NULL,
 CONSTRAINT [PK__TimeSheet__49C3F6B7] PRIMARY KEY CLUSTERED 
(
	[timeID] 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
SET ANSI_PADDING OFF
Open in New Window Select All

Answer : smallmoney to money datatype

I forgot to add the ALTER TABLE statements.

Greg


1:
2:
3:
4:
5:
ALTER TABLE TimeSheet DROP CONSTRAINT [PK__TimeSheet__49C3F6B7]
 
ALTER TABLE TimeSheet ALTER COLUMN TimeID MONEY NOT NULL
 
ALTER TABLE TimeSheet ADD CONSTRAINT [PK__TimeSheet__49C3F6B7] PRIMARY KEY CLUSTERED (TimeID ASC)
Open in New Window Select All
Random Solutions  
 
programming4us programming4us