Monday, January 21, 2008

How To Create Computed Column In Data Dude

In order to create computed column in data dude you have to define it in the CREATE TABLE command.

Example:

CREATE TABLE [dbo].[Products]
(
ProductId int NOT NULL,
ProductNumber nchar(20) NULL,
ComputedProductNumber AS CASE WHEN ProductNumber
IS NULL THEN CONVERT(nchar(20),ProductId)
ELSE ProductNumber
END
);

No comments: