Exforsys
+ Reply to Thread
Results 1 to 5 of 5

primary key

This is a discussion on primary key within the Java forums, part of the Programming Talk category; I add all data into database from csv file and just insert primary key which are auto generated and not ...

  1. #1
    Namarta is offline Junior Member Array
    Join Date
    Apr 2009
    Answers
    2

    primary key

    I add all data into database from csv file and just insert primary key which are auto generated and not in the csv file.how i will add primary key into table.


    Help me
    Thanks in advance


  2. #2
    techguru is offline Senior Member Array
    Join Date
    Mar 2005
    Answers
    112
    you will need to load the csv to temp table, then load to the main table with identity assuing you are using sql server . if you are using oracle, then you need to create a sequence for this

    another option is add a colimn in csv, put the sequence numbers before the load for the primary key


  3. #3
    jack705 is offline Junior Member Array
    Join Date
    Mar 2010
    Answers
    18
    For add a primary key in a table, add the auto increment keyword to the integer primary key declaration


  4. #4
    SelahJadenCald is offline Junior Member Array
    Join Date
    Apr 2010
    Answers
    4
    The primary key of a relational table uniquely identifies each record in the table. It can either be a normal attribute that is guaranteed


  5. #5
    saikiran14312 is offline Junior Member Array
    Join Date
    May 2010
    Answers
    2
    alter table tablename add(constraint constraintname)
    ex alter table sai add(colname primarykey);


    •    Sponsored Ads



Latest Article

Network Security Risk Assessment and Measurement

Read More...