title: Need help .Problem with SQL Server nextval query
body: <p>I have a problem with the SQL query- nextval in a SQL Server database:</p>
  
  <blockquote>
    <p>The multi-part identifier "applicationauth.nextvalue" could not be bound.</p>
  </blockquote>
  
  <p>Any idea what could be wrong?</p>
  
  <p>Here is query:</p>
  
  <pre><code>insert into applicationauth (app, optionname, conditionnum, groupname, applicationauthid) 
      select 'AUTOSCRIPT', 'ATTRVAL', 'ATTRVALUECON', varvalue, applicationauth.nextvalue
      from maxvars 
      where varname = 'ALLUSERGROUP';
  
  insert into applicationauth (app, optionname, conditionnum, groupname, applicationauthid) 
      select 'AUTOSCRIPT', 'HIDEATTR', 'HIDEATTRCON', varvalue, applicationauthseq.nextval
  
  insert into applicationauth (app, optionname, conditionnum, groupname, applicationauthid) 
      select 'AUTOSCRIPT', 'ATTRVAL', 'ATTRVALUECON', varvalue, applicationauthseq.nextval
      from maxvars 
      where varname = 'ALLUSERGROUP';
  
  insert into applicationauth (app, optionname, conditionnum, groupname, applicationauthid) 
      select 'AUTOSCRIPT', 'HIDEATTR','HIDEATTRCON', varvalue, applicationauthseq.nextval
      from maxvars 
      where varname = 'ALLUSERGROUP';
  
  insert into applicationauth (app, optionname, conditionnum, groupname, applicationauthid) 
      select 'AUTOSCRIPT', 'HIDEBUT', 'HIDEBUTCON', varvalue, applicationauthseq.nextval
      from maxvars 
      where varname = 'ALLUSERGROUP';
  
  insert into applicationauth (app, optionname, conditionnum, groupname, applicationauthid) 
      select 'AUTOSCRIPT', 'HIDEIMP', 'HIDEIMPCON', varvalue, applicationauthseq.nextval
      from maxvars 
      where varname = 'ALLUSERGROUP';
  </code></pre>
  
  <p><em>(and so on and so forth ...)</em></p>
  
  <p>I'm getting following error message:</p>
  
  <blockquote>
    <p>Msg 4104, Level 16, State 1, Line 2<br>
    The multi-part identifier "applicationauth.nextvalue" could not be bound.</p>
    
    <p>Msg 4104, Level 16, State 1, Line 9<br>
    The multi-part identifier "applicationauthseq.nextval" could not be bound.  </p>
    
    <p><em>(.... and so on and so forth)</em></p>
  </blockquote>