hi all,i'm trying to write a simple stored procedure with 2 parameters (username & password) to crate a Login for the specified user. But i must be doing sth wrong because i always get an error when i try to create the stored procedure. Here it is:CREATE PROCEDURE [dbo].[AddLogin] @IsEdit bit,@usernamename varchar(256),@pw varchar(128)ASBEGIN CREATE LOGIN @username WITH PASSWORD = N'@pw' , END
this are the errorsMsg 102, Level 15, State 1, Procedure AddLogin, Line 10Incorrect syntax near '@username'.Msg 319, Level 15, State 1, Procedure AddLogin, Line 10Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon.
obviously it's because the @name parameter. but I don't have any idea how to change. Can anybody help me?? Thanks in advance