a. insert tb select 1b. create proc p as insert tb select 1 go exec p go a,b两个都是向tb表插入一条记录,a是单条语句,b是存储过程,都会向tb写记录。我上面说过了,功能上无区别。 就像你在前台程序中做一件事: dim a a=1 dim b b=a+1 msgbox b 这有5行代码。你写了个subsub x dim a a=1 dim b b=a+1 msgbox b end sub再调用这个sub call x 一样的道理。
insert tb select 1b.
create proc p
as
insert tb select 1
go
exec p
go
a,b两个都是向tb表插入一条记录,a是单条语句,b是存储过程,都会向tb写记录。我上面说过了,功能上无区别。
就像你在前台程序中做一件事:
dim a
a=1
dim b
b=a+1
msgbox b
这有5行代码。你写了个subsub x
dim a
a=1
dim b
b=a+1
msgbox b
end sub再调用这个sub
call x
一样的道理。
PS 楼主,以后发贴多少贴点分吧,人家高手解答也有点彩头