Migrate procedure From Sql 2000 to Sql2005

  • Hi,

    I am having 3 columns in my #Temptable. The Columns in Temp table are ID INT,LINE_NO INT,TOT_LINES INT.

    In sql server 2000, I wrote a insert like

    "insert #Temptable

    select id,no from t_line" It doesn't show any exception.

    But Now I migrate procedure to Sql2005 It shows an exception like"Number of Supllied values mismatch". After I tested with query it's showing error in both Sql server 2000 & 2005.

    Could any one explain why it doesn't shows any exception in Sqlserver2000 with a proc.

    Thanks...

  • The statement fails because you're only selecting two columns from t_line. The select list of the subquery must match the column list of the INSERT. The same rule applies to SQL 2000, so I can only guess that you have a typo in the migrated query. Check the original and see if the subquery was selecting three columns.

    Greg

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply