@ Haifeng in Hawaii: Do I have to use this method? You can create a user-defined table type. ---- CREATETYPE [dbo] under the User-Defined table Type node. [Test_TYPE] ASTABLE ([City] [varchar] (50) NOTNULL, [Cityid1] [int] NOTNULL, [Cityid2] [int] NOTNULL) GO -- this can be used in stored procedures. C
@ Haifeng in Hawaii: Do I have to use this method? You can create a user-defined table type. ---- Create type [dbo] under the User-Defined table TYPE node. [Test_TYPE] as table ([City] [varchar] (50) not null, [Cityid1] [int] not null, [Cityid2] [int] not null) GO -- this can be used in stored procedures. C
@ Haifeng in Hawaii: Do I have to use this method? You can create a user-defined table type.
---- Under the User-Defined table Type Node
Create type [dbo]. [Test_TYPE] as table (
[City] [varchar] (50) not null,
[Cityid1] [int] not null,
[Cityid2] [int] NOT NULL
)
GO
-- This can be used in the stored procedure.
Create procedure [dbo]. [UP_Batchadd_test]
(
@ SourceList Test_TYPE READONLY
)
AS
Begin
-- Traverse the data in the result set of @ SourceList and insert the data to the table cyclically.
End