Question

Error: Insufficient result space to convert uniqueidentifier value to char.

I have a temp table

SELECT
  urlid, -- This coulmn does not exist in Phrase table I would like to declare it uniqueidentifier
  P.subDomainId,
  P.RegionID            
  INTO #tempcom     
FROM
    Phrase P

When i Update #tempcom table with this query

   Declare @urlid as uniqueidentifier
   Set @urlid = '4c595d6c-1e8a-45cf-aaf2-fe5a45b881b9'
   UPDATE T SET T.urlid = @urlid From #tempcom T Where T.subdomain = 'www.borasloppis.se'

It throw error:Insufficient result space to convert uniqueidentifier value to char. What do you think how could i fix error in this situation?

Était-ce utile?

La solution

Try this one -

SELECT  
      NEWID() AS urlid --<-- column with GUID datatype
    , P.subDomainId
    , P.RegionID
INTO #tempcom
FROM dbo.Phrase P

Update -

DECLARE @urlid AS UNIQUEIDENTIFIER
SET @urlid = '4c595d6c-1e8a-45cf-aaf2-fe5a45b881b9'

UPDATE #tempcom
SET urlid = @urlid
WHERE subdomain = 'wwww.borasloppis.se'
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top