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
 SQL Server 2008 Forums
 Transact-SQL (2008)
 t-sql in dmv is different when creating PK

Author  Topic 

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2011-01-28 : 14:27:31
if I run this:

alter table dbo.mytable add constraint PK_mytable primary key clustered (pkcol asc)

and then run adam machanic's sp_whoisactive (which is using sys.dm_exec_sql_text to get the t-sql) to see what's going on, I see this:

insert [dbo].[mytable] select * from [dbo].[mytable]

anyone know why this is? Just curious.


elsasoft.org
   

- Advertisement -