title: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Incorrect syntax near 'abcdef'. (102) (SQLExecDirectW)")
body: <pre><code>ownerpass="abcdef"
  owner="yrdy"
  sql_login = (
  "DECLARE @sql AS NVARCHAR(MAX);"
  "DECLARE @Databaseowner sysname = ?;"
  "DECLARE @Databaseownerpass sysname = ?;"
  "SET @sql = N'if not exists (select * from sys.sql_logins where name = @Databaseowner )'  + N' CREATE LOGIN ' + QUOTENAME(@Databaseowner) + N''' WITH PASSWORD = ' + QUOTENAME(@Databaseownerpass, '''') + N';';"
  "EXEC sp_executesql @sql,N'@Databaseowner sysname', N'@Databaseownerpass sysname', @Databaseowner = @Databaseowner, @Databaseownerpass = @Databaseownerpass;")
  cursor.execute(sql_login, owner,ownerpass)
  =============================================
  </code></pre>
  
  <p>Getting incorrect syntax error near password</p>