[ACCEPTED]-Are indexes on temporary tables deleted when the table is deleted?-temp-tables
Accepted answer
Yes they are. You can search in MSSQL help 4 for CREATE INDEX article it is said there:
"Indexes 3 can be created on a temporary table. When 2 the table is dropped or the session ends, all 1 indexes and triggers are dropped."
It will be removed automatically, as there 2 is nothing left to index. Think of it as 1 a child object in this respect.
The drop table will remove the index. Drop 4 Index takes the index name and the table 3 name.
In this case would be DROP INDEX idc 2 ON #tbl
which can be called if you want to 1 drop the index but leave the table.
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.