我想创建一个函数,在每个表中加入一id列,如下:
use test
go
create function alterID()
returns
as
begin
alter table cdd_CELL add idcdd_CELL int identity(1,1)
alter table RLDEP add idRLDEP int identity(1,1)
alter table RLCFP add idRLCFP int identity(1,1)
end
go提示“ 关键字 'as' 附近有语法错误。 ”
大侠们看看
use test
go
create function alterID()
returns
as
begin
alter table cdd_CELL add idcdd_CELL int identity(1,1)
alter table RLDEP add idRLDEP int identity(1,1)
alter table RLCFP add idRLCFP int identity(1,1)
end
go提示“ 关键字 'as' 附近有语法错误。 ”
大侠们看看
alter table cdd_CELL add idcdd_CELL int identity(1,1)
alter table RLDEP add idRLDEP int identity(1,1)
alter table RLCFP add idRLCFP int identity(1,1)提示“ 列名 'idRLDEP' 无效。”我加完这列后,最后要把它删除,只是作为一个中介
as
... ...
go
create procedure newTable
as
alter table cdd_CELL add idcdd_CELL int identity(1,1)
alter table RLDEP add idRLDEP int identity(1,1)
alter table RLCFP add idRLCFP int identity(1,1)
.....
.....
go提示“ 列名 'idRLDEP' 无效。”