New feature! Upgrade and increase expert visibility of your issues with Priority Questions.
DECLARE @phoneNumbers varchar(max) SELECT @phoneNumbers = COALESCE(@phoneNumbers + ',', '') + CAST(T.PhoneNumber AS VARCHAR(10)) FROM ( SELECT TOP 7 REPLACE(P.DID,'-','') PhoneNumber FROM [dbo].[Phone Directory] P INNER JOIN ( SELECT [Staffing Manager] username FROM [dbo].[Staffing Manager] WHERE [status] = 'active' ) T ON P.[USER NAME] = T.[username] WHERE ISNULL(REPLACE(P.DID,'-',''),0) > ISNULL(@startNumber,5613140000)-1 AND P.[USER NAME] IS NOT NULL ORDER BY [PhoneNumber] ) T SELECT @phoneNumbers phoneList
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.