question

StephenLiang-0936 avatar image
0 Votes"
StephenLiang-0936 asked Monalv-msft edited

SQL Bulk data migration uniqueidentifier

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
(@id,'a','b','c',GETDATE()),
(@id,'a','b','c',GETDATE()),
(@id,'a','b','c',GETDATE()),
(@id,'a','b','c',GETDATE()),

sql-server-integration-services
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Monalv-msft avatar image
0 Votes"
Monalv-msft answered Monalv-msft edited

Hi @StephenLiang-0936 ,

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,
Mona


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.



· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @StephenLiang-0936 ,

May I know if you have anything to update?

Best regards,
Mona

0 Votes 0 ·