Showing posts with label object. Show all posts
Showing posts with label object. Show all posts

Thursday, March 22, 2012

Class not registered

Hi,

when i am trying to open a table from Microsoft Visua Studio 2005
I got the following error

Class Not Registered.Loking for object with classID:......

how resolve this?

Hi,

What is the class ID that it complains about. This seems more like a Visual Studio setup/installation issue than a SQL Server Data Access issue.

Thanks

Waseem

Class does not support aggregation

Class does not support aggregation (or class object is remote) (Exception from HRESULT: 0x80040110 (CLASS_E_NOAGGREGATION)) (Microsoft.SqlServer.SqlTools.VSIntegration)


Program Location:

at Microsoft.SqlServer.Management.UI.VSIntegration.ISqlToolsVSHlpFactory.CreateHierarchyWrapper(Guid& clsidInnerHier)
at Microsoft.SqlServer.Management.UI.VSIntegration.SqlWorkbenchHierarchy.CreateHierarchyWrapper(Type typeToWrap, ILocalRegistry localReg)
at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.ScriptFactory.get_SqlVirtualProject()
at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.VsDocumentMenuItem.InvokeDesigner(IManagedConnection connection)
at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.VsDocumentMenuItem.Invoke()Hi there,
I'm using SQL Server 2005 Dev. with Windows XP Pro. SP2.
50GB free space with 1GB of RAM
After I installed SQL Server with no problems.
I tried to open a table in AdventureWorks database and I'm getting an error:

Could some one tell me what is going on ?
Thanks an advanced
Oded Dror
Email: odeddror@.cox.net

I am using SQL Server 2k5 Dev Management Studio. I connected to SQL 2000; created a table with TSQL (using Query Editor); and then when I try to open it using Management Studio's "Modify" context menu option I am getting the same exception.

The table is opening fine in SQL 2000 Enterprise Manager, and I am able to update its definition using SQL2k EM's table designer.

===================================

Class does not support aggregation (or class object is remote) (Exception from HRESULT: 0x80040110 (CLASS_E_NOAGGREGATION)) (Microsoft.SqlServer.SqlTools.VSIntegration)


Program Location:

at Microsoft.SqlServer.Management.UI.VSIntegration.ISqlToolsVSHlpFactory.CreateHierarchyWrapper(Guid& clsidInnerHier)
at Microsoft.SqlServer.Management.UI.VSIntegration.SqlWorkbenchHierarchy.CreateHierarchyWrapper(Type typeToWrap, ILocalRegistry localReg)
at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.ScriptFactory.get_SqlVirtualProject()
at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.VsDocumentMenuItem.InvokeDesigner(IManagedConnection connection)
at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.VsDocumentMenuItem.Invoke()

|||Hi, did you guys solve this error by any chance? I'm getting it too, but my coleague who is working on a machine with the same configuration as mine, he is not receiving this error. Any suggestions?|||I also am stuck with the same error, has anybody solved this issue?|||

Found a FIX

I found another post that suggested this:

Remove Workstation componenents, then do a repair on Net Framework 2.0 then Re-Install workstation components. This worked for the other poster, I just tiried the same and it also worked for me.

I suggest following that exactly, I had had previously just done a repair on Net Framework and that did not help, I also had just re-installed workstation components and that hadnt worked, only the combination above worked for me.

|||Hi, Can you post the link? Thanks

- MLynch|||Very well! It helped me too!|||

Works for me too....

Used http://support.microsoft.com/default.aspx/kb/306160 to repair.

Class does not support aggregation

Class does not support aggregation (or class object is remote) (Exception from HRESULT: 0x80040110 (CLASS_E_NOAGGREGATION)) (Microsoft.SqlServer.SqlTools.VSIntegration)


Program Location:

at Microsoft.SqlServer.Management.UI.VSIntegration.ISqlToolsVSHlpFactory.CreateHierarchyWrapper(Guid& clsidInnerHier)
at Microsoft.SqlServer.Management.UI.VSIntegration.SqlWorkbenchHierarchy.CreateHierarchyWrapper(Type typeToWrap, ILocalRegistry localReg)
at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.ScriptFactory.get_SqlVirtualProject()
at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.VsDocumentMenuItem.InvokeDesigner(IManagedConnection connection)
at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.VsDocumentMenuItem.Invoke()Hi there,
I'm using SQL Server 2005 Dev. with Windows XP Pro. SP2.
50GB free space with 1GB of RAM
After I installed SQL Server with no problems.
I tried to open a table in AdventureWorks database and I'm getting an error:

Could some one tell me what is going on ?
Thanks an advanced
Oded Dror
Email: odeddror@.cox.net

I am using SQL Server 2k5 Dev Management Studio. I connected to SQL 2000; created a table with TSQL (using Query Editor); and then when I try to open it using Management Studio's "Modify" context menu option I am getting the same exception.

The table is opening fine in SQL 2000 Enterprise Manager, and I am able to update its definition using SQL2k EM's table designer.

===================================

Class does not support aggregation (or class object is remote) (Exception from HRESULT: 0x80040110 (CLASS_E_NOAGGREGATION)) (Microsoft.SqlServer.SqlTools.VSIntegration)


Program Location:

at Microsoft.SqlServer.Management.UI.VSIntegration.ISqlToolsVSHlpFactory.CreateHierarchyWrapper(Guid& clsidInnerHier)
at Microsoft.SqlServer.Management.UI.VSIntegration.SqlWorkbenchHierarchy.CreateHierarchyWrapper(Type typeToWrap, ILocalRegistry localReg)
at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.ScriptFactory.get_SqlVirtualProject()
at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.VsDocumentMenuItem.InvokeDesigner(IManagedConnection connection)
at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.VsDocumentMenuItem.Invoke()

|||Hi, did you guys solve this error by any chance? I'm getting it too, but my coleague who is working on a machine with the same configuration as mine, he is not receiving this error. Any suggestions?|||I also am stuck with the same error, has anybody solved this issue?|||

Found a FIX

I found another post that suggested this:

Remove Workstation componenents, then do a repair on Net Framework 2.0 then Re-Install workstation components. This worked for the other poster, I just tiried the same and it also worked for me.

I suggest following that exactly, I had had previously just done a repair on Net Framework and that did not help, I also had just re-installed workstation components and that hadnt worked, only the combination above worked for me.

|||Hi, Can you post the link? Thanks

- MLynch|||Very well! It helped me too!|||

Works for me too....

Used http://support.microsoft.com/default.aspx/kb/306160 to repair.

sqlsql

Class does not support aggregation

