I need to create a login in a stored procedure.
CREATE LOGIN [MYDOMAIN\TestPerson] FROM WINDOWS;
Above works fine. However, I need to pass the login name into the spoc. The code below does not work.
DECLARE @Log varchar(50)
SET @Log = '[MYDOMAIN\TestPerson]'
CREATE LOGIN @Log FROM WINDOWS;
How can I do this?