title: An INSERT statement cannot contain a SELECT statement that assigns values to a variable
body: <pre><code>    DECLARE  @TopicsFilterFranchiseId INT 
  
   DECLARE @tblTopics AS table    
   (    
    ClientCategoryID int,    
    CategoryID int,    
    ProductID int    
   )   
  
  
       INSERT INTO @tblTopics 
       SELECT  @TopicsFilterFranchiseId = ID from dbo.GetIDsTableFromIDsList(@FranchiseID)
      while @TopicsFilterFranchiseId is not null
         begin
           EXEC SBS_G_GetTopicsByFranchiseID @TopicsFilterFranchiseId  
           Set @TopicsFilterFranchiseId = NULL 
         end
  </code></pre>
  
  <p>I got this error please tell me how can I resolve this error</p>