<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3046845913036580503</id><updated>2024-10-05T05:18:54.084+03:00</updated><category term="Performans"/><title type='text'>Sql Server Performans Çalışmaları</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://sqlserverperformans.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3046845913036580503/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://sqlserverperformans.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/17042675806683099840</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>4</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3046845913036580503.post-8333629250278326020</id><published>2011-11-04T14:59:00.002+02:00</published><updated>2011-11-04T14:59:25.016+02:00</updated><title type='text'>Tsql ile tablo ve alan açıklamalarını kopyalama</title><content type='html'>&lt;br /&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;
&lt;b&gt;Aşağıdaki sorgu ile tablo ve alan açıklamalarını (Description alanlarının) kopyalanabilmesini sağlar.&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;
SELECT&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;
&#39;EXEC sys.sp_addextendedproperty @name=N&#39;&#39;MS_Description&#39;&#39;,&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;
@value=N&#39;&#39;&#39;+replace(&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;
CAST(exprop.value AS VARCHAR(max))&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;
,&#39;&#39;&#39;&#39;,&#39;&quot;&#39;)&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;
+&#39;&#39;&#39; , @level0type=N&#39;&#39;SCHEMA&#39;&#39;,@level0name=N&#39;&#39;dbo&#39;&#39;, @level1type=N&#39;&#39;TABLE&#39;&#39;,@level1name=N&#39;&#39;&#39;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;
+tbl.name+&#39;&#39;&#39;, @level2type=N&#39;&#39;COLUMN&#39;&#39;,@level2name=N&#39;&#39;&#39;+clmns.name +&#39;&#39;&#39;;&#39;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;
,tbl.name,&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;
CAST(clmns.name AS VARCHAR(35)) ,exprop.value&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;
FROM sys.tables AS tbl&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;
INNER JOIN sys.all_columns AS clmns&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;
ON clmns.object_id=tbl.object_id&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;
LEFT OUTER JOIN sys.indexes AS idx&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;
ON idx.object_id = clmns.object_id&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;
AND 1 =idx.is_primary_key&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;
LEFT OUTER JOIN sys.index_columns AS idxcol&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;
ON idxcol.index_id = idx.index_id&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;
AND idxcol.column_id = clmns.column_id&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;
AND idxcol.object_id = clmns.object_id&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;
AND 0 = idxcol.is_included_column&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;
LEFT OUTER JOIN sys.types AS udt&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;
ON udt.user_type_id = clmns.user_type_id&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;
LEFT OUTER JOIN sys.types AS typ&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;
ON typ.user_type_id = clmns.system_type_id&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;
AND typ.user_type_id = typ.system_type_id&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;
LEFT JOIN sys.default_constraints AS cnstr&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;
ON cnstr.object_id=clmns.default_object_id&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;
LEFT OUTER JOIN sys.extended_properties exprop&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;
ON exprop.major_id = clmns.object_id&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;
AND exprop.minor_id = clmns.column_id&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;
AND exprop.name = &#39;MS_Description&#39;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;
WHERE (--tbl.name = @TableName and&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;
exprop.class = 1) --I don&#39;t wand to include comments on indexes&lt;/div&gt;
&lt;div style=&quot;background-color: white; color: #333333; font-family: &#39;Helvetica Neue Light&#39;, HelveticaNeue-Light, &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; outline-color: initial; outline-style: none; outline-width: initial; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: justify;&quot;&gt;
ORDER BY clmns.column_id ASC&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlserverperformans.blogspot.com/feeds/8333629250278326020/comments/default' title='Kayıt Yorumları'/><link rel='replies' type='text/html' href='http://sqlserverperformans.blogspot.com/2011/11/tsql-ile-tablo-ve-alan-acklamalarn.html#comment-form' title='0 Yorum'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3046845913036580503/posts/default/8333629250278326020'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3046845913036580503/posts/default/8333629250278326020'/><link rel='alternate' type='text/html' href='http://sqlserverperformans.blogspot.com/2011/11/tsql-ile-tablo-ve-alan-acklamalarn.html' title='Tsql ile tablo ve alan açıklamalarını kopyalama'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/17042675806683099840</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3046845913036580503.post-2293452621053918308</id><published>2011-11-04T09:29:00.000+02:00</published><updated>2011-11-04T09:29:02.382+02:00</updated><title type='text'>Kullanılmayan indexlerinizi otomatik bulup drop eden sorgu hazırlamak</title><content type='html'>&lt;br /&gt;
Aşağıdaki sorguyu kullanarak daha önceden açılmış fakat kullanılmayan indexleri bulup drop cümlesini yazacağız.&lt;br /&gt;
sorgudaki ilk sütün indexin koly drop edilmesi için disable ediyor ikinci sütün ise indexi drop ediyor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SELECT&lt;br /&gt;
&lt;br /&gt;
&#39;ALTER INDEX &#39;+i.name+&#39; ON &#39;+o.name+&#39; DISABLE&#39; as IndexDisable,&lt;br /&gt;
&#39;DROP INDEX &#39;+i.name+&#39; ON &#39;+o.name+&#39; WITH ( ONLINE = OFF )&#39; as IndexDrop,&lt;br /&gt;
&lt;br /&gt;
o.name Object_Name,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;i.name Index_name,&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;i.Type_Desc ,s.*&lt;br /&gt;
&amp;nbsp;FROM sys.objects AS o&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;JOIN sys.indexes AS i&lt;br /&gt;
&amp;nbsp;ON o.object_id = i.object_id&lt;br /&gt;
&amp;nbsp; LEFT OUTER JOIN&lt;br /&gt;
&amp;nbsp; sys.dm_db_index_usage_stats AS s &lt;br /&gt;
&amp;nbsp;ON i.object_id = s.object_id &lt;br /&gt;
&amp;nbsp; AND i.index_id = s.index_id&lt;br /&gt;
&amp;nbsp;WHERE &amp;nbsp;o.type = &#39;u&#39;&lt;br /&gt;
&amp;nbsp;--– Clustered and Non-Clustered indexes&lt;br /&gt;
&amp;nbsp; AND i.type =2--IN (1, 2)&lt;br /&gt;
&amp;nbsp; -- Indexes without stats&lt;br /&gt;
&amp;nbsp; AND&lt;br /&gt;
&amp;nbsp;(s.index_id IS NULL) OR&lt;br /&gt;
&amp;nbsp; -- Indexes that have been updated by not used&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; --s.user_seeks = 0&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;(s.user_seeks = 0 AND s.user_scans = 0 AND s.user_lookups = 0 and user_updates=0)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; order by 3&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlserverperformans.blogspot.com/feeds/2293452621053918308/comments/default' title='Kayıt Yorumları'/><link rel='replies' type='text/html' href='http://sqlserverperformans.blogspot.com/2011/11/kullanlmayan-indexlerinizi-otomatik.html#comment-form' title='0 Yorum'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3046845913036580503/posts/default/2293452621053918308'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3046845913036580503/posts/default/2293452621053918308'/><link rel='alternate' type='text/html' href='http://sqlserverperformans.blogspot.com/2011/11/kullanlmayan-indexlerinizi-otomatik.html' title='Kullanılmayan indexlerinizi otomatik bulup drop eden sorgu hazırlamak'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/17042675806683099840</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3046845913036580503.post-2936204787999351372</id><published>2011-11-04T09:28:00.000+02:00</published><updated>2011-11-10T14:52:27.695+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Performans"/><title type='text'>Sql Serverda Index Kavramı</title><content type='html'>&lt;br /&gt;
&lt;div style=&quot;background-color: transparent;&quot;&gt;
&lt;h1 dir=&quot;ltr&quot; id=&quot;internal-source-marker_0.1572883955668658&quot;&gt;