In Microsoft SQL Server Management Studio 2005 whenever I open a table I get
the error
Class does not support aggregation (or class object is remote) (Exception
from HRESULT: 0x80040110 (CLASS_E_NOAGGREGATION))
(Microsoft.SqlServer.SqlTools.VSIntegration)
I previously had SQL Server 2000 installed, but the upgrade worked
successfully.
Could someone please advise?
Many thanks
Richard.
Hello Richard,
This is a COM interop related issue:
http://msdn.microsoft.com/library/de...us/com/html/3b
414b95-e8d2-42e8-b4f2-5cc5189a3d08.asp
You may want to remove Workstation componenents, then do a repair on Net
Framework 2.0 then Re-Install workstation components to test:
http://forums.microsoft.com/MSDN/Sho...78936&SiteID=1
If the issue persists, please make sure you have removed all SQL 2000
components including SQL client tool to test the situation again.
Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ===
This posting is provided "AS IS" with no warranties, and confers no rights.
--
>Thread-Topic: Class does not support aggregation
>thread-index: AcYdzJqnv7Gvd6SmT+qRbL0nvajMoA==
>X-WBNR-Posting-Host: 194.131.103.210
>From: "=?Utf-8?B?UmljaA==?=" <richvista@.nospam.nospam>
>Subject: Class does not support aggregation
>Date: Fri, 20 Jan 2006 06:20:03 -0800
>Lines: 13
>Message-ID: <801EF9EE-69E9-4B04-902C-E7BC6C98D685@.microsoft.com>
>MIME-Version: 1.0
>Content-Type: text/plain;
>charset="Utf-8"
>Content-Transfer-Encoding: 7bit
>X-Newsreader: Microsoft CDO for Windows 2000
>Content-Class: urn:content-classes:message
>Importance: normal
>Priority: normal
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
>Newsgroups: microsoft.public.sqlserver.server
>NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
>Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGXA03.phx.gbl
>Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.sqlserver.server:418324
>X-Tomcat-NG: microsoft.public.sqlserver.server
>In Microsoft SQL Server Management Studio 2005 whenever I open a table I
get
>the error
>--
>Class does not support aggregation (or class object is remote) (Exception
>from HRESULT: 0x80040110 (CLASS_E_NOAGGREGATION))
>(Microsoft.SqlServer.SqlTools.VSIntegration)
>I previously had SQL Server 2000 installed, but the upgrade worked
>successfully.
>Could someone please advise?
>Many thanks
>Richard.
>
|||Thank you Peter, I did as you suggested and it now works ok.
"Peter Yang [MSFT]" wrote:

> Hello Richard,
> This is a COM interop related issue:
> http://msdn.microsoft.com/library/de...us/com/html/3b
> 414b95-e8d2-42e8-b4f2-5cc5189a3d08.asp
> You may want to remove Workstation componenents, then do a repair on Net
> Framework 2.0 then Re-Install workstation components to test:
> http://forums.microsoft.com/MSDN/Sho...78936&SiteID=1
> If the issue persists, please make sure you have removed all SQL 2000
> components including SQL client tool to test the situation again.
> Regards,
> Peter Yang
> MCSE2000/2003, MCSA, MCDBA
> Microsoft Online Partner Support
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ================================================== ===
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> --
> get
>

Class does not support aggregation

In Microsoft SQL Server Management Studio 2005 whenever I open a table I get
the error
--
Class does not support aggregation (or class object is remote) (Exception
from HRESULT: 0x80040110 (CLASS_E_NOAGGREGATION))
(Microsoft.SqlServer.SqlTools.VSIntegration)
I previously had SQL Server 2000 installed, but the upgrade worked
successfully.
Could someone please advise?
Many thanks
Richard.Hello Richard,
This is a COM interop related issue:
http://msdn.microsoft.com/library/d...-us/com/html/3b
414b95-e8d2-42e8-b4f2-5cc5189a3d08.asp
You may want to remove Workstation componenents, then do a repair on Net
Framework 2.0 then Re-Install workstation components to test:
http://forums.microsoft.com/MSDN/Sh...178936&SiteID=1
If the issue persists, please make sure you have removed all SQL 2000
components including SQL client tool to test the situation again.
Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
=============
This posting is provided "AS IS" with no warranties, and confers no rights.
--
>Thread-Topic: Class does not support aggregation
>thread-index: AcYdzJqnv7Gvd6SmT+qRbL0nvajMoA==
>X-WBNR-Posting-Host: 194.131.103.210
>From: "examnotes" <richvista@.nospam.nospam>
>Subject: Class does not support aggregation
>Date: Fri, 20 Jan 2006 06:20:03 -0800
>Lines: 13
>Message-ID: <801EF9EE-69E9-4B04-902C-E7BC6C98D685@.microsoft.com>
>MIME-Version: 1.0
>Content-Type: text/plain;
> charset="Utf-8"
>Content-Transfer-Encoding: 7bit
>X-Newsreader: Microsoft CDO for Windows 2000
>Content-Class: urn:content-classes:message
>Importance: normal
>Priority: normal
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
>Newsgroups: microsoft.public.sqlserver.server
>NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
>Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGXA03.phx.gbl
>Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.sqlserver.server:418324
>X-Tomcat-NG: microsoft.public.sqlserver.server
>In Microsoft SQL Server Management Studio 2005 whenever I open a table I
get
>the error
>--
>Class does not support aggregation (or class object is remote) (Exception
>from HRESULT: 0x80040110 (CLASS_E_NOAGGREGATION))
>(Microsoft.SqlServer.SqlTools.VSIntegration)
>I previously had SQL Server 2000 installed, but the upgrade worked
>successfully.
>Could someone please advise?
>Many thanks
>Richard.
>|||Thank you Peter, I did as you suggested and it now works ok.
"Peter Yang [MSFT]" wrote:

> Hello Richard,
> This is a COM interop related issue:
> l]
> 414b95-e8d2-42e8-b4f2-5cc5189a3d08.asp
> You may want to remove Workstation componenents, then do a repair on Net
> Framework 2.0 then Re-Install workstation components to test:
> [url]http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=178936&SiteID=1" target="_blank">http://msdn.microsoft.com/library/d...178936&SiteID=1
> If the issue persists, please make sure you have removed all SQL 2000
> components including SQL client tool to test the situation again.
> Regards,
> Peter Yang
> MCSE2000/2003, MCSA, MCDBA
> Microsoft Online Partner Support
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ========================================
=============
>
> This posting is provided "AS IS" with no warranties, and confers no rights
.
>
> --
> get
>

Class does not support aggregation

Class does not support aggregation (or class object is remote) (Exception from HRESULT: 0x80040110 (CLASS_E_NOAGGREGATION)) (Microsoft.SqlServer.SqlTools.VSIntegration)


Program Location:

