Beantwortet Ssis error with a declare

  • Monday, February 27, 2012 2:34 PM
     
     

    hai,

    My table has 267 rows and the design is varchar. In my table in field varchar are numbers and letters.

    Is there a max on the table, because when I have 256 rows the declare is fine, when I have 257 rows I see the next error: My code is: declare @start int  set @start=(select cast(waarde as int) from table where type = startdate " failed with the following error: "The statement has been terminated.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

All Replies

  • Monday, February 27, 2012 2:37 PM
     
     

    How many records in the table have type value of "startdate"?  If there are more than one, then the query should fail.


    Russel Loski, MCT, MCITP Business Intelligence Developer and Database Developer 2008

  • Monday, February 27, 2012 2:38 PM
     
     

    Hi, limit on number of rows? 256?? No, there's no such limit. Probably the issue is with the data that's on your table. Can you run that statement in management studio? Maybe the issue is related with that cast to int...

    David.

  • Monday, February 27, 2012 5:57 PM
     
     

    are you sure

    select cast(waarde as int) from table where type = startdate

    part of the query returns only one value.

    If not, this will be the possible reason for t he query execution fail.

    Thanks,

    Hemendra

     

  • Tuesday, February 28, 2012 1:45 PM
     
     

    Hai,

    No I can't run this statement in de management studio. Same error.

  • Tuesday, February 28, 2012 1:59 PM
     
     Answered

    Here is a thought.  Run the query in SSMS without the variable assignment, the on that Hemendra recommended.  If it returns more than one row, then you cannot assign the value to a variable.  Get your query to work in SSMS, then use SSIS.


    Russel Loski, MCT, MCITP Business Intelligence Developer and Database Developer 2008