I am trying to assign concatenated string to my variable and I am getting the error "Error converting data type varchar to datetime."
Please Can you help me solve this problem.
declare @msg Varchar(max)
set @msg = 'select' + 'File Date: ' + CAST(GetDate() AS VARCHAR(Max)) + ' data imported successfully'
EXEC DataImport
@PackageName = '',
@Status= 'Successful',
@Message = @msg,
@FileName = 'test',
@PackageExecutionDate = 'test',
@Step = 'Import Flat Files'
varchar(max). If you want control over the date string you should either useCONVERTwith a style orFORMATwith a format string.