title: nvarchar is not a recognized cursor option
body: <p>I am running some sql that take the info from a temporary table and puts it into the permanent table. I got it from a step by step guide written 3 years ago, and the person who wrote it is long gone.
  it states to use this sql here.</p>
  
  <pre><code>declare @Password nvarchar(100); 
  set @Password ='rewards';
  if not exists(select 1 from sys.openkeys where key_name = 'Sym_UserPassData' 
  and database_name = db_name())  OPEN SYMMETRIC KEY Sym_UserPassData DECRYPTION BY
  CERTIFICATE UserPassTables with password='asbpass71509new';
  INSERT INTO [User] (Username, [Password], AllowChange, ForceChange, FullName,
  SalesRep, OpenLink, UserProfileID, LastUpdatedBy,UserEmail) 
  (SELECT Username,EncryptByKey(Key_GUID('Sym_UserPassData'),@Password), 
  AllowChange, ForceChange, FullName, SalesRep, [OpenLink ], UserProfileID,    
  LastUpdateBy, UserEmail FROM TempUsers)
  </code></pre>
  
  <p>and then after that it says the following</p>
  
  <p>If the password is unique for each row, take the set @Password = ‘Password’; off and replace the @Password with [Password].</p>
  
  <p>so at first I just changed the 2nd line so it said</p>
  
  <pre><code>declare @Password nvarchar(100);
  set [Password]
  ...
  </code></pre>
  
  <p>But that gave me an error with the password column so then i changed it to:</p>
  
  <pre><code>declare [Password] nvarchar(100); 
  set [Password]
  if not exists(select 1 from sys.openkeys where key_name = 'Sym_UserPassData' 
  and database_name = db_name())  OPEN SYMMETRIC KEY Sym_UserPassData DECRYPTION BY
  CERTIFICATE UserPassTables with password='asbpass71509new';
  INSERT INTO [User] (Username, [Password], AllowChange, ForceChange, FullName,
  SalesRep, OpenLink, UserProfileID, LastUpdatedBy,UserEmail) 
  (SELECT Username,EncryptByKey(Key_GUID('Sym_UserPassData'),[Password]), 
  AllowChange, ForceChange, FullName, SalesRep, [OpenLink ], UserProfileID,    
  LastUpdateBy, UserEmail FROM TempUsers)
  </code></pre>
  
  <p>and that is what gave me the error:</p>
  
  <pre><code> nvarchar is not a recognized cursor option 
  </code></pre>
  
  <p>Does anyone know what I am missing? If i can provide any other info I will do my best to do so.</p>
  
  <p>Thank you to anyone who is able to help with this.</p>