Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How can I add Descending Sorting Index within a SQ

Author  Topic 

accesser2003
Starting Member

14 Posts

Posted - 2008-07-03 : 12:18:06
I built a table [EmployeesAttendanceReportSource_Normal] using the SQL Statement as shown below. What I need is to add a descending sorting index for the column [AttDay].

How to rewrite this SQL statement to achieve this:


CREATE TABLE [dbo].[EmployeesAttendanceReportSource_Normal] (
[Indx] [int] NULL ,
[Department] [nvarchar] (90) NULL,
[ShortDay] [nvarchar] (50) NULL,
[AttDay] [SmallDateTime] NULL,
[ID] [int] NOT NULL
) ON [PRIMARY]
GO


ALTER TABLE [dbo].[EmployeesAttendanceReportSource_Normal] WITH NOCHECK ADD
CONSTRAINT [PK_EmployeesAttendanceReportSource_Normal] PRIMARY KEY CLUSTERED
(
[ID]
) ON [PRIMARY]
GO

GRANT REFERENCES , SELECT , UPDATE , INSERT , DELETE ON [dbo].[EmployeesAttendanceReportSource_Normal] TO [public]
GO

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-07-03 : 12:38:05
Open management studio - Expand table - right click index- create new index and choose however you want.
Or
Use create index command .Check Books online.
Go to Top of Page

accesser2003
Starting Member

14 Posts

Posted - 2008-07-03 : 12:47:59
Please Help Me.

Thanks,
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-07-03 : 12:48:35
I already helped you.
Go to Top of Page
   

- Advertisement -