title: SQL Server Locking hint in insert Statement does not Grant the Specified Lock
body: <p>I am trying to optimize my query execution time Using Lowest Lock level(Rowlock) but it Does not take effect "higher Locks Level Are Granted (IX)" when tracing in SQL profiler ,</p>
  
  <p>My scenario:</p>
  
  <ul>
  <li>assuming I have two tables <code>dbo.Students</code> and <code>dbo.University</code> </li>
  <li><code>dbo.Students</code> has a foreign key column to the <code>University</code> table</li>
  </ul>
  
  <p>Query </p>
  
  <pre><code>INSERT INTO  dbo.Students WITH (ROWLOCK) (UniversityId, StudentName)
  </code></pre>
  
  <p>When Trace Locks in sql profile </p>
  
  <ul>
  <li><code>Student</code> table granted IX (intent Exclusive)</li>
  <li><code>University</code> table granted sch_s (schema stabilization)</li>
  </ul>
  
  <p>and there many Page and Key locks granted and released before releasing these two locks.</p>
  
  <p>Can anyone help me grant row locks only in the students table?</p>