HI, I'm creating a program to create logins and user permissions for SQL Server. I attempted to use parameterized queries but I keep getting syntax errors complaining about an error by/near @username and or @mypassword. I've tried the following:
"Create Login @username with password @mypassword"
"Create Login @username with password '@mypassword'" - which is believe is incorrect.
I know the rest of the logic (supplying parameters) is correct because I use a class for creating and using parameterized queries all over my code and this is exactly the same.
I read somewhere that parameterized queries are not supported for Create/alter/drop login commands. Is this true?
How can I somehow create logins using characters such as ' ' and ''' and '%' and '(' in the user name and password as I can do from SSMS?