You are creating a table to support an application that will cache data outside of SQL Server. The application will detect whether cached values were changed before it updates the values. You need to create the table, and then verify that you can insert a row into the table. Which code segment should you use?
A. CREATE TABLE Table1 (
ID int IDENTITY(1,1),
Name varchar(100),
Version uniqueidentifier DEFAULT NEWID())
INSERT INTO Table1 (Name, Version)
VALUES (‘Smith, Ben’)
B. CREATE TABLE Table1 (
ID int IDENTITY(1,1),
Name varchar(100),
Version rowversion)
INSERT INTO Table1 (Name, Version)
VALUES (‘Smith, Ben’, NEWID())
C. CREATE TABLE Table1 (
ID int IDENTITY(1,1),
Name varchar(100),
Version uniqueidentifier DEFAULT NEWID())
INSERT INTO Table1 (Name, Version)
VALUES (‘Smith, Ben’, NEWID())
D. CREATE TABLE Table1 (
ID int IDENTITY(1,1),
Name varchar(100),
Version rowversion)
INSERT INTO Table1 (Name)
VALUES (‘Smith, Ben’)