at Microsoft.SqlServer.Management.UI.VSIntegration.ISqlToolsVSHlpFactory.CreateHierarchyWrapper(Guid& clsidInnerHier)
at Microsoft.SqlServer.Management.UI.VSIntegration.SqlWorkbenchHierarchy.CreateHierarchyWrapper(Type typeToWrap, ILocalRegistry localReg)
at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.ScriptFactory.get_SqlVirtualProject()
at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.VsDocumentMenuItem.InvokeDesigner(IManagedConnection connection)
at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.VsDocumentMenuItem.Invoke()Hi there,
I'm using SQL Server 2005 Dev. with Windows XP Pro. SP2.
50GB free space with 1GB of RAM
After I installed SQL Server with no problems.
I tried to open a table in AdventureWorks database and I'm getting an error:

Could some one tell me what is going on ?
Thanks an advanced
Oded Dror
Email: odeddror@.cox.net

I am using SQL Server 2k5 Dev Management Studio. I connected to SQL 2000; created a table with TSQL (using Query Editor); and then when I try to open it using Management Studio's "Modify" context menu option I am getting the same exception.

The table is opening fine in SQL 2000 Enterprise Manager, and I am able to update its definition using SQL2k EM's table designer.

===================================

Class does not support aggregation (or class object is remote) (Exception from HRESULT: 0x80040110 (CLASS_E_NOAGGREGATION)) (Microsoft.SqlServer.SqlTools.VSIntegration)


Program Location:

at Microsoft.SqlServer.Management.UI.VSIntegration.ISqlToolsVSHlpFactory.CreateHierarchyWrapper(Guid& clsidInnerHier)
at Microsoft.SqlServer.Management.UI.VSIntegration.SqlWorkbenchHierarchy.CreateHierarchyWrapper(Type typeToWrap, ILocalRegistry localReg)
at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.ScriptFactory.get_SqlVirtualProject()
at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.VsDocumentMenuItem.InvokeDesigner(IManagedConnection connection)
at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.VsDocumentMenuItem.Invoke()

|||Hi, did you guys solve this error by any chance? I'm getting it too, but my coleague who is working on a machine with the same configuration as mine, he is not receiving this error. Any suggestions?|||I also am stuck with the same error, has anybody solved this issue?|||

Found a FIX

I found another post that suggested this:

Remove Workstation componenents, then do a repair on Net Framework 2.0 then Re-Install workstation components. This worked for the other poster, I just tiried the same and it also worked for me.

I suggest following that exactly, I had had previously just done a repair on Net Framework and that did not help, I also had just re-installed workstation components and that hadnt worked, only the combination above worked for me.

|||Hi, Can you post the link? Thanks
- MLynch
|||Very well! It helped me too!|||

Works for me too....

Used http://support.microsoft.com/default.aspx/kb/306160 to repair.

Class does not support aggregation

In Microsoft SQL Server Management Studio 2005 whenever I open a table I get
the error
--
Class does not support aggregation (or class object is remote) (Exception
from HRESULT: 0x80040110 (CLASS_E_NOAGGREGATION))
(Microsoft.SqlServer.SqlTools.VSIntegration)
I previously had SQL Server 2000 installed, but the upgrade worked
successfully.
Could someone please advise?
Many thanks
Richard.Hello Richard,
This is a COM interop related issue:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/com/html/3b
414b95-e8d2-42e8-b4f2-5cc5189a3d08.asp
You may want to remove Workstation componenents, then do a repair on Net
Framework 2.0 then Re-Install workstation components to test:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=178936&SiteID=1
If the issue persists, please make sure you have removed all SQL 2000
components including SQL client tool to test the situation again.
Regards,
Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
>Thread-Topic: Class does not support aggregation
>thread-index: AcYdzJqnv7Gvd6SmT+qRbL0nvajMoA==>X-WBNR-Posting-Host: 194.131.103.210
>From: "=?Utf-8?B?UmljaA==?=" <richvista@.nospam.nospam>
>Subject: Class does not support aggregation
>Date: Fri, 20 Jan 2006 06:20:03 -0800
>Lines: 13
>Message-ID: <801EF9EE-69E9-4B04-902C-E7BC6C98D685@.microsoft.com>
>MIME-Version: 1.0
>Content-Type: text/plain;
> charset="Utf-8"
>Content-Transfer-Encoding: 7bit
>X-Newsreader: Microsoft CDO for Windows 2000
>Content-Class: urn:content-classes:message
>Importance: normal
>Priority: normal
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
>Newsgroups: microsoft.public.sqlserver.server
>NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
>Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGXA03.phx.gbl
>Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.sqlserver.server:418324
>X-Tomcat-NG: microsoft.public.sqlserver.server
>In Microsoft SQL Server Management Studio 2005 whenever I open a table I
get
>the error
>--
>Class does not support aggregation (or class object is remote) (Exception
>from HRESULT: 0x80040110 (CLASS_E_NOAGGREGATION))
>(Microsoft.SqlServer.SqlTools.VSIntegration)
>I previously had SQL Server 2000 installed, but the upgrade worked
>successfully.
>Could someone please advise?
>Many thanks
>Richard.
>|||Thank you Peter, I did as you suggested and it now works ok.
"Peter Yang [MSFT]" wrote:
> Hello Richard,
> This is a COM interop related issue:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/com/html/3b
> 414b95-e8d2-42e8-b4f2-5cc5189a3d08.asp
> You may want to remove Workstation componenents, then do a repair on Net
> Framework 2.0 then Re-Install workstation components to test:
> http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=178936&SiteID=1
> If the issue persists, please make sure you have removed all SQL 2000
> components including SQL client tool to test the situation again.
> Regards,
> Peter Yang
> MCSE2000/2003, MCSA, MCDBA
> Microsoft Online Partner Support
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> =====================================================>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> --
> >Thread-Topic: Class does not support aggregation
> >thread-index: AcYdzJqnv7Gvd6SmT+qRbL0nvajMoA==> >X-WBNR-Posting-Host: 194.131.103.210
> >From: "=?Utf-8?B?UmljaA==?=" <richvista@.nospam.nospam>
> >Subject: Class does not support aggregation
> >Date: Fri, 20 Jan 2006 06:20:03 -0800
> >Lines: 13
> >Message-ID: <801EF9EE-69E9-4B04-902C-E7BC6C98D685@.microsoft.com>
> >MIME-Version: 1.0
> >Content-Type: text/plain;
> > charset="Utf-8"
> >Content-Transfer-Encoding: 7bit
> >X-Newsreader: Microsoft CDO for Windows 2000
> >Content-Class: urn:content-classes:message
> >Importance: normal
> >Priority: normal
> >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
> >Newsgroups: microsoft.public.sqlserver.server
> >NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
> >Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGXA03.phx.gbl
> >Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.sqlserver.server:418324
> >X-Tomcat-NG: microsoft.public.sqlserver.server
> >
> >In Microsoft SQL Server Management Studio 2005 whenever I open a table I
> get
> >the error
> >--
> >
> >Class does not support aggregation (or class object is remote) (Exception
> >from HRESULT: 0x80040110 (CLASS_E_NOAGGREGATION))
> >(Microsoft.SqlServer.SqlTools.VSIntegration)
> >
> >I previously had SQL Server 2000 installed, but the upgrade worked
> >successfully.
> >Could someone please advise?
> >Many thanks
> >Richard.
> >
>sqlsql

