日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

遇到一个sql2000的问题,实在搞不懂了,求解决的办法?

發布時間:2024/4/17 编程问答 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 遇到一个sql2000的问题,实在搞不懂了,求解决的办法? 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

我的SQl語句,其實很簡單的,但是就是錯誤,沒辦法了!

Code
if?exists?(select?top?1?*?from?sysobjects?where?name?='HMonthOtherTotal'?and?xtype?=?'U')
drop?table?HMonthOtherTotal
Go
Create?table?HMonthOtherTotal
(
PKID?
int?primary?key?identity(1,1),
UnitID?
int,
YearMonth?
nvarchar(12),
Type1?
int?default?0,
Type2?
int?default?0,
Type3?
int?default?0,
Type4?
int?default?0
--constraint?MonthID?unique?(YearMonth)

)
Go

if?exists?(select?*?from?sysobjects?where?xtype?='p'?and?name?='HMonthOtherTotal_Insert'?)
Drop?procedure?HMonthOtherTotal_Insert
Go
create?procedure?HMonthOtherTotal_Insert
(
@PKID?int?output,
@UnitID?int,
@YearMonth?nvarchar(12),
@Type1?int,--制止行人、非機動車違章上路(人?輛/次):
@Type2?int,--糾正車輛違章(輛/次):
@Type3?int,--施工安全管理(處/起):
@Type4?int??--其它:
)
As
/*Insert?into?HMonthOtherTotal?(UnitID,YearMonth,Type1,Type2,Type3,Type4)
values?(@UnitID,@YearMonth,@Type1,@Type2,@Type3,@Type4)
*/
Insert?into?HMonthOtherTotal(UnitID,YearMonth,Type1,Type2,Type3,Type4)
values?(@UnitID,@YearMonth,@Type1,@Type2,@Type3,@Type4)
SET?@PKID=SCOPE_IDENTITY();
return?

Go

Insert?into?HMonthOtherTotal(UnitID,YearMonth,Type1,Type2,Type3,Type4)
values?(2,'2008年10月',20,120,120,14)

execute?HMonthOtherTotal_Insert?2,'2008年12月',20,120,120,14

?

最后兩句是我插入數據的那種犯法,第一種直接插入是可以添加數據的,

但是第二種就不行了,報告錯誤:

服務器: 消息 8114,級別 16,狀態 4,過程 HMonthOtherTotal_Insert,行 0
將數據類型 varchar 轉換為 int 時出錯。

快點解決啊,就要交項目了。

轉載于:https://www.cnblogs.com/Longkin/archive/2008/12/16/1355878.html

總結

以上是生活随笔為你收集整理的遇到一个sql2000的问题,实在搞不懂了,求解决的办法?的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。