Re: Index's
From: Hugo Kornelis (hugo_at_pe_NO_rFact.in_SPAM_fo)
Date: 01/31/05
- Next message: Dan: "Replace Errors with NULL using Convert"
- Previous message: Phil: "Index's"
- In reply to: Phil: "Index's"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 31 Jan 2005 21:30:50 +0100
On Mon, 31 Jan 2005 09:13:05 -0800, Phil wrote:
>Hi All
>
>Another quick question, is it possible to put a index on a temp table and if
>so what is the syntax.
>
>Thanks Phil
Hi Phil,
Did you try it? Did you check BOL?
CREATE TABLE #temp (PK int NOT NULL,
Col1 char(4) NOT NULL,
Col2 varchar(20) DEFAULT NULL,
PRIMARY KEY (PK), -- creates an index
UNIQUE (Col1) -- creates another index
)
go
-- And here's a third way to create an index
CREATE INDEX tmpind ON #temp (Col2)
go
-- Check if it worked
sp_helpindex #temp
-- Clean up the mess
DROP INDEX #temp.tmpind
go
DROP TABLE #temp
go
Best, Hugo
-- (Remove _NO_ and _SPAM_ to get my e-mail address)
- Next message: Dan: "Replace Errors with NULL using Convert"
- Previous message: Phil: "Index's"
- In reply to: Phil: "Index's"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|