Wednesday, March 7, 2012

checksum_agg and row size error. Require explanation.

Hi,

I can see that by using the object ID rather that the object name, the
following SQL query works. Has anybody got any idea what is causing the
error?

-- Works OK
select o.id
,checksum_agg(binary_checksum(m.text))
from sysobjects o
,syscomments m
where o.id = m.id
and o.xtype in ('FN','IF','P','TF','TR','V')
group by o.id

-- Error
-- Server: Msg 1540, Level 16, State 1, Line 1
-- Cannot sort a row of size 8096, which is greater than the
-- allowable maximum of 8094.
select object_name(o.id)
,checksum_agg(binary_checksum(m.text))
from sysobjects o
,syscomments m
where o.id = m.id
and o.xtype in ('FN','IF','P','TF','TR','V')
group by object_name(o.id)

-- Error
-- Server: Msg 1540, Level 16, State 1, Line 1
-- Cannot sort a row of size 8096, which is greater than the
-- allowable maximum of 8094.
select o.name
,checksum_agg(binary_checksum(m.text))
from sysobjects o
,syscomments m
where o.id = m.id
and o.xtype in ('FN','IF','P','TF','TR','V')
group by o.name

-- Workaround
select getdate()
,object_name(x.id)
,check_sum
from (select m.id
,checksum_agg(binary_checksum(m.text)) as check_sum
from syscomments m
inner join
sysobjects o
on m.id = o.id
where o.xtype in ('FN','IF','P','TF','TR','V')
group by m.id) as x

Regards

LiamUse "OPTION (ROBUST PLAN)":

select o.name
,checksum_agg(binary_checksum(*m.text))
from sysobjects o
,syscomments m
where o.id = m.id
and o.xtype in ('FN','IF','P','TF','TR','V')
group by o.name
OPTION (ROBUST PLAN)

This forces SQL Server to use a plan that works for the maximum
potential row size.

Razvan

Friday, February 24, 2012

checking the SELECT statement for an SqlDataAdapter

I'm trying to pass a querystring to an SqlDataAdapter object. To check if the query is a valid SELECT statement, I simply use a try-catch. But dispite the try-catch it still accepts valid INSERT statements. However, in the parameterlist of the SqlDataAdapter the required parameter is a Transact SQL SELECT statement or a stored procedure... Am I doing something wrong?
 Here is my code:
try{ my_conn = conn_open(); da =new SqlDataAdapter(query, my_conn); da.Fill(result.resultDataset); my_conn.Dispose();}catch (Exception e){ result.errMsg ="Database Error: " + e.Message; result.success =false;}
Kehil

Kehil:

However, in the parameterlist of the SqlDataAdapter the required parameter is a Transact SQL SELECT statement or a stored procedure... Am I doing something wrong?

How do you know the parameterlist makes the SqlDataAdapter accpets only SELECT statement or SP? Actually when you create a SqlDataAdapter with a SqlCommand, the SqlCommand is used as SqlDataAdapter.SelectCommand, but this does not mean the SqlCommand must be a SELECT statement. If you want to validate SqlDataAdapter.SelectCommand, you need to validate the SqlCommand.CommandText to make sure it doesn't cotain any words like INSERT (but if there is a column named "INSERT" returned by a SELECT query, the statement will also considered invalid). So, such validation seems to make no sense.

Checking that an object is not empty

Hi,

Does anyone know the correct syntax to check the contents of an object variable. I want to do this as part of a constraint,

TIA

R

Variables of type Object are not support in expressions -

"The data type of variable "User::Variable" is not supported in an expression."

|||

Thanks for your reply.

I have a problem then. I want to pass in this object to use in an ExecuteSQL task, as my input parameter. However, because of some conditional execution, there may not be anything to update. This means that the object has nothing in it, and at the moment. This is causing my task to fail.

Any ideas?

|||

You could read the object variable inside a script task, and check for it equalling Nothing.

Then set a boolean variable indicating whether it is populated or not and put an expression on the precedence constraint that checks the boolean variable to see whether it should execute or not.

-Jamie

checking object usage

Hello,
I'm entering an existing project that has hunderds of views.
I was wondering how can I get usage statistics for the views - which
ones are in use, which aren't, when were they in use, etc.
Thanks in advance,
R. GreenHi
sp_depends may tell you some information about where the view is used but it
does not always give you everything. Alternatively if you are using stored
procedures for access and have scripted them into text files you can
manually search for your views in them.
You may be able to get some idea of usage from analysing output from SQL
profiler, if you use stored procedures it will not be direct access i.e. you
will know if procedure X is called then it uses your view.
John
"Ronald Green" <zzzbla@.gmail.com> wrote in message
news:1145515140.295473.276370@.v46g2000cwv.googlegroups.com...
> Hello,
> I'm entering an existing project that has hunderds of views.
> I was wondering how can I get usage statistics for the views - which
> ones are in use, which aren't, when were they in use, etc.
> Thanks in advance,
> R. Green
>|||Hi John,
thanks for your quick reply.
I'm looking for information like how often a view is used / when was it
last used.
I can't run a profiler on this (production) server and there are hardly
any stored procedures used. Most of the views are used within DTS
packages
Thanks in advnace,
R. Green|||It's a good question, and one I've seen a few times recently. There
must be an app that actually profiles the access of objects instead of
the references in stored procedures. Please post if there is, otherwise
I think I'll write one, I mean we've got the execution plans from
profiler traces, so parsing them and building up some stats can't be
"that" big a deal.|||Hi Ronald
If you can't run profiler then it is unlikely that you will be allowed to
run any other tool. Sampling using say DBCC INPUTBUFFER will give you less
comprehensive information and therefore be less reliable. Either method may
miss a reference to a view used in a very rarely run report.
For the changes you intend to make you will need a test system and full
regression test to make sure that removing anything does not break your
system.
John
"Ronald Green" <zzzbla@.gmail.com> wrote in message
news:1145519552.676946.39150@.j33g2000cwa.googlegroups.com...
> Hi John,
> thanks for your quick reply.
> I'm looking for information like how often a view is used / when was it
> last used.
> I can't run a profiler on this (production) server and there are hardly
> any stored procedures used. Most of the views are used within DTS
> packages
> Thanks in advnace,
> R. Green
>|||hey,
so no 'last accessed date' on views, eh? :)|||Ronald Green (zzzbla@.gmail.com) writes:
> hey,
> so no 'last accessed date' on views, eh? :)
Right. No such thing.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

Tuesday, February 14, 2012

CHECKDB and Object ID 0

