Home All Groups Group Topic Archive Search About

Can I create an index on a varable table

Author
8 Sep 2006 5:52 PM
SQL Ken
I have a table defined inside a function. Can I index it?
If so How?
please give me a simple sample code

thanks

ke n

Author
8 Sep 2006 6:00 PM
SQL Ken
found answer:
NO index can be created however,  you can have contraint

DECLARE @myTable TABLE
(
    CPK1 int,
    CPK2 int,
    PRIMARY KEY (CPK1, CPK2)
)


link:
http://databases.aspfaq.com/database/should-i-use-a-temp-table-or-a-table-variable.html




SQL Ken wrote:
Show quote
> I have a table defined inside a function. Can I index it?
> If so How?
> please give me a simple sample code
>
> thanks
>
> ke n

AddThis Social Bookmark Button