本文介绍了在Hijri约会工作......面临错误...... plzzz帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个G-date n Hijri-date的表,
其中我在d表中将这些col作为varchar(10)数据类型。
我的存储过程:
USE [RAS]
GO
/ ******对象:StoredProcedure [dbo]。 [Sp_InsertEmployee]脚本日期:02/12/2014 17:26:49 ****** /
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROC [dbo]。[Sp_InsertEmployee]
(
@Branchcode int
,@ Joinningdate date
,@ Empname nvarchar(50)
,@ IqamaExp varchar( 10)
,@ IqamaExpArabic varchar(10)
)
- Sp_InsertEmployee 1,null,null,1,1,1,1,null,'02 / 02 / 2014','02/02/1435',null,null,null,null,null,null,null,null,null,null,null,null,null,null,1
AS BEGIN
INSERT INTO [RAS]。[dbo]。[tbl_Employee]
([Branchcode]
,[Joinningdate]
,[Position]
,[IqamaExp]
,[IqamaExpArabic]
)
VALUES
(
@Branchcode
,@ Joinningdate
,@ Empname
,convert(varchar(10),@ IqamaExp,101)
,转换(varchar(10),@ IqamaExpArabic,101)
)
END
打印CONVERT(datetime,@ IqamaExp ,101)
打印CONVERT(datetime,@ IqamaExpArabic,101)
结果:
(1行受影响)
2014年2月2日12:00 AM
消息242,等级16,状态3,过程Sp_InsertEmployee,第91行
将varchar数据类型转换为日期时间数据类型导致超出范围的值。
当我将它插入d storedprocedure时,它显示我这个错误..
但是,如果我从asp.net调用它页面...显示转换日期/时间错误...
plz ...帮帮我
解决方案
i have a table with G-date n Hijri-date,
where i have these col as varchar(10) datatype in d table.
my stored procedure:
USE [RAS] GO /****** Object: StoredProcedure [dbo].[Sp_InsertEmployee] Script Date: 02/12/2014 17:26:49 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROC [dbo].[Sp_InsertEmployee] ( @Branchcode int ,@Joinningdate date ,@Empname nvarchar(50) ,@IqamaExp varchar(10) ,@IqamaExpArabic varchar(10) ) -- Sp_InsertEmployee 1,null,null,1,1,1,1,null,'02/02/2014','02/02/1435',null,null,null,null,null,null,null,null,null,null,null,null,null,null,1 AS BEGIN INSERT INTO [RAS].[dbo].[tbl_Employee] ([Branchcode] ,[Joinningdate] ,[Position] ,[IqamaExp] ,[IqamaExpArabic] ) VALUES ( @Branchcode ,@Joinningdate ,@Empname ,convert(varchar(10),@IqamaExp, 101) ,convert(varchar(10),@IqamaExpArabic, 101) ) END print CONVERT(datetime,@IqamaExp, 101) print CONVERT(datetime,@IqamaExpArabic, 101)
result:
(1 row(s) affected) Feb 2 2014 12:00AM Msg 242, Level 16, State 3, Procedure Sp_InsertEmployee, Line 91 The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.
when i'm insert it in d storedprocedure, its showing me this error..
but, if i call this from asp.net page... its showing converting date / time error...
plz ... help me
解决方案
这篇关于在Hijri约会工作......面临错误...... plzzz帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!