Can someone please tell me what "Object ID 0" is? It does not exist in
sysobjects and I can find a reference in BOL or in the groups/forums...
I am trying to anlyze the first line returned from DBCC CHECKDB
Server: Msg 8909, Level 16, State 1, Line 1
Table error: Object ID 0, index ID 0, page ID (1:23953). The PageId in
the page header = (0:120).
Thanks!Hi Dave
Error 8909 is documented in Books Online which advises to check for hardware
problems and then restore from a good back.
John
"Dave" wrote:

> Can someone please tell me what "Object ID 0" is? It does not exist in
> sysobjects and I can find a reference in BOL or in the groups/forums...
> I am trying to anlyze the first line returned from DBCC CHECKDB
> Server: Msg 8909, Level 16, State 1, Line 1
> Table error: Object ID 0, index ID 0, page ID (1:23953). The PageId in
> the page header = (0:120).
> Thanks!
>|||Yes, I saw that. We had a hard drive fail in a Raid 5 array.
I am planning on doing the restore today, but I would still like to
know what object "ojbect id 0" is. Any ideas?
John Bell wrote:[vbcol=seagreen]
> Hi Dave
> Error 8909 is documented in Books Online which advises to check for hardwa
re
> problems and then restore from a good back.
> John
> "Dave" wrote:
>|||Yes, I saw that. We had a hard drive fail in a Raid 5 array.
I am planning on doing the restore today, but I would still like to
know what object "ojbect id 0" is. Any ideas?
John Bell wrote:[vbcol=seagreen]
> Hi Dave
> Error 8909 is documented in Books Online which advises to check for hardwa
re
> problems and then restore from a good back.
> John
> "Dave" wrote:
>|||Hi Dave
I believe it is corrupted data.
John
"Dave" wrote:

> Yes, I saw that. We had a hard drive fail in a Raid 5 array.
> I am planning on doing the restore today, but I would still like to
> know what object "ojbect id 0" is. Any ideas?
>
> John Bell wrote:
>

CHECKDB and Object ID 0

Can someone please tell me what "Object ID 0" is? It does not exist in
sysobjects and I can find a reference in BOL or in the groups/forums...
I am trying to anlyze the first line returned from DBCC CHECKDB
Server: Msg 8909, Level 16, State 1, Line 1
Table error: Object ID 0, index ID 0, page ID (1:23953). The PageId in
the page header = (0:120).
Thanks!Hi Dave
Error 8909 is documented in Books Online which advises to check for hardware
problems and then restore from a good back.
John
"Dave" wrote:
> Can someone please tell me what "Object ID 0" is? It does not exist in
> sysobjects and I can find a reference in BOL or in the groups/forums...
> I am trying to anlyze the first line returned from DBCC CHECKDB
> Server: Msg 8909, Level 16, State 1, Line 1
> Table error: Object ID 0, index ID 0, page ID (1:23953). The PageId in
> the page header = (0:120).
> Thanks!
>|||Yes, I saw that. We had a hard drive fail in a Raid 5 array.
I am planning on doing the restore today, but I would still like to
know what object "ojbect id 0" is. Any ideas?
John Bell wrote:
> Hi Dave
> Error 8909 is documented in Books Online which advises to check for hardware
> problems and then restore from a good back.
> John
> "Dave" wrote:
> > Can someone please tell me what "Object ID 0" is? It does not exist in
> > sysobjects and I can find a reference in BOL or in the groups/forums...
> >
> > I am trying to anlyze the first line returned from DBCC CHECKDB
> >
> > Server: Msg 8909, Level 16, State 1, Line 1
> > Table error: Object ID 0, index ID 0, page ID (1:23953). The PageId in
> > the page header = (0:120).
> >
> > Thanks!
> >
> >|||Yes, I saw that. We had a hard drive fail in a Raid 5 array.
I am planning on doing the restore today, but I would still like to
know what object "ojbect id 0" is. Any ideas?
John Bell wrote:
> Hi Dave
> Error 8909 is documented in Books Online which advises to check for hardware
> problems and then restore from a good back.
> John
> "Dave" wrote:
> > Can someone please tell me what "Object ID 0" is? It does not exist in
> > sysobjects and I can find a reference in BOL or in the groups/forums...
> >
> > I am trying to anlyze the first line returned from DBCC CHECKDB
> >
> > Server: Msg 8909, Level 16, State 1, Line 1
> > Table error: Object ID 0, index ID 0, page ID (1:23953). The PageId in
> > the page header = (0:120).
> >
> > Thanks!
> >
> >|||Hi Dave
I believe it is corrupted data.
John
"Dave" wrote:
> Yes, I saw that. We had a hard drive fail in a Raid 5 array.
> I am planning on doing the restore today, but I would still like to
> know what object "ojbect id 0" is. Any ideas?
>
> John Bell wrote:
> > Hi Dave
> >
> > Error 8909 is documented in Books Online which advises to check for hardware
> > problems and then restore from a good back.
> >
> > John
> >
> > "Dave" wrote:
> >
> > > Can someone please tell me what "Object ID 0" is? It does not exist in
> > > sysobjects and I can find a reference in BOL or in the groups/forums...
> > >
> > > I am trying to anlyze the first line returned from DBCC CHECKDB
> > >
> > > Server: Msg 8909, Level 16, State 1, Line 1
> > > Table error: Object ID 0, index ID 0, page ID (1:23953). The PageId in
> > > the page header = (0:120).
> > >
> > > Thanks!
> > >
> > >
>

Friday, February 10, 2012

Check Temp table size?

