if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[FK_StockOrder_Stocks]')
and OBJECTPROPERTY(id, N'IsForeignKey') = 1)
ALTER TABLE [dbo].[StockOrder] DROP CONSTRAINT FK_StockOrder_Stocks
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Stocks]')
and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Stocks]
GO
CREATE TABLE [dbo].[Stocks] (
[PK_StockCode] [char] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
[StockName] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Stocks] WITH NOCHECK ADD
CONSTRAINT [PK_Stocks] PRIMARY KEY CLUSTERED
(
[PK_StockCode]
) ON [PRIMARY]
GO