October 24, 2016 at 8:16 pm
Comments posted to this topic are about the item Heaps and indexes
October 25, 2016 at 2:07 am
Very interesting!
Thanks!
🙂
October 25, 2016 at 2:22 am
Weird. I'm not a DBA so I likely didn't really understand, but I executed this:
select * from sys.indexes -- returned 159 rows
I then executed the first statement (CREATE TABLE) and again executed:
select * from sys.indexes -- returned 159 rows
Finally, I executed the second statement (CREATE NONCLUSTERED INDEX ) and again executed:
select * from sys.indexes -- returned 159 rows
The count of rows in sys.indexes didn't change from the first execution.
October 25, 2016 at 3:05 am
Good question, thanks.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
October 25, 2016 at 3:05 am
edwardwill (10/25/2016)
Weird. I'm not a DBA so I likely didn't really understand, but I executed this:select * from sys.indexes -- returned 159 rows
I then executed the first statement (CREATE TABLE) and again executed:
select * from sys.indexes -- returned 159 rows
Finally, I executed the second statement (CREATE NONCLUSTERED INDEX ) and again executed:
select * from sys.indexes -- returned 159 rows
The count of rows in sys.indexes didn't change from the first execution.
Did you execute the statements in the correct database context?
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
October 25, 2016 at 3:08 am
Koen Verbeeck (10/25/2016)
edwardwill (10/25/2016)
Weird. I'm not a DBA so I likely didn't really understand, but I executed this:select * from sys.indexes -- returned 159 rows
I then executed the first statement (CREATE TABLE) and again executed:
select * from sys.indexes -- returned 159 rows
Finally, I executed the second statement (CREATE NONCLUSTERED INDEX ) and again executed:
select * from sys.indexes -- returned 159 rows
The count of rows in sys.indexes didn't change from the first execution.
Did you execute the statements in the correct database context?
I executed the DDL statements against my test database, and the DML statements against master.
October 25, 2016 at 3:11 am
edwardwill (10/25/2016)
I executed the DDL statements against my test database, and the DML statements against master.
Then you get the index information of the master database.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
October 25, 2016 at 3:13 am
Koen Verbeeck (10/25/2016)
edwardwill (10/25/2016)
I executed the DDL statements against my test database, and the DML statements against master.
Then you get the index information of the master database.
Cool. I learnt something!
October 25, 2016 at 5:31 am
October 25, 2016 at 7:49 am
Thanks Steve for this interesting question and cleverly constructed combination of the answers... 😉
October 25, 2016 at 9:22 am
Too easy.
October 25, 2016 at 9:25 am
Hmm... It took me about 5 minutes. Thanks, Steve!
October 25, 2016 at 9:31 am
Revenant (10/25/2016)
Hmm... It took me about 5 minutes. Thanks, Steve!
That long? 😀
October 25, 2016 at 9:46 am
Lynn Pettis (10/25/2016)
Revenant (10/25/2016)
Hmm... It took me about 5 minutes. Thanks, Steve!That long? 😀
Yeah, that long. Well, maybe only 4. 😉
Viewing 14 posts - 1 through 13 (of 13 total)
You must be logged in to reply to this topic. Login to reply