I have a tempdb which fills up the disk frequently. I want to determine the
size of each object in the tempdb.
I used EXEC sp_spaceused '#temptablename'. I got the "#temptablename" does
not exist error. I got the temp table names from INFORMATION_SCHEMA.TABLES.
Since the temp tables only valid for their own session, how can I check its
size of temp tables through Query Analyzer?
Another question is how to analyze the log file space usage? The log file
for my TempDB grows dramatically fast too. I need understand the reason.
Thanks a lot,
FL
EXEC tempdb..spaceused '#temptablename'
http://www.aspfaq.com/
(Reverse address to reply.)
"FLX" <nospam@.hotmail.com> wrote in message
news:e$uxjy91EHA.3368@.TK2MSFTNGP10.phx.gbl...
> I have a tempdb which fills up the disk frequently. I want to determine
the
> size of each object in the tempdb.
> I used EXEC sp_spaceused '#temptablename'. I got the "#temptablename" does
> not exist error. I got the temp table names from
INFORMATION_SCHEMA.TABLES.
> Since the temp tables only valid for their own session, how can I check
its
> size of temp tables through Query Analyzer?
> Another question is how to analyze the log file space usage? The log file
> for my TempDB grows dramatically fast too. I need understand the reason.
> Thanks a lot,
> FL
>
>
>
>
|||Thanks.
It did not solve my problem. Maybe my question was not clear. The
#temptablename was created in the stored procedure. Since it is a local temp
table, I can not access it from the Query Analyzer. What is the workaround?
I know if it is a global temp table I can access it.
FL
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:%23sIQO391EHA.1396@.tk2msftngp13.phx.gbl...[vbcol=seagreen]
> EXEC tempdb..spaceused '#temptablename'
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "FLX" <nospam@.hotmail.com> wrote in message
> news:e$uxjy91EHA.3368@.TK2MSFTNGP10.phx.gbl...
> the
does[vbcol=seagreen]
> INFORMATION_SCHEMA.TABLES.
> its
file
>
|||You want to check the size of a temp table created in a stored procedure,
from query analyzer OUTSIDE the scope of the stored procedure?
I don't think this is possible, unless you manually inspect
tempdb..sysobjects and guess which table is from the specific stored
procedure scope you are interested in. What do you expect will happen when
the stored procedure is being executed by 12 different people
simultaneously? Since the temp table only lives for the scope of the stored
procedure, why do you care aout its size OUTSIDE of that scope?
http://www.aspfaq.com/
(Reverse address to reply.)
"FLX" <nospam@.hotmail.com> wrote in message
news:u46sZM$1EHA.4004@.tk2msftngp13.phx.gbl...
> Thanks.
> It did not solve my problem. Maybe my question was not clear. The
> #temptablename was created in the stored procedure. Since it is a local
temp
> table, I can not access it from the Query Analyzer. What is the
workaround?[vbcol=seagreen]
> I know if it is a global temp table I can access it.
> FL
>
>
>
> "Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
> news:%23sIQO391EHA.1396@.tk2msftngp13.phx.gbl...
determine[vbcol=seagreen]
> does
check[vbcol=seagreen]
> file
reason.
>
|||> I don't think this is possible, unless you manually inspect
> tempdb..sysobjects and guess which table is from the specific stored
> procedure scope you are interested in.
This is unfortunate.

>What do you expect will happen when
> the stored procedure is being executed by 12 different people
> simultaneously?
I expect 12 temp tables with unique Table Names stored in the database.
Let's say there is a temp table "#tempTable" is created in the stored
procedure. Two people simultaneously execute the stored procedure. When I
ran the following query,
use tempdb
go
select *
FROM INFORMATION_SCHEMA.TABLES
In the tablename column, I saw:
#tempTable________________________________________ __________________________
_________________________________________000000058 617
#tempTable________________________________________ __________________________
_________________________________________000000058 628
Please notice the appendix are different.

>Since the temp table only lives for the scope of the stored
> procedure, why do you care aout its size OUTSIDE of that scope?
My tempdb is too large and I want to figure out the cause. One obvious
reason is that we used too many temp tables created in the stored
procedures. I know theoritically the temp table will be automatically
dropped when the stored procedure exits. However, I don't why my tempdb size
keeps growing and can not be shrinked.
Thanks a lot.
|||>
#tempTable________________________________________ __________________________
> _________________________________________000000058 617
>
#tempTable________________________________________ __________________________
> _________________________________________000000058 628
> Please notice the appendix are different.
Yes, those suffixes are generated by SQL Server internally to track #temp
tables from different sessions. Again, you would have to guess which one is
which.

> However, I don't why my tempdb size
> keeps growing and can not be shrinked.
http://www.aspfaq.com/2446
http://www.aspfaq.com/2471
|||> > However, I don't why my tempdb size
> http://www.aspfaq.com/2446
> http://www.aspfaq.com/2471
>
Very helpful link. However, when I ran the following query:
USE tempdb
GO
EXEC sp_spaceused @.updateusage = 'TRUE'
I got the result like:
database_name
database_size unallocated space
--- --
-- --
tempdb
4425.94 MB 4140.27 MB
reserved data index_size unused
-- -- -- --
624 KB 216 KB 320 KB 88 KB
My questions are:
1. What does the unallocated space mean? Free space? Unused space? Why I can
not reclaim the such space by shrinking db?
2.The data and index add up together are only 216 + 320 = 536 KB. It is less
than 1 MB. Why my tempdb is so large (> 4GB)? Any hint?
Thanks
|||The possible reasons for tempdb growth are listed in that article. Why is
your tempdb so large? I have no idea. Probably one or more of those
reasons. Why can't you shrink it? I have no idea. What else is going on
in the system? What command are you using to shrink the database? Does it
complete successfully, or do you get an error? If you get an error, what is
it?
http://www.aspfaq.com/
(Reverse address to reply.)
"FLX" <nospam@.hotmail.com> wrote in message
news:uDHsq7H2EHA.936@.TK2MSFTNGP12.phx.gbl...
> Very helpful link. However, when I ran the following query:
> USE tempdb
> GO
> EXEC sp_spaceused @.updateusage = 'TRUE'
> I got the result like:
> database_name
> database_size unallocated space
> --- --
--
> -- --
> tempdb
> 4425.94 MB 4140.27 MB
>
> reserved data index_size unused
> -- -- -- --
> 624 KB 216 KB 320 KB 88 KB
>
> My questions are:
> 1. What does the unallocated space mean? Free space? Unused space? Why I
can
> not reclaim the such space by shrinking db?
> 2.The data and index add up together are only 216 + 320 = 536 KB. It is
less
> than 1 MB. Why my tempdb is so large (> 4GB)? Any hint?
> Thanks
>
>
>

Check Temp table size?

