Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2003
    Location
    Oceanside,CA
    Posts
    31

    Question Unanswered: Transact SQL Insert problem

    I have a Stored Procedure that executes another Stored Procedure that returns rows containing two columns. I need to insert this data into a temporary table with two columns. I have tried the following statement and it errors out with
    Insert Error: Column name or number of supplied values does not match table definition.

    INSERT INTO #tblTemp([Customer ID], EmailAddress) exec frmCustomer

    The insert statement is wrong. Can you help with a solution?

  2. #2
    Join Date
    Nov 2005
    Location
    San Francisco, CA
    Posts
    506
    Quote Originally Posted by bhansen
    I have a Stored Procedure that executes another Stored Procedure that returns rows containing two columns. I need to insert this data into a temporary table with two columns. I have tried the following statement and it errors out with
    Insert Error: Column name or number of supplied values does not match table definition.

    INSERT INTO #tblTemp([Customer ID], EmailAddress) exec frmCustomer

    The insert statement is wrong. Can you help with a solution?
    Your statement seemed to be all right,its should work fine unless u spelled the wrong column names.Plz check the column names ,those should be same as the definition table's column name.
    Joydeep

  3. #3
    Join Date
    Dec 2003
    Location
    Oceanside,CA
    Posts
    31
    Quote Originally Posted by rudra
    Your statement seemed to be all right,its should work fine unless u spelled the wrong column names.Plz check the column names ,those should be same as the definition table's column name.
    Joydeep
    The wrong SP was running and producing the wrong output. I have fixed that and am now working
    Thanks

  4. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Darn if those silly computers aren't demanding... They keep doing what I tell them to instead of what I meant!

    -PatP

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •