Fine... I got the reason for it. DDL doesn't support parameterization. So you got to use dynamic SQL to overcome that.
Code:
Exec('CREATE LOGIN loginname WITH PASSWORD = ''' + @PW + ''',
CHECK_POLICY=OFF, CHECK_EXPIRATION=OFF, DEFAULT_DATABASE=defaultdb')
Cheers.
_________________________
- Vijay G
Strive for Perfection