title: How do I force a refresh of a fulltext index within a transaction in mssql?
body: <p>I am trying to figure out how to get the following code to return the row that it just inserted - a co-worker pointed out and suggested running ALTER FULLTEXT CATALOG uiris_production REBUILD but that cannot be run within a user transaction.  </p>
  
  <p>The reason this has to be in a transaction is that this is coming from a test framework where the test is wrapped in a transaction and then rolled back.</p>
  
  <pre><code>declare @search varchar(64)
  set @login_test = 'foobar'
  set @search = '"' + @login_test + '*"'
  
  begin transaction
     insert into users(login) values (@login_test)
     select login from users where contains(login, @search)
  commit
  </code></pre>