Sqlserver表類型和表變數

來源:互聯網
上載者:User

表類型可以用在預存程序中,用於批量增加

表類型定義:

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])
sqlserver2005好像不支援表類型,不過支援表變數

表變數定義:

@declare @mtTable table(id int, [name] varchar(10))


相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.