初学sqlserver问一个存储过程的问题

musicfree_uibe 2003-12-26 02:50:53
存储过程中有参数为datetime和bit类型的,请问怎么调用这个存储过程呢?
我写
exec proc_name 2002-10-10,1
好像不行唉:(请帮帮忙!!!谢谢
...全文
72 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
zjcxc 元老 2003-12-26
  • 打赏
  • 举报
回复
exec FB_PrcInsertStudentProfile 1,2,'3','4'
,5,6,'7',8,9
,'10',11,12,'13',14
,1,'2002-10-10'
,1,'1818','19',1
,'20','21'

,'1999-01-01' --这里原来与下面的交换了.
,'22'

,'24','25','26',27
,'28','29','30','31','32','33',34
,'35','36','37','38','39','40','41'
musicfree_uibe 2003-12-26
  • 打赏
  • 举报
回复
解决!谢谢!
wzh1215 2003-12-26
  • 打赏
  • 举报
回复
'1999-01-01'
写错了位置,仔细检查一下!
erigido 2003-12-26
  • 打赏
  • 举报
回复
'2002-10-10'
写错位置了。
musicfree_uibe 2003-12-26
  • 打赏
  • 举报
回复
贴错了存储过程应该是:
create procedure FB_PrcInsertStudentProfile
@RS_learningCenter integer,
@RS_batch integer,
@RS_signUpMethod nchar(20),
@RS_signUpSchool1 nchar(80),
@RS_signUpSchool1Major1 integer,
@RS_signUpSchool1Major2 integer,
@RS_signUpSchool2 nchar(80),
@RS_signUpSchool2Major1 integer,
@RS_signUpSchool2Major2 integer,
@RS_signUpSchool3 nchar(80),
@RS_signUpSchool3Major1 integer,
@RS_signUpSchool3Major2 integer,
@RS_signUpRemark nchar(400),
@RS_addType integer,
@RS_preparatory bit,
@RS_preparatoryTime datetime,
@RS_additionTest bit,
@RS_photo nchar(50),
@RS_name nchar(20),
@RS_gender bit,
@RS_folk nchar(10),
@RS_political nchar(14),
@RS_birthday datetime,
@RS_level nchar(8),
@RS_cardType char(10),
@RS_cardID nchar(30),
@RS_huKou nchar(16),
@RS_provience integer,
@RS_city nchar(20),
@RS_address nchar(80),
@RS_zip char(6),
@RS_nativePlace nchar(40),
@RS_email nchar(30),
@RS_tel nchar(20),
@RS_mobile integer,
@RS_job nchar(20),
@RS_company nchar(30),
@RS_foreignLanguage nchar(16),
@RS_postSchool nchar(80),
@RS_postMajor nchar(20),
@RS_certificateID nchar(20),
@RS_eduRemark nchar(200)

as
insert into FB_OrecruitStudents

values
(
@RS_learningCenter,
@RS_batch,
@RS_signUpMethod,
@RS_signUpSchool1,
@RS_signUpSchool1Major1,
@RS_signUpSchool1Major2,
@RS_signUpSchool2,
@RS_signUpSchool2Major1,
@RS_signUpSchool2Major2,
@RS_signUpSchool3,
@RS_signUpSchool3Major1,
@RS_signUpSchool3Major2,
@RS_signUpRemark,
@RS_addType,
@RS_preparatory,
@RS_preparatoryTime,
@RS_additionTest,
@RS_photo,
@RS_name,
@RS_gender,
@RS_folk,
@RS_political,
@RS_birthday,
@RS_level,
@RS_cardType,
@RS_cardID,
@RS_huKou,
@RS_provience,
@RS_city,
@RS_address,
@RS_zip,
@RS_nativePlace,
@RS_email,
@RS_tel,
@RS_mobile,
@RS_job,
@RS_company,
@RS_foreignLanguage,
@RS_postSchool,
@RS_postMajor,
@RS_certificateID,
@RS_eduRemark
);
erigido 2003-12-26
  • 打赏
  • 举报
回复
exec proc_name '2002-10-10',1
这样就可以了,出现什么问题了?
musicfree_uibe 2003-12-26
  • 打赏
  • 举报
回复
测试时我用:
exec FB_PrcInsertStudentProfile 1,2,'3','4',5,6,'7',8,9,'10',11,12,'13',14,1,'2002-10-10',1,'1818','19',1,'20','21','22','1999-01-01','24','25','26',27,'28','29','30','31','32','33',34,'35','36','37','38','39','40','41'
总是抱错:
服务器: 消息 8114,级别 16,状态 4,过程 FB_PrcInsertStudentProfile,行 0
将数据类型 varchar 转换为 datetime 时出错。
zjcxc 元老 2003-12-26
  • 打赏
  • 举报
回复
exec proc_name '2002-10-10',1
musicfree_uibe 2003-12-26
  • 打赏
  • 举报
回复
create procedure FB_PrcInsertStudentProfile
@RS_ID INTEGER,
@RS_learningCenter integer,
@RS_batch integer,
@RS_signUpMethod nchar(20),
@RS_signUpSchool1 nchar(80),
@RS_signUpSchool1Major1 integer,
@RS_signUpSchool1Major2 integer,
@RS_signUpSchool2 nchar(80),
@RS_signUpSchool2Major1 integer,
@RS_signUpSchool2Major2 integer,
@RS_signUpSchool3 nchar(80),
@RS_signUpSchool3Major1 integer,
@RS_signUpSchool3Major2 integer,
@RS_signUpRemark nchar(400),
@RS_addType integer,
@RS_preparatory bit,
@RS_preparatoryTime datetime,
@RS_additionTest bit,
@RS_photo nchar(50),
@RS_name nchar(20),
@RS_gender bit,
@RS_folk nchar(10),
@RS_political nchar(14),
@RS_birthday datetime,
@RS_level nchar(8),
@RS_cardType char(10),
@RS_cardID nchar(30),
@RS_huKou nchar(16),
@RS_provience integer,
@RS_city nchar(20),
@RS_address nchar(80),
@RS_zip char(6),
@RS_nativePlace nchar(40),
@RS_email nchar(30),
@RS_tel nchar(20),
@RS_mobile integer,
@RS_job nchar(20),
@RS_company nchar(30),
@RS_foreignLanguage nchar(16),
@RS_postSchool nchar(80),
@RS_postMajor nchar(20),
@RS_certificateID nchar(20),
@RS_eduRemark nchar(200)

as
insert into FB_OrecruitStudents

values
(

@RS_ID,
@RS_learningCenter,
@RS_batch,
@RS_signUpMethod,
@RS_signUpSchool1,
@RS_signUpSchool1Major1,
@RS_signUpSchool1Major2,
@RS_signUpSchool2,
@RS_signUpSchool2Major1,
@RS_signUpSchool2Major2,
@RS_signUpSchool3,
@RS_signUpSchool3Major1,
@RS_signUpSchool3Major2,
@RS_signUpRemark,
@RS_addType,
@RS_preparatory,
@RS_preparatoryTime,
@RS_additionTest,
@RS_photo,
@RS_name,
@RS_gender,
@RS_folk,
@RS_political,
@RS_birthday,
@RS_level,
@RS_cardType,
@RS_cardID,
@RS_huKou,
@RS_provience,
@RS_city,
@RS_address,
@RS_zip,
@RS_nativePlace,
@RS_email,
@RS_tel,
@RS_mobile,
@RS_job,
@RS_company,
@RS_foreignLanguage,
@RS_postSchool,
@RS_postMajor,
@RS_certificateID,
@RS_eduRemark
);
musicfree_uibe 2003-12-26
  • 打赏
  • 举报
回复
奇怪了:(我把我的代码贴出来吧:(
txlicenhe 2003-12-26
  • 打赏
  • 举报
回复
exec proc_name '2002-10-10',1
wzh1215 2003-12-26
  • 打赏
  • 举报
回复
exec proc_name '2002-10-10',1

34,594

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