&lt;span style=&quot;background-color: transparent; font-family: Arial; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Bir web seminerinde tuttuğum notlar:&lt;/span&gt;&lt;/span&gt;&lt;/h1&gt;
&lt;h1 dir=&quot;ltr&quot; id=&quot;internal-source-marker_0.1572883955668658&quot;&gt;

&lt;span style=&quot;background-color: transparent; font-family: Arial; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Sql Serverda Index Kavramı&lt;/span&gt;&lt;/span&gt;&lt;/h1&gt;
&lt;span style=&quot;background-color: transparent; font-family: Arial; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Performance Tuning &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; font-family: Arial; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;h2 dir=&quot;ltr&quot;&gt;

&lt;span style=&quot;background-color: transparent; font-family: Arial; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Neden Index&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Daha az ver okumak daha az zamanda veri getirmek&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;index key vasıtası ile okumak istediğimiz kayda daha hızlı ulaşabiliriz&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Table scan(tüm tablonun okunması) yerine index veriyi daha hızlı getiri&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Ctrl+L Estimated query plan&lt;/span&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: circle; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;SET STATISTIC IO ON&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: circle; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;SET STATISTIC TIME ON&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: circle; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;…&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: circle; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;SET STATISTIC IO OFF&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: circle; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;SET STATISTIC TIME OFF&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Gereksiz indexler sıkıntı oluşturabilir(Insert Update performansı düşer)&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;h2 dir=&quot;ltr&quot;&gt;

