When you access a Unique identifier field , you need to declare a varchar with dimension,
e.g
DECLARE @COMPANYID VARCHAR
SET @COMPANYID = (SELECT TOP 1 UniqueIdenField FROM testtable WHERE USER_ID = @USERID)
the problem with this is that the varchar that is being declared is too small for the unique identifier field , that is 32 characters long, so you need to provide the dimensions for every variable you create as depicted below
DECLARE @COMPANYID VARCHAR(50)
SET @COMPANYID = (SELECT TOP 1 UniqueIdenField FROM testtable WHERE USER_ID = @USERID)
Thanks
Thank you for posting at Dotnetfunda
[Administrator]