logo

CuriousTab

Which dml command is used in conjunction with @@identity? INSERT and U

Discussion


Home Certification Oracle Certification Comments
Share: 

  • Question
  • Which dml command is used in conjunction with @@identity?


  • Options
  • A. INSERT and UPDATE
  • B. UPDATE and DELETE
  • C. SCOPE_IDENTITY and IDENT_CURRENT
  • D. Commit and rollback

  • Correct Answer
  • SCOPE_IDENTITY and IDENT_CURRENT 

    Explanation

    Using automatically incrementing IDENTITY columns is very popular with database developers. You don?t need to explicitly calculate unique surrogate keys when inserting new data, the IDENTITY column functionality does that for you. The IDENTITY feature also allows you to specify useful Seed and Increment properties. When you use an INSERT statement to insert data into a table with an IDENTITY column defined, SQL Server will generate a new IDENTITY value.

     

    You can use the @@IDENTITY variable and the SCOPE_IDENTITY and IDENT_CURRENT functions to return the last IDENTITY value that has been generated by SQL Server. This is very useful when you need to return the key for the row that has just been inserted, back to the caller.

  • Tags: Software Architect, Project Manager, Network Engineer, IT Trainer, Database Administrator, Analyst
    Similar Questions
  • 1. What is Primary Key in DBMS? Solve it....

  • 2. You are choosing a Windows 2000 operating system to use on a new computer at your company. This new computer will be a heavily used SQL server in your enterprise network environment. which operating system should you choose? Solve it....

  • 3. You use two sites on your Windows 2000 network. You decide you want to manually specify a particular domain controller in each site that will be used for intersite replication. What should you do? Solve it....

  • 4. What is the default optimization setting for the Server service on Windows 2000 Server computers? Solve it....

  • 5. You would like to use the command line to end an application that a Terminal Services client is running. What command can you use? Solve it....

  • 6. What is the maximum number of triggers, can apply to a single table? Solve it....

  • 7. Difference between Candidate key and Primary key? Solve it....

  • 8. Why do you need common fields in a Database? Solve it....

  • 9. What is the output after compile and run the following code ? int Output = 10; boolean b = false; if((b == true) && ((Output += 10) == 20)) { System.out.println("We are equal " + Output); } else { System.out.println("Not equal! " + Output); } Solve it....

  • 10. In the following pieces of code, B and D will compile without any error. True or false ? A: StringBuffer sb1 = "abcd"; B: Boolean b = new Boolean("abcd"); C: byte b = 255; D: int x = 0x1234; E: float fl = 1.2; Solve it....


  • Comments

    There are no comments.

Enter a new Comment