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 2005 Forums
 SQL Server Administration (2005)
 Syntax Error

Author  Topic 

coolerbob
Aged Yak Warrior

841 Posts

Posted - 2008-04-02 : 12:28:24
Does anyone know why this blows up with a syntax error?

declare @dbccpage table (
ParentObject sysname,
Object sysname,
Field sysname,
VALUE sysname
)
insert into @dbccpage
exec ('dbcc page (<dbid>, <file-id>, <page-in-file>) with TableResults')
select Field, VALUE
from @dbccpage
where Field like 'Metadata:%'

X002548
Not Just a Number

15586 Posts

Posted - 2008-04-02 : 13:21:17
It doesn't work with table variables

CREATE TABLE #dbccpage (
ParentObject sysname,
Object sysname,
Field sysname,
VALUE sysname
)

INSERT INTO #dbccpage
exec ('dbcc page (1, 1, 1) with TableResults')

SELECT * FROM #dbccpage
GO

DROP TABLE #dbccpage
GO




Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

coolerbob
Aged Yak Warrior

841 Posts

Posted - 2008-04-02 : 14:02:34
Thanks Brett! That'll go into the second edition of Ken Henderson's Practical Troubleshooting then...
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2008-04-02 : 14:08:45
> That'll go into the second edition of Ken Henderson's Practical Troubleshooting then...

don't think so... since he died

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
SSMS Add-in that does a few things: www.ssmstoolspack.com
Go to Top of Page

coolerbob
Aged Yak Warrior

841 Posts

Posted - 2008-04-02 : 14:14:55
Oh my goodness! I had no idea! That's terrible.
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2008-04-02 : 14:16:47
http://www.sqlteam.com/Forums/topic.asp?TOPIC_ID=96364

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
SSMS Add-in that does a few things: www.ssmstoolspack.com
Go to Top of Page
   

- Advertisement -