title: pass table name as parameter in sql server
body: <p>I want to pass table name as parameter and I want to that parameter in where clause</p>
  
  <pre><code>CREATE PROC [dbo].[bb_GetPrepositionInfo] 
      @userid INT,@propId INT,@tabName varchar(50)
  AS 
        SET NOCOUNT ON 
        SET XACT_ABORT ON  
  
       BEGIN TRAN 
  
      SELECT *
      FROM   @tblname
      WHERE  ([acq_id] = @propId AND [user_id] = @userid) 
  
     COMMIT
      GO
  </code></pre>