CREATE PROC LoginUser (@UserNameTemp VARCHAR(100) output)
AS BEGIN
SET @UserNameTemp = 'a234'
DECLARE @passtemp AS NVARCHAR(MAX) = '1234'
DECLARE @SqlCommand AS NVARCHAR(MAX) = N'CREATE LOGIN ' + @UserNameTemp + N' WITH PASSWORD = N''' + @passtemp + N''''
EXEC(@SqlCommand)
END
GO
DECLARE @retVal AS NVARCHAR(MAX) = ''
EXEC LoginUser @UserNameTemp = @retVal OUTPUT
פורסם במקור בפורום CODE613 ב24/07/2016 16:23 (+03:00)