Showing posts with label easily. Show all posts
Showing posts with label easily. Show all posts

Monday, March 12, 2012

How can I know the records in SQL 2005 Table possess size space?

We can know easily a database disk size, but can we konw a table in SQL 2005 database possess size? and more, how can I know the records in SQL 2005 Table possess size space?

Try the link below for sp_helpfile it is a system stored procedure and it is in the Master database. Hope this helps.

http://msdn2.microsoft.com/en-us/library/ms174307.aspx

|||

Thanks!

But I think Sp_helpfile don't know single Table or Records size

sp_helpfile (Transact-SQL)

Returns the physical names and attributes of files associated with the current database. Use this stored procedure to determine the names of files to attach to or detach from the server.

|||

Sorry it is sp_spaceused and there are undocumented system stored proc that you can use. Try the links below for details.

http://www.sqlservercentral.com/columnists/achigrik/sql2000.asp

http://www.sqlservercentral.com/scripts/viewscript.asp?scriptid=1062

http://msdn2.microsoft.com/en-us/library/ms188776.aspx

|||

Many thanks!

How can I know rows used space ? Such as I want to know the user Paul used space

select * from mytable where UserName='Paul'

|||Paul spaced used? Paul plus tables associated to Paul because sp_spaceused is for database objects like tables not users.|||

Sorry!

When system perform the sql select * from mytable where UserName='Paul' , it will return many rows , iI want to know these rows use size space.

|||

I am sorry I cannot help you the space used that concerns my employers are to make sure the transaction log will not run out of space, but I know the max for a row is 8060 which is also a SQL Server page. Try the thread below for the specs per Microsoft.

http://forums.asp.net/thread/1398414.aspx

|||

ok just open enterprise manager select the database then in the summary window just click report then expand disk space used by tables and you should get the info you're looking for as per table.

Have fun!

Sunday, February 19, 2012

How can i find the list of Analyis Server in my computer?

is there any way to find the Analysis Server 2005 Lists?

i can find the SQLServerList in Network easily. But i need Analysis Servers...

I dont want the list of *** in Network. List of *** in LOCAL is enough for me. Sad(

Dim Instance As SqlDataSourceEnumerator = SqlDataSourceEnumerator.Instance

Dim SQLServerTable As System.Data.DataTable = Instance.GetDataSources()

For Each row As DataRow In SQLServerTable.Rows

If IsDBNull(row(1)) Then

cboSQLServer.Items.Add(row(0))

Else

cboSQLServer.Items.Add(row(0) + "\" + row(1))

End If

Next

i try to find it from Services but it is very SLOW and there is no standard name for service!!!

Name = MSOLAP$INSTANCENAME

sservices = ServiceController.GetServices("ComputerName")

For i As Int16 = 0 To sservices.Length - 1

Debug.Print(sservices(i).ServiceName)

Next

You could directly read from registry to see the list of Analysis Service instances available on the local machine from the below registry key

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\OLAP

MSSQLSERVER is the default instance (Service Name: MSSQLServerOLAPService)

every other registry key is the named instance (Service Name: MSOLAP$instanceName)

To know whether the instance is 2005 you could check the version,

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\<Instance ID>\Setup\Version

Instance ID is the value you get from

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\OLAP\<InstanceName> keys.

Hope this helps!

|||

Thank you very much.

i didnt recognize the shortest way Smile