Create Table "Users"(
"UsersId" int identity(1,1) not null,
"UsersName" varchar(50) not null,
"Password" varchar(32) not null,
constraint PK_Users primary key ("UsersId"),
);现在我要建一个插入的同时增加修改时间的存储过程,请就高手指点!
"UsersId" int identity(1,1) not null,
"UsersName" varchar(50) not null,
"Password" varchar(32) not null,
constraint PK_Users primary key ("UsersId"),
);现在我要建一个插入的同时增加修改时间的存储过程,请就高手指点!
解决方案 »
- 从字符串向 datetime 转换时失败。
- 大虾进啊,SQL运行通过 VB中提示from后面存在语法错误
- 这个统计次数的sql怎么写,在线等待!!!!!
- provider: 命名管道提供程序, error: 40 - 无法打开到 SQL Server 的连接,,,求细节,求解答!
- 这个分组累计的查询怎么写?
- 修改数据问题..
- 请教!
- 一个触发器的问题:从sql server向oracle插入数据
- SQL SERVER中得到格式化日期的函数是什么?
- 【【【【【web应用中使用SQL合并合分发控件 问题】】】】】
- 批量删除作品的相关点评后,能不能用一条查询语句重新统计涉及到的作品的点评数!
- 关于存储过程的返回值,大家帮帮忙
if object_id('[ta]') is not null drop table [ta]
go
create table [ta]([id] int identity,[name] varchar(4),[pwd] int)--> 测试数据:[tb]
if object_id('[tb]') is not null drop table [tb]
go
create table [tb]([id] int,[login_time] datetime)
insert [tb]
select 1,'2010-05-09'--------------------------------查询开始------------------------------select * from [tb]
create trigger t_user on ta
for insert
as
begin
update tb set [login_time]=getdate() from inserted i,tb b where i.id=b.id
end
--测试
insert [ta]
select '张三',123456select * from tb
/*
id login_time
----------- -----------------------
1 2010-05-09 16:35:34.160(1 行受影响)*/