Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2002
    Location
    India
    Posts
    38

    Unanswered: Create Table Error

    While Creating the Table in SqlServer200 It is givin the Error like


    Server: Msg 2749, Level 16, State 2, Line 1
    Identity column 'CustID' must be of data type int, bigint, smallint,
    tinyint, or decimal or numeric with a scale of 0, and constrained to
    be nonnullable.

    Can't we create a Identity for character Field?
    my Code is follows

    CREATE TABLE Rtest (CustID Varchar(10) NOT NULL IDENTITY,
    CustName VARCHAR(40) NOT NULL)
    -- Prasad --

  2. #2
    Join Date
    Jan 2002
    Posts
    12
    NO, You cant have an varchar or char field as an identity column

    Identity column must be of type numeric ,or the types specified in the error u have given.
    NivasKhan

  3. #3
    Join Date
    May 2002
    Posts
    299
    Identity property is to ensure the column value to increase by the defined step. How would a varchar increase?
    --
    -oj
    http://www.rac4sql.net

Posting Permissions

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