I have a tempdb which fills up the disk frequently. I want to determine the
size of each object in the tempdb.
I used EXEC sp_spaceused '#temptablename'. I got the "#temptablename" does
not exist error. I got the temp table names from INFORMATION_SCHEMA.TABLES.
Since the temp tables only valid for their own session, how can I check its
size of temp tables through Query Analyzer?
Another question is how to analyze the log file space usage? The log file
for my TempDB grows dramatically fast too. I need understand the reason.
Thanks a lot,
FLEXEC tempdb..spaceused '#temptablename'
--
http://www.aspfaq.com/
(Reverse address to reply.)
"FLX" <nospam@.hotmail.com> wrote in message
news:e$uxjy91EHA.3368@.TK2MSFTNGP10.phx.gbl...
> I have a tempdb which fills up the disk frequently. I want to determine
the
> size of each object in the tempdb.
> I used EXEC sp_spaceused '#temptablename'. I got the "#temptablename" does
> not exist error. I got the temp table names from
INFORMATION_SCHEMA.TABLES.
> Since the temp tables only valid for their own session, how can I check
its
> size of temp tables through Query Analyzer?
> Another question is how to analyze the log file space usage? The log file
> for my TempDB grows dramatically fast too. I need understand the reason.
> Thanks a lot,
> FL
>
>
>
>|||Thanks.
It did not solve my problem. Maybe my question was not clear. The
#temptablename was created in the stored procedure. Since it is a local temp
table, I can not access it from the Query Analyzer. What is the workaround?
I know if it is a global temp table I can access it.
FL
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:%23sIQO391EHA.1396@.tk2msftngp13.phx.gbl...
> EXEC tempdb..spaceused '#temptablename'
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "FLX" <nospam@.hotmail.com> wrote in message
> news:e$uxjy91EHA.3368@.TK2MSFTNGP10.phx.gbl...
> > I have a tempdb which fills up the disk frequently. I want to determine
> the
> > size of each object in the tempdb.
> >
> > I used EXEC sp_spaceused '#temptablename'. I got the "#temptablename"
does
> > not exist error. I got the temp table names from
> INFORMATION_SCHEMA.TABLES.
> > Since the temp tables only valid for their own session, how can I check
> its
> > size of temp tables through Query Analyzer?
> >
> > Another question is how to analyze the log file space usage? The log
file
> > for my TempDB grows dramatically fast too. I need understand the reason.
> >
> > Thanks a lot,
> > FL
> >
> >
> >
> >
> >
> >
> >
>|||You want to check the size of a temp table created in a stored procedure,
from query analyzer OUTSIDE the scope of the stored procedure?
I don't think this is possible, unless you manually inspect
tempdb..sysobjects and guess which table is from the specific stored
procedure scope you are interested in. What do you expect will happen when
the stored procedure is being executed by 12 different people
simultaneously? Since the temp table only lives for the scope of the stored
procedure, why do you care aout its size OUTSIDE of that scope?
--
http://www.aspfaq.com/
(Reverse address to reply.)
"FLX" <nospam@.hotmail.com> wrote in message
news:u46sZM$1EHA.4004@.tk2msftngp13.phx.gbl...
> Thanks.
> It did not solve my problem. Maybe my question was not clear. The
> #temptablename was created in the stored procedure. Since it is a local
temp
> table, I can not access it from the Query Analyzer. What is the
workaround?
> I know if it is a global temp table I can access it.
> FL
>
>
>
> "Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
> news:%23sIQO391EHA.1396@.tk2msftngp13.phx.gbl...
> > EXEC tempdb..spaceused '#temptablename'
> >
> > --
> > http://www.aspfaq.com/
> > (Reverse address to reply.)
> >
> >
> >
> >
> > "FLX" <nospam@.hotmail.com> wrote in message
> > news:e$uxjy91EHA.3368@.TK2MSFTNGP10.phx.gbl...
> > > I have a tempdb which fills up the disk frequently. I want to
determine
> > the
> > > size of each object in the tempdb.
> > >
> > > I used EXEC sp_spaceused '#temptablename'. I got the "#temptablename"
> does
> > > not exist error. I got the temp table names from
> > INFORMATION_SCHEMA.TABLES.
> > > Since the temp tables only valid for their own session, how can I
check
> > its
> > > size of temp tables through Query Analyzer?
> > >
> > > Another question is how to analyze the log file space usage? The log
> file
> > > for my TempDB grows dramatically fast too. I need understand the
reason.
> > >
> > > Thanks a lot,
> > > FL
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> >
> >
>|||> I don't think this is possible, unless you manually inspect
> tempdb..sysobjects and guess which table is from the specific stored
> procedure scope you are interested in.
This is unfortunate.
>What do you expect will happen when
> the stored procedure is being executed by 12 different people
> simultaneously?
I expect 12 temp tables with unique Table Names stored in the database.
Let's say there is a temp table "#tempTable" is created in the stored
procedure. Two people simultaneously execute the stored procedure. When I
ran the following query,
use tempdb
go
select *
FROM INFORMATION_SCHEMA.TABLES
In the tablename column, I saw:
#tempTable__________________________________________________________________
_________________________________________000000058617
#tempTable__________________________________________________________________
_________________________________________000000058628
Please notice the appendix are different.
>Since the temp table only lives for the scope of the stored
> procedure, why do you care aout its size OUTSIDE of that scope?
My tempdb is too large and I want to figure out the cause. One obvious
reason is that we used too many temp tables created in the stored
procedures. I know theoritically the temp table will be automatically
dropped when the stored procedure exits. However, I don't why my tempdb size
keeps growing and can not be shrinked.
Thanks a lot.|||>
#tempTable__________________________________________________________________
> _________________________________________000000058617
>
#tempTable__________________________________________________________________
> _________________________________________000000058628
> Please notice the appendix are different.
Yes, those suffixes are generated by SQL Server internally to track #temp
tables from different sessions. Again, you would have to guess which one is
which.
> However, I don't why my tempdb size
> keeps growing and can not be shrinked.
http://www.aspfaq.com/2446
http://www.aspfaq.com/2471|||> > However, I don't why my tempdb size
> > keeps growing and can not be shrinked.
> http://www.aspfaq.com/2446
> http://www.aspfaq.com/2471
>
Very helpful link. However, when I ran the following query:
USE tempdb
GO
EXEC sp_spaceused @.updateusage = 'TRUE'
I got the result like:
database_name
database_size unallocated space
--- --
-- --
tempdb
4425.94 MB 4140.27 MB
reserved data index_size unused
-- -- -- --
624 KB 216 KB 320 KB 88 KB
My questions are:
1. What does the unallocated space mean? Free space? Unused space? Why I can
not reclaim the such space by shrinking db?
2.The data and index add up together are only 216 + 320 = 536 KB. It is less
than 1 MB. Why my tempdb is so large (> 4GB)? Any hint?
Thanks|||The possible reasons for tempdb growth are listed in that article. Why is
your tempdb so large? I have no idea. Probably one or more of those
reasons. Why can't you shrink it? I have no idea. What else is going on
in the system? What command are you using to shrink the database? Does it
complete successfully, or do you get an error? If you get an error, what is
it?
--
http://www.aspfaq.com/
(Reverse address to reply.)
"FLX" <nospam@.hotmail.com> wrote in message
news:uDHsq7H2EHA.936@.TK2MSFTNGP12.phx.gbl...
> > > However, I don't why my tempdb size
> > > keeps growing and can not be shrinked.
> >
> > http://www.aspfaq.com/2446
> > http://www.aspfaq.com/2471
> >
> Very helpful link. However, when I ran the following query:
> USE tempdb
> GO
> EXEC sp_spaceused @.updateusage = 'TRUE'
> I got the result like:
> database_name
> database_size unallocated space
> --- --
--
> -- --
> tempdb
> 4425.94 MB 4140.27 MB
>
> reserved data index_size unused
> -- -- -- --
> 624 KB 216 KB 320 KB 88 KB
>
> My questions are:
> 1. What does the unallocated space mean? Free space? Unused space? Why I
can
> not reclaim the such space by shrinking db?
> 2.The data and index add up together are only 216 + 320 = 536 KB. It is
less
> than 1 MB. Why my tempdb is so large (> 4GB)? Any hint?
> Thanks
>
>
>

Check Temp table size?

