if exists (select * from sysobjects where id = object_id('dbo.tblMetricEvaluationMethod') and sysstat & 0xf = 3)
drop table dbo.tblMetricEvaluationMethod
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
GO
===========================================================
Important to remember that ORDER BY works below when TOP is used.
--------------------------------------------------------------------
USE [database]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].vw_name
as
SELECT TOP 10
[col1], [col2], ...
FROM dbo.[tblName]
GROUP BY [col1], [col2], ...
ORDER BY [col1], [col2], ...
GO
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE dbo.tblMetricEvaluationMethod (
memID int IDENTITY (1, 1) NOT NULL ,
memText varchar(200) ,
memTaskID int ,
memCreateDate datetime ,
memCreatedBy int ,
memModifiedDate datetime ,
memModifiedByec_EventDescription varchar(1000)
CONSTRAINT PK_tblMetricEvaluationMethod PRIMARY KEY CLUSTERED ( memID )
CONSTRAINT FK_tblMetricEvaluationMethod FOREIGN KEY (memCreatedBy) REFERENCES tblUsers(UserID)
)
GO
SET ANSI_PADDING OFFGO
===========================================================
Important to remember that ORDER BY works below when TOP is used.
--------------------------------------------------------------------
USE [database]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].vw_name
as
SELECT TOP 10
[col1], [col2], ...
FROM dbo.[tblName]
GROUP BY [col1], [col2], ...
ORDER BY [col1], [col2], ...
GO