Insert statement: Auto Increment with Version Number and Datetime

  • Hi Friends,

    I have a table with 2 columns Version and CurrentDateTime

    For every insert the Records should be Autoincrement for Version Column and Record Insertdatetime for that Version

    1.0 | 2015-11-12 10:01.23..

    2.0 | 2015-11-12 10.02.11..

    ............................

  • Quick questions

    1. What is the frequency of insert in this table.

    2. Is there any bulk insert operation on this table.

    3. What happens in case of any delete operation is performed on this table?

  • Hi,

    1. What is the frequency of insert in this table.

    Adhoc.

    2. Is there any bulk insert operation on this table.

    No.

    3. What happens in case of any delete operation is performed on this table?

    No Delete Operation is going to be performed.

  • nexus2vijay (11/12/2015)


    Hi Friends,

    I have a table with 2 columns Version and CurrentDateTime

    For every insert the Records should be Autoincrement for Version Column and Record Insertdatetime for that Version

    1.0 | 2015-11-12 10:01.23..

    2.0 | 2015-11-12 10.02.11..

    ............................

    Is this another test or is it homework?

    What have you tried so far?

    “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden

  • Indeed is this a test or homework, and what have you tried,cause the answer seems simple to me.

    Also 2 columns, why only 2 columns and what values do you want to auto increment.

Viewing 5 posts - 1 through 4 (of 4 total)

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