現在要通過編程向B表中插入數據
為了解決這個問題
代碼示例:
復制代碼 代碼如下:
create PROCEDURE [dbo]
@TypeName varchar(
@Description varchar(
@CtlColSpan int
@Sort int
@SourceID int
@FieldID int
@TableID int
AS
if @SourceID =
begin
INSERT INTO T_Form_Control_Info (
[TypeName]
[Description]
[CtlColSpan]
[Sort]
[FieldID]
[TableID]
) VALUES (
@TypeName
@Description
@CtlColSpan
@Sort
@FieldID
@TableID
)
end
else
begin
INSERT INTO T_Form_Control_Info (
[TypeName]
[Description]
[CtlColSpan]
[Sort]
[SourceID]
[FieldID]
[TableID]
) VALUES (
@TypeName
@Description
@CtlColSpan
@Sort
@SourceID
@FieldID
@TableID
)
end
return SCOPE_IDENTITY()
From:http://tw.wingwit.com/Article/program/MySQL/201311/29541.html