﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SQL Server’da Tüm Tabloların Boyut Bilgisi &#8211; SQL Server Eğitimleri</title>
	<atom:link href="https://sqlserveregitimleri.com/etiket/sql-serverda-tum-tablolarin-boyut-bilgisi/feed" rel="self" type="application/rss+xml" />
	<link>https://sqlserveregitimleri.com</link>
	<description>SQL Server ile ilgili her şey</description>
	<lastBuildDate>Sat, 21 Apr 2018 20:00:45 +0000</lastBuildDate>
	<language>tr</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.1</generator>
	<item>
		<title>SQL Server’da Tüm Tabloların Boyut Bilgisini Almak</title>
		<link>https://sqlserveregitimleri.com/sql-serverda-tum-tablolarin-boyut-bilgisini-almak</link>
		
		<dc:creator><![CDATA[Yavuz Selim Kart]]></dc:creator>
		<pubDate>Thu, 26 Apr 2018 11:30:11 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server’da Tüm Tabloların Boyut Bilgisi]]></category>
		<category><![CDATA[SQL Server’da Tüm Tabloların Boyut Bilgisini Almak]]></category>
		<category><![CDATA[Tüm Tabloların Boyut Bilgisini Almak]]></category>
		<guid isPermaLink="false">http://sqlserveregitimleri.com/?p=5719</guid>

					<description><![CDATA[Herkese merhaba, Bu kısımda SQL Server’da tüm tabloların boyut bilgisini alma kodları olacak. use NORTHWND --Database adını burdan değiştireceksiniz. set nocount on go declare @TableName varchar(128),...]]></description>
										<content:encoded><![CDATA[<p>Herkese merhaba,</p>
<p>Bu kısımda SQL Server’da tüm tabloların boyut bilgisini alma kodları olacak.</p>
<pre class="lang:default decode:true ">use NORTHWND --Database adını burdan değiştireceksiniz.
set nocount on
go

declare 
    @TableName varchar(128),
    @RID int,
    @MaxRID int

declare @loopSrc table
(
    RID int identity(1,1) primary key clustered,
    TableName varchar(128)
)

if object_id('tempdb.dbo.#Tabs') is not null drop table #Tabs
create table #Tabs
(
    TableName varchar(128),
    nRows int,
    nReserved as cast(replace(sReserved, ' KB', '') as int),
    nData as cast(replace(sData, ' KB', '') as int),
    nIndexSize as cast(replace(sIndexSize, ' KB', '') as int),
    nUnused as cast(replace(sUnused, ' KB', '') as int),
    sReserved varchar(30),
    sData varchar(30),
    sIndexSize varchar(30),
    sUnused varchar(30)

)
/*****************************
*** INSERT LOOP ITEMS HERE ***
*****************************/
insert into @loopSrc
(
    TableName
)
select name
from sys.tables

select 
    @RID = 1,
    @MaxRID = @@rowcount
/**********************
*** LOOP STRUCTURE  ***
**********************/
while @RID &lt;= @MaxRID
    begin

        select @TableName = TableName
        from @loopSrc
        where RID = @RID

        begin try
            insert into #Tabs
            exec sp_spaceused @tableName
        end try 
        begin catch
        end catch

        select @RID += 1
    
    end


select *
from #Tabs
order by nRows desc

</pre>
<div class='epvc-post-count'><span class='epvc-eye'></span>  <span class="epvc-count"> 305</span><span class='epvc-label'> Kez Okundu</span></div>]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
