identity column

  • SELECT IDENTITY(INT,1,1) as RowId,[Db_Name] INTO #SubscriptionDbList FROM ReplDatabases

    which worked fine in my system

    but when i executed it in another system its raise the following error

    Server: Msg 2715, Level 16, State 4, Line 1

    Column or parameter #0: Cannot find data type INT.

    What i done is i changed the int to smallint which work fine in my system

    when run the same thing another machince again its raise the same error

    can u help me.

  • I think this is because SMALLINT can only handle number between -32786 and 32767, inclusive.

    INT can handle numbers between -2147483648 and 2147483647, inclusive.

    Check your tables to see if you have more than 32767 rows...


    N 56°04'39.16"
    E 12°55'05.25"

  • I just tested this (SQL Server 2000 SP4). If the specified data type is too small, you should get an arithmetic overflow error.

    What version of SQL Server are you running on each of the servers? (Run SELECT @@version)?

    The error you are getting seems to occur when an invalid SQL Server datatype is supplied to the IDENTITY() function.

    For example, I ran this on my system:

    SELECT IDENTITY(unknowndatatype,1,1) as RowId

         , CONVERT(bigint, ev_id) AS old_ev_id

         , ev_date

      INTO testev

      FROM events

     and got this error:

    Server: Msg 2715, Level 16, State 4, Line 1

    Column or parameter #0: Cannot find data type unknowndatatype.

     

     

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

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