Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.
alter FUNCTION funcGenerateUniquePURLByName ( -- Add the parameters for the function here @FirstName as varchar(200), @LastName as varchar(200) ) RETURNS varchar(200) AS BEGIN -- Declare the return variable here DECLARE @Count as int Set @Count = 0 DECLARE @NewPURL as varchar(200) SET @FirstName = CAST(REPLACE(@FirstName,' ','') as varchar(100)) SET @LastName = CAST(REPLACE(@LastName, ' ', '') as varchar(100)) --SET @NewPURL = (select 'JohnHENDERSON' as expr1) SET @NewPURL = @FirstName+@LastName -- Add the T-SQL statements to compute the return value here while ((select count(PURL) from ICM_GUAMaster With (tablockx, holdlock) where PURL = @NewPURL) = 1) begin set @Count=@Count+1 set @NewPURL = (REPLACE(@FirstName,' ','')+REPLACE(@LastName, ' ', '')+cast(@Count as varchar(20))) end -- Return the result of the function RETURN @NewPURL END GO
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
14 Experts available now in Live!