Q&A about the site for Drupal developers and administrators
-- Enter Query Title -- Enter Query Description /* DECLARE @st_Spaces char(25) DECLARE @st_NoSpaces char(25) SET @st_Spaces = '123 56' --One space, pos 4 SET @st_NoSpaces = REPLACE(@st_Spaces, ' ', '4') --Replace space w/ 4 SELECT QUOTENAME(@st_Spaces), LEN(LEFT(@st_Spaces, 4)), --Returns 3 QUOTENAME(@st_NoSpaces), LEN(LEFT(@st_NoSpaces,4)) --Returns 4 */ DECLARE @Customer TABLE (UniqueId uniqueidentifier, UniqueIntegerId int); INSERT INTO @Customer DEFAULT VALUES; INSERT INTO @Customer DEFAULT VALUES; INSERT INTO @Customer DEFAULT VALUES; DECLARE @guid uniqueidentifier; Update @Customer Set @guid = [UniqueId] = NEWID(), [UniqueIntegerId] = ABS(CAST(CAST(@guid AS VARBINARY) AS INT)); SELECT * FROM @Customer;