问个关于标识种子的问题 现数据库中有一张表,如test有三个字段,如A1,A2,A3,已知A1为标识种子,自动增长的。现在想实现如下功能:用INSERT 插入一条新的记录时,想实现A2的值与A1的值相同。用存储过程或T-SQL语句都可以,请问该如何做呀 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 create trigger t_test on testfor insertasbegin update test set A2=A1 from inserted where test.A1=inserted.A1endgo create table test(id int identity(1,1),id2 as id,id3 int)insert test(id3) select 3union all select 4select * from test 设计表--〉选中A2列---〉公式那填上A1如果采用这种办法,那么是否是 insert 语句中,不用关A2 的值了,让sql server自动计算昵 设计表--〉选中A2列---〉公式那填上A1如果采用这种办法,那么是否是 insert 语句中,不用关A2 的值了,让sql server自动计算昵这样就不用管a2了,你插入保存A2会自动取的a1值 求一个SQL的写法 服务器上已经安装了sqlserver2005,想再装一个sqlserver2000,需要注意些什么? ----求SQL语句----请进 高分求困难的分组问题 特殊符号分隔字符串查询的问题 有关自动生成编号的问题! htl258(黄团利)看到帖子请回复个话,我给你加分! SQL SERVER 2000備份資料庫還原問題(真的很急!) 插入记录怎么写 我有一张Access数据库表,在用SQL管理器导入数据时总是发生错误,请高手帮忙 请各位大哥帮忙看一下这个SQL怎么写 如何使用SQL语句实现分组乘积,不用函数。谢谢
for insert
as
begin
update test
set
A2=A1
from
inserted
where
test.A1=inserted.A1
end
go
id int identity(1,1),
id2 as id,
id3 int
)insert test(id3)
select 3
union all select 4select * from test