&lt;span style=&quot;background-color: transparent; font-family: Arial; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Index Nasıl Çalışır&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;client İstek yollar&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Protokol Layer&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Parse&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Query Processor&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Optimize + Execute&lt;/span&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: circle; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;B-Tree Yapısı&lt;/span&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: square; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Root&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: square; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Level 1 (Intermediate level)(Birden fazla olabilir...)&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: square; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Level 0 (leaf Level)&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: square; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: circle; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;(Clustered ise kayıtın kendisine degil ise referansına erişilir.)&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Execute&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;h1 dir=&quot;ltr&quot;&gt;

&lt;span style=&quot;background-color: transparent; font-family: Arial; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Index Pageleri görüntüleme&lt;/span&gt;&lt;/span&gt;&lt;/h1&gt;
&lt;ul&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;DBCC IND (ELMA, TABLO, INDEX_id)&lt;/span&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: circle; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;select * from sys.indexes&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: circle; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Index pagelerini listeler&lt;/span&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: square; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Index level (0 Leave level) (1 Intramate level) &lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: square; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;prevpage nextpage&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: square; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;PageId&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;DBSS PAGE&lt;/span&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: circle; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;önce: DBCC TRACEON(pageId)&lt;/span&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: square; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;ID: clustered ındex key&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: square; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Uniqufier index unique değil ise unique etmek için&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: square; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;ChildPage: aly level pageleri gösteriyor&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: circle; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;DBCC PAGE (‘‘ELMA’,1,2344,3&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;h1 dir=&quot;ltr&quot;&gt;

&lt;span style=&quot;background-color: transparent; font-family: Arial; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Clustered Index&lt;/span&gt;&lt;/span&gt;&lt;/h1&gt;
&lt;span style=&quot;background-color: transparent; font-family: Arial; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Fiziksel Index denilebilir. Diskte veriler mantıksal olarak sıralı tutulur(Page chain)&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Bir tabloda sadece 1 tane clustered Index olabilir.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Leaf Level: Datanın kendisi(Tamamı) Arama bitince veriye ulaşırız&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;en yukarda root level&lt;/span&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: circle; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Intermediate level&lt;/span&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: square; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Leaf Level: Datanın kendisi&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: square; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;(Non clustered index buna look up yaptığı için önemli)&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Uniqufier 4 byte kullanır&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Identity kolona koyulması önerilir&lt;/span&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: circle; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Update görmez&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;h1 dir=&quot;ltr&quot;&gt;

&lt;span style=&quot;background-color: transparent; font-family: Arial; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Non Clustered Index&lt;/span&gt;&lt;/span&gt;&lt;/h1&gt;
&lt;ul&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Tefefon defterinde Mesleklere göre arama yapmak örnek olarak verilebilir&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Leaf Level: Row Locator + Included Kolonlar&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Row Locator Heap yada Clustered ındex olmasına göre değişiklik olur&lt;/span&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: circle; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Heap: Dosya No+ Sayfa no+Kayıt no (HEAP RID lookup yapmarak datayı getiriyor)&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: circle; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Clustered Clustered Index Key&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Max Non clusterek index&lt;/span&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: circle; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Sql server 2005 &lt;/span&gt;&lt;span style=&quot;background-color: transparent; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;249&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: circle; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;sql server 2008&lt;/span&gt;&lt;span style=&quot;background-color: transparent; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; 999&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;h1 dir=&quot;ltr&quot;&gt;

&lt;span style=&quot;background-color: transparent; font-family: Arial; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Örneklerle Index Pageler&lt;/span&gt;&lt;/span&gt;&lt;/h1&gt;
&lt;ul&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Unique Clusterek ındex&lt;/span&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: circle; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;DBCC IND( ındex leve 0 leaf&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: circle; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;DBCC TRACE ON&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: circle; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;BBCC PAGE..(&lt;/span&gt;&lt;span style=&quot;background-color: transparent; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Index uniue ise unifier alanı açılmaz.&lt;/span&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;)&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;h1 dir=&quot;ltr&quot;&gt;

&lt;span style=&quot;background-color: transparent; font-family: Arial; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Included Kolon Kullanımı&lt;/span&gt;&lt;/span&gt;&lt;/h1&gt;
&lt;ul&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Non clustered Index için Look Up yapmayı engellemek için yapılıyor.(Covering Index)&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Index Seek aracılığı ile arama yapıyor(%11) Key Lookup ile datayı getiriyor(%89)&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Inluded alan kullanılır ise sadece Index Seek yapıyor&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Included index sadece Leaflerde bulunuyor(daha az yer kaplar&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Composite tüm levellerde veri olacağından daha fazla yer kaplar)&lt;/span&gt;&lt;/li&gt;
&lt;ul&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: circle; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Composite:25.21 MB&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: circle; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Included: &amp;nbsp;&amp;nbsp;25.02 MB&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;h1 dir=&quot;ltr&quot;&gt;

&lt;span style=&quot;background-color: transparent; font-family: Arial; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;Sonuç - Özet&lt;/span&gt;&lt;/span&gt;&lt;/h1&gt;
&lt;ul&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Index Sqlserver Beygir gücü..&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Clustered ve non clustered yapısını bilmeliyiz&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;B-Tree yapısını bilmeliyiz&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Peryodik bakım yapmamız çok önemli&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Gereksiz Indexler Update Delete ve Inserti çok yavaşlatmakta&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; font-family: Arial; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: transparent; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Missing indexlerin DMVler ile belirlenip açılmalı&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; font-family: Arial; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.sqlserveronculeri.com/&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #000099; font-family: Arial; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;www.sqlserveronculeri.com&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; font-family: Arial; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.turgaysahtiyan.com/&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #000099; font-family: Arial; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;www.turgaysahtiyan.com&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; font-family: Arial; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; font-family: Arial; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; font-family: Arial; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;DMV ler ile insex seek ve scanlarına bakabiliriz.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; font-family: Arial; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Integrity kontrol.. DBCC...&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlserverperformans.blogspot.com/feeds/2936204787999351372/comments/default' title='Kayıt Yorumları'/><link rel='replies' type='text/html' href='http://sqlserverperformans.blogspot.com/2011/11/sql-serverda-index-kavram.html#comment-form' title='0 Yorum'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3046845913036580503/posts/default/2936204787999351372'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3046845913036580503/posts/default/2936204787999351372'/><link rel='alternate' type='text/html' href='http://sqlserverperformans.blogspot.com/2011/11/sql-serverda-index-kavram.html' title='Sql Serverda Index Kavramı'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/17042675806683099840</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total><georss:featurename>Kavacık Mh., Balamir Sk 1-11, 34810 Istanbul, Türkiye</georss:featurename><georss:point>41.092613146159835 29.086260795593262</georss:point><georss:box>41.089621146159836 29.081325295593263 41.095605146159834 29.09119629559326</georss:box></entry><entry><id>tag:blogger.com,1999:blog-3046845913036580503.post-6026150976063101447</id><published>2011-11-04T08:52:00.000+02:00</published><updated>2011-11-04T09:09:42.366+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Performans"/><title type='text'>Sql Server 2005 üstü için Otomatik Index Oluşturma</title><content type='html'>&lt;br /&gt;
Sql server dinamik viewleri kullanarak gerekli olan indexleri bulup create cümlererini hazırlayan bir scripti ili adımda yazalım:&lt;br /&gt;
&lt;br /&gt;
1. Analizini yapacağımız veritabanının id&#39;sini bulalım:&lt;br /&gt;
[DBADI yerine veritabanınızın adını yazın ve gelen sonuçta idyi ikinci adımda kullanın.]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
select * from sys.databases where name =&#39;DBADI&#39;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
2. bulduğumuz idyi @dbId parametresine aşağıdaki gibi verip çalıştıralım. gelen sonucu inceleyerek gerekli indexleri açabilirsiniz. Lütfen index açmadan önce gereksiz indexlerin veritabanının Insert ve Update işlemlerini yavaşlatabileceğini göz önüne alınız.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Not: where koşulundaki aşağıdaki satırı değiştirerek ihtiyacınız olan indexlere daha iyi odaklanabilirsiniz:&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;i&gt;and (s.avg_user_impact&amp;gt;60 or user_seeks&amp;gt;1000 or avg_total_user_cost&amp;gt;50)&lt;/i&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbd7PnLEu3hs41YKhbIdqcvYZwgZlJ1zGdgoa9TFH6bd97IBJHarQWCcsDVJaQpE1bHndBbgsACNBPWja9iniNXNXsuhKTBeyKdeBusiWhnnR-l7v8AvFMv66Glsab1WPyhAH0Bm9SxM4M/s1600/sqlperf.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;348&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbd7PnLEu3hs41YKhbIdqcvYZwgZlJ1zGdgoa9TFH6bd97IBJHarQWCcsDVJaQpE1bHndBbgsACNBPWja9iniNXNXsuhKTBeyKdeBusiWhnnR-l7v8AvFMv66Glsab1WPyhAH0Bm9SxM4M/s640/sqlperf.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Sql sonucu&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;declare @dbId int&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;set @dbId=7&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;select&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&#39;CREATE NONCLUSTERED INDEX IX_&#39;+&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;replace(&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;replace(&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;replace(&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;replace(statement,&#39;[DBADI].[dbo].[&#39;,&#39;&#39;)+&#39;_&#39;+&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;isnull(replace(equality_columns,&#39;,&#39;,&#39;_&#39;),&#39;&#39;)+&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;isnull(replace(inequality_columns,&#39;,&#39;,&#39;_&#39;),&#39;&#39;)&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;,&#39;[&#39;,&#39;&#39;)&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;,&#39;]&#39;,&#39;&#39;)&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;,&#39; &#39;,&#39;&#39;)&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;+&#39; ON &#39;+statement+&#39;(&#39;+&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;isnull(equality_columns,&#39;&#39;)+&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;case when equality_columns is null then inequality_columns&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;else isnull(&#39;,&#39;+inequality_columns,&#39;&#39;) end&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;+&#39;)&#39;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;+&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp;isnull &amp;nbsp;( &#39;include(&#39;+included_columns+&#39;) with(ONLINE = ON) ;&#39;,&#39;&#39;)&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;, s.avg_user_impact, s.user_seeks,s.avg_total_user_cost, statement,&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp;s.unique_compiles,&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;replace(replace(statement,&#39;[DBADI].[dbo].[&#39;,&#39;&#39;),&#39;]&#39;,&#39;&#39;),&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;d.*&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; , s.avg_total_user_cost&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; , s.last_user_seek&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;from sys.dm_db_missing_index_group_stats s&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ,sys.dm_db_missing_index_groups g&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ,sys.dm_db_missing_index_details d&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;where s.group_handle = g.index_group_handle&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;and d.index_handle = g.index_handle&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;and d.database_id=@dbId--DB name den&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp;--and replace(replace(statement,&#39;[DBADI].[dbo].[&#39;,&#39;&#39;),&#39;]&#39;,&#39;&#39;) like &amp;nbsp;&#39;%tabloAdi%&#39;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;and (s.avg_user_impact&amp;gt;60 or user_seeks&amp;gt;1000 or avg_total_user_cost&amp;gt;50)&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;order by user_seeks desc--s.avg_user_impact desc&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://sqlserverperformans.blogspot.com/feeds/6026150976063101447/comments/default' title='Kayıt Yorumları'/><link rel='replies' type='text/html' href='http://sqlserverperformans.blogspot.com/2011/11/sql-server-2005-ustu-icin-otomatik.html#comment-form' title='2 Yorum'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3046845913036580503/posts/default/6026150976063101447'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3046845913036580503/posts/default/6026150976063101447'/><link rel='alternate' type='text/html' href='http://sqlserverperformans.blogspot.com/2011/11/sql-server-2005-ustu-icin-otomatik.html' title='Sql Server 2005 üstü için Otomatik Index Oluşturma'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/17042675806683099840</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbd7PnLEu3hs41YKhbIdqcvYZwgZlJ1zGdgoa9TFH6bd97IBJHarQWCcsDVJaQpE1bHndBbgsACNBPWja9iniNXNXsuhKTBeyKdeBusiWhnnR-l7v8AvFMv66Glsab1WPyhAH0Bm9SxM4M/s72-c/sqlperf.png" height="72" width="72"/><thr:total>2</thr:total><georss:featurename>Kavacık Mh., Onarımlı Sk 1-25, 34810 Istanbul, Türkiye</georss:featurename><georss:point>41.092677832266546 29.090080261230469</georss:point><georss:box>41.080711332266546 29.070339261230469 41.104644332266545 29.109821261230469</georss:box></entry></feed>