Monday, January 19, 2009

Creating a table in Sybase

Now you have your database and users setup we should look at creating tables.
remember before when I said about creating objects remember to put dbo before your table name otherwise the object will be created with your user ie jagot.table.


CREATE TABLE dbo.table
(
assetManagerCode varchar(30) NOT NULL,
assetManagerName varchar(100) NULL,
assetManagerNameJpy univarchar(100) NULL,
address1 univarchar(100) NULL,
address2 univarchar(100) NULL,
attention univarchar(50) NULL,
telephoneNo varchar(20) NULL,
faxNo varchar(20) NULL,
insertedBy varchar(30) NOT NULL,
insertTimestamp datetime NOT NULL,
updatedBy varchar(30) NULL,
updatedTimestamp datetime NULL,
CONSTRAINT PKAssetManagerDetails
PRIMARY KEY NONCLUSTERED (assetManagerCode)
)
LOCK ALLPAGES
go
CREATE NONCLUSTERED INDEX IndexAssetManagerName
ON dbo.AssetManagerDetails(assetManagerName)
go

No comments:

Post a Comment