I have a tempdb which fills up the disk frequently. I want to determine the
size of each object in the tempdb.
I used EXEC sp_spaceused '#temptablename'. I got the "#temptablename" does
not exist error. I got the temp table names from INFORMATION_SCHEMA.TABLES.
Since the temp tables only valid for their own session, how can I check its
size of temp tables through Query Analyzer?
Another question is how to analyze the log file space usage? The log file
for my TempDB grows dramatically fast too. I need understand the reason.
Thanks a lot,
FLEXEC tempdb..spaceused '#temptablename'
http://www.aspfaq.com/
(Reverse address to reply.)
"FLX" <nospam@.hotmail.com> wrote in message
news:e$uxjy91EHA.3368@.TK2MSFTNGP10.phx.gbl...
> I have a tempdb which fills up the disk frequently. I want to determine
the
> size of each object in the tempdb.
> I used EXEC sp_spaceused '#temptablename'. I got the "#temptablename" does
> not exist error. I got the temp table names from
INFORMATION_SCHEMA.TABLES.
> Since the temp tables only valid for their own session, how can I check
its
> size of temp tables through Query Analyzer?
> Another question is how to analyze the log file space usage? The log file
> for my TempDB grows dramatically fast too. I need understand the reason.
> Thanks a lot,
> FL
>
>
>
>|||Thanks.
It did not solve my problem. Maybe my question was not clear. The
#temptablename was created in the stored procedure. Since it is a local temp
table, I can not access it from the Query Analyzer. What is the workaround?
I know if it is a global temp table I can access it.
FL
"Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:%23sIQO391EHA.1396@.tk2msftngp13.phx.gbl...
> EXEC tempdb..spaceused '#temptablename'
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
> "FLX" <nospam@.hotmail.com> wrote in message
> news:e$uxjy91EHA.3368@.TK2MSFTNGP10.phx.gbl...
> the
does[vbcol=seagreen]
> INFORMATION_SCHEMA.TABLES.
> its
file[vbcol=seagreen]
>|||You want to check the size of a temp table created in a stored procedure,
from query analyzer OUTSIDE the scope of the stored procedure?
I don't think this is possible, unless you manually inspect
tempdb..sysobjects and guess which table is from the specific stored
procedure scope you are interested in. What do you expect will happen when
the stored procedure is being executed by 12 different people
simultaneously? Since the temp table only lives for the scope of the stored
procedure, why do you care aout its size OUTSIDE of that scope?
http://www.aspfaq.com/
(Reverse address to reply.)
"FLX" <nospam@.hotmail.com> wrote in message
news:u46sZM$1EHA.4004@.tk2msftngp13.phx.gbl...
> Thanks.
> It did not solve my problem. Maybe my question was not clear. The
> #temptablename was created in the stored procedure. Since it is a local
temp
> table, I can not access it from the Query Analyzer. What is the
workaround?
> I know if it is a global temp table I can access it.
> FL
>
>
>
> "Aaron [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
> news:%23sIQO391EHA.1396@.tk2msftngp13.phx.gbl...
determine[vbcol=seagreen]
> does
check[vbcol=seagreen]
> file
reason.[vbcol=seagreen]
>|||> I don't think this is possible, unless you manually inspect
> tempdb..sysobjects and guess which table is from the specific stored
> procedure scope you are interested in.
This is unfortunate.

>What do you expect will happen when
> the stored procedure is being executed by 12 different people
> simultaneously?
I expect 12 temp tables with unique Table Names stored in the database.
Let's say there is a temp table "#tempTable" is created in the stored
procedure. Two people simultaneously execute the stored procedure. When I
ran the following query,
use tempdb
go
select *
FROM INFORMATION_SCHEMA.TABLES
In the tablename column, I saw:
#tempTable______________________________
____________________________________
________________________________________
_000000058617
#tempTable______________________________
____________________________________
________________________________________
_000000058628
Please notice the appendix are different.

>Since the temp table only lives for the scope of the stored
> procedure, why do you care aout its size OUTSIDE of that scope?
My tempdb is too large and I want to figure out the cause. One obvious
reason is that we used too many temp tables created in the stored
procedures. I know theoritically the temp table will be automatically
dropped when the stored procedure exits. However, I don't why my tempdb size
keeps growing and can not be shrinked.
Thanks a lot.|||>
#tempTable______________________________
____________________________________[vbc
ol=seagreen]
> ________________________________________
_000000058617
>[/vbcol]
#tempTable______________________________
____________________________________[vbc
ol=seagreen]
> ________________________________________
_000000058628
> Please notice the appendix are different.[/vbcol]
Yes, those suffixes are generated by SQL Server internally to track #temp
tables from different sessions. Again, you would have to guess which one is
which.

> However, I don't why my tempdb size
> keeps growing and can not be shrinked.
http://www.aspfaq.com/2446
http://www.aspfaq.com/2471|||> > However, I don't why my tempdb size
> http://www.aspfaq.com/2446
> http://www.aspfaq.com/2471
>
Very helpful link. However, when I ran the following query:
USE tempdb
GO
EXEC sp_spaceused @.updateusage = 'TRUE'
I got the result like:
database_name
database_size unallocated space
--- --
-- --
tempdb
4425.94 MB 4140.27 MB
reserved data index_size unused
-- -- -- --
624 KB 216 KB 320 KB 88 KB
My questions are:
1. What does the unallocated space mean? Free space? Unused space? Why I can
not reclaim the such space by shrinking db?
2.The data and index add up together are only 216 + 320 = 536 KB. It is less
than 1 MB. Why my tempdb is so large (> 4GB)? Any hint?
Thanks|||The possible reasons for tempdb growth are listed in that article. Why is
your tempdb so large? I have no idea. Probably one or more of those
reasons. Why can't you shrink it? I have no idea. What else is going on
in the system? What command are you using to shrink the database? Does it
complete successfully, or do you get an error? If you get an error, what is
it?
http://www.aspfaq.com/
(Reverse address to reply.)
"FLX" <nospam@.hotmail.com> wrote in message
news:uDHsq7H2EHA.936@.TK2MSFTNGP12.phx.gbl...
> Very helpful link. However, when I ran the following query:
> USE tempdb
> GO
> EXEC sp_spaceused @.updateusage = 'TRUE'
> I got the result like:
> database_name
> database_size unallocated space
> --- --
--
> -- --
> tempdb
> 4425.94 MB 4140.27 MB
>
> reserved data index_size unused
> -- -- -- --
> 624 KB 216 KB 320 KB 88 KB
>
> My questions are:
> 1. What does the unallocated space mean? Free space? Unused space? Why I
can
> not reclaim the such space by shrinking db?
> 2.The data and index add up together are only 216 + 320 = 536 KB. It is
less
> than 1 MB. Why my tempdb is so large (> 4GB)? Any hint?
> Thanks
>
>
>