Azure CREATE LOGIN fails
Posted: Sun 07 Aug 2016 18:53
I'm using SDAC version 6.10.21 with an Azure SQL Database.
When I issue the following query I get an error:
Incorrect param near '@P1'.
HOWEVER, this code DOES work:
Any ideas why passing parameters to this query would be causing a problem?
The code is in exactly the same place and is connected to the master database.
As a side note, calls to Query.FinalSQL don't seem to give the full query with the parameters expanded.
Thanks!
When I issue the following query I get an error:
Code: Select all
aLoginName := 'NewUserName';
aPassword := 'NewUserPassword1!';
Query.SQL.Text := 'CREATE LOGIN :LoginName WITH PASSWORD = :Password';
Query.ParamByName('LoginName').AsString := aLoginName;
Query.ParamByName('Password').AsString := aPassword;
Query.Execute;
HOWEVER, this code DOES work:
Code: Select all
Query.SQL.Text := 'CREATE LOGIN NewUserName WITH PASSWORD = ''NewUserPassword1!''';
Query.Execute;
The code is in exactly the same place and is connected to the master database.
As a side note, calls to Query.FinalSQL don't seem to give the full query with the parameters expanded.
Thanks!