create procedure dbo.insertyoutable
@yourItem1 int,
@errorinfo varchar(20) output
as if not exists(select 1 from yourtable where yourYearItem = year(getdate()) and yourMonthItem = your(getdate()))
begin
insert...........
set @errorinfo = '保存成功!'
end
else
set @errorinfo = '保存失败!存在相同的记录!'
@yourItem1 int,
@errorinfo varchar(20) output
as if not exists(select 1 from yourtable where yourYearItem = year(getdate()) and yourMonthItem = your(getdate()))
begin
insert...........
set @errorinfo = '保存成功!'
end
else
set @errorinfo = '保存失败!存在相同的记录!'
解决方案 »
- MenuStrip动态绑定二级菜单,急急急。。。
- (散分)顺便再论下:先有鸡还是先有蛋的问题。。
- 一值传递多页的问题。
- 多个摄像头同时打开问题
- 100分请教关于用HttpWebRequest获得的Cookie保存客户端机子的问题!!!
- 请大家帮我呀!我在datagrid中嵌套了一个datagrid子控件,我如何实现datagrid子控件的分页呀!!!
- 调用非托管DLL中的函数后DataGrid的OnPaint方法系统报"溢出错误。"
- 请求高手帮助
- 怎样在dataGrid的单元格中写数据?
- 自已写了一个类,把它的新建对象序列化为什么不行,提示未标记为可序列化!!!
- 谁能指导我一下交错数组????
- 请问一个关于在注释上出现的问题!谢谢解答!
@yourItem1 int,
@errorinfo varchar(20) output
as if not exists(select 1 from yourtable where yourYearItem = year(getdate()) and yourMonthItem = month(getdate()))
begin
insert...........
set @errorinfo = '保存成功!'
end
else
set @errorinfo = '保存失败!存在相同的记录!'
time为数据库时间字段名 syetem_time为取得的当前系统时间变量,格式均为(年,月,日,时,分,秒)
执行报错为:to_char为不可识别函数名,
请大家帮个忙了,要用什么函数呢