表類型可以用在存儲過程中,用於批量增加 sqlserver2005好像不支持表類型,不過支持表變量
表類型定義:
復制代碼 代碼如下:
CREATE TYPE dbo.SubCardTable as table
(
[SC_ID] [varchar](50),
[ZhuKaInfo_ID] [varchar](50),
[Project_KeyName] [varchar](50),
[SC_CardNumber] [varchar](50),
[Statues] [int] DEFAULT 0,
[SC_AddTime] [datetime],
[SC_AddPerson] [varchar](50),
[SC_Money] [int],
[MainCardReceiveIntegral] [int] DEFAULT 0,
[SC_RelationCustom] [varchar](50),
[SC_UseTime] [datetime]
)
表變量定義:
復制代碼 代碼如下:
@declare @mtTable table(id int, [name] varchar(10))