SQL Bulk data migration uniqueidentifier

Stephen Liang 21 Reputation points

Ok . But encounter another problem. As i have 200 data rows to input , i noted i cannot bulk insert using ['] after each row, as error message [You must declare @id uniqueidentifier].

How can i solve this for multiple data rows migration for insertion?

thanks again

DECLARE @id uniqueidentifier
SET @id = NEWID()
insert into Records ([Id],Ref1,Ref2,Name1,Date1) values

SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,321 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Monalv-MSFT 5,881 Reputation points

    Hi @Stephen Liang ,

    May I know if you want to use SSIS Execute SQL Task to run the Insert sql query?

    Please refer to Parameters in the Execute SQL Task and Execute SQL Task in SSIS: Output Parameters vs Result Sets.

    Best regards,


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.