• See example following for creating a table:

    BOL: "CREATE TABLE dbo.PurchaseOrderDetail
        PurchaseOrderID int NOT NULL
            REFERENCES Purchasing.PurchaseOrderHeader(PurchaseOrderID),
        LineNumber smallint NOT NULL,
        ProductID int NULL
            REFERENCES Production.Product(ProductID),
        UnitPrice money NULL,
        OrderQty smallint NULL,
        ReceivedQty float NULL,
        RejectedQty float NULL,
        DueDate datetime NULL,
        rowguid uniqueidentifier ROWGUIDCOL  NOT NULL
            CONSTRAINT DF_PurchaseOrderDetail_rowguid DEFAULT (newid()),
        ModifiedDate datetime NOT NULL
            CONSTRAINT DF_PurchaseOrderDetail_ModifiedDate DEFAULT (getdate()),
        LineTotal  AS ((UnitPrice*OrderQty)),
        StockedQty  AS ((ReceivedQty-RejectedQty)),
        CONSTRAINT PK_PurchaseOrderDetail_PurchaseOrderID_LineNumber
                   PRIMARY KEY CLUSTERED (PurchaseOrderID, LineNumber)
                   WITH (IGNORE_DUP_KEY = OFF)


    You cannot backup a table. You can backup a database.

    You can create a copy of table by SELECT INTO:

    The SELECT INTO copy process does not copy certain constraints such as CHECK constraints. However, data is copied.

    Kalman Toth Database & OLAP Architect IPAD SELECT Query Video Tutorial 3.5 Hours
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

    Saturday, September 14, 2013 4:06 PM