Click here to Skip to main content
15,900,461 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
SQL
create table tbl_Employee_payment(
Emp_id int foreign key references tbl_EmployeeMast(Emp_id),
paymentdate date,
Empl_name varchar(300),
designation varchar(100),
salary decimal(5,2),
advance_amnt decimal(5,2),
sale_of_month decimal(5,2),
bonus_amnt decimal(5,2),
payment_mode varchar(100),
payment_detail  varchar(max),
payment_amnt decimal (4,3)
)


What I have tried:

insert into tbl_Employee_payment values(1,'2016-02-09','javeer','sss',1000,355.00,11,111.00,'online','transfered',645)
Posted
Updated 25-Feb-16 11:23am

Hi Friend,
SQL
create table tbl_Employee_payment(
Emp_id int foreign key references tbl_EmployeeMast(Emp_id),
paymentdate date,
Empl_name varchar(300),
designation varchar(100),
salary decimal(16,2),
advance_amnt decimal(16,2),  
sale_of_month decimal(16,2),  
bonus_amnt decimal(16,2),     
payment_mode varchar(100),
payment_detail  varchar(max),
payment_amnt decimal (16,3)  
)



Change your decimal range to decimal(16,2) in all columns where you are using decimal datatype . hope this will help. thanks..
 
Share this answer
 
Comments
Member 12270370 10-Feb-16 6:48am    
Thanks Sir Its Working thanks u again..............
The example insert statement would have been run with no problem.

Probably, you were trying to insert a value which is more than the defined datatype can handle in some other statement.

A decimal(5,2) can handle maximum 5 digits in total (left + right side of the decimal point) and 2 digits to the right side of the decimal point. Have a quick look at:

decimal and numeric (Transact-SQL)[^]

-dp-
 
Share this answer
 
v3

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