How to Assign system DateTime to User Variable

  • hi everyone!

    i'd like to assign date time stamp to my variable using a script task or some other way!

    and i'll use that particular timestamp as the batch for my package! just i'll insert that variable value to the backend, this would act as a batch for my package's last run.

    I have assigned getdate() in derived column,

    but, its milliseconds are changing every 100 rows. i want to use a batch value for my package's full run!

    so please tell me how to assign system datetimestamp to the user variable!

    Thanks

  • Hi

    You can have a guid option which is unique for every time when ever you request for the same. You can assign the GUID so that it will not get recreated for any user on this machine.

    here is the sample code which i think will help you.

    DECLARE @myid uniqueidentifier

    SET @myid = NEWID()

    PRINT 'Value of @myid is: '+ CONVERT(varchar(255), @myid)

    or

    select newid() ---just run any of the above to get a unique id

    hope this will help you........

    Regards

    Srinivas Chilakapati

  • You could just use the SSIS system variable [StartTime].

    Kindest Regards,

    Frank Bazan

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply