<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>The Daily DBA</title>
	<atom:link href="http://thedailydba.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://thedailydba.wordpress.com</link>
	<description>A journal for the working DBA</description>
	<lastBuildDate>Mon, 17 Oct 2011 20:12:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='thedailydba.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>The Daily DBA</title>
		<link>http://thedailydba.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://thedailydba.wordpress.com/osd.xml" title="The Daily DBA" />
	<atom:link rel='hub' href='http://thedailydba.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Heap Files</title>
		<link>http://thedailydba.wordpress.com/2011/10/17/heap-files/</link>
		<comments>http://thedailydba.wordpress.com/2011/10/17/heap-files/#comments</comments>
		<pubDate>Mon, 17 Oct 2011 19:51:23 +0000</pubDate>
		<dc:creator>ldgaller</dc:creator>
				<category><![CDATA[Storage Engine]]></category>

		<guid isPermaLink="false">http://thedailydba.wordpress.com/2011/10/17/heap-files/</guid>
		<description><![CDATA[What is a heap? Quite simply a heap is a table without a clustered index. Data within a table is grouped together into allocation units based on the column data types. Data within these allocation units are stored in pages. Each page is of size 8KB. Group of 8 pages (64K) is stored together and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thedailydba.wordpress.com&amp;blog=7445466&amp;post=125&amp;subd=thedailydba&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;"><span style="color:gray;font-size:12pt;">What is a heap? Quite simply a heap is a table without a clustered index. Data within a table is grouped together into allocation units based on the column data types. Data within these allocation units are stored in pages. Each page is of size 8KB. Group of 8 pages (64K) is stored together and they are referred as Extent. Depending on the data types in the heap, each heap structure will have one or more allocation units to store and manage the data for a specific partition. At a minimum, each heap will have one IN_ROW_DATA allocation unit per partition. If the table conatains any LOB data columns it will also have one LOB_DATA allocation unit per partition, and if the table conatins any variable length columsn that exceed 8k (8060 bytes) it will also have one ROW_OVERFLOW_DATA allocation unit per partition.  To recap, if the data of table is not physically stored in a particular order i.e. (clustered index) it is known as a <strong>Heap</strong> Structure.<br />
</span></p>
<p><span style="color:gray;font-size:12pt;">Heaps can be identified by querying the sys.partitions table for index_id=0. Heaps have one row in sys.partitions, with <strong>index_id</strong> = 0 for each partition used by the heap. By default, a heap has a single partition, however when a heap has multiple partitions, each partition has a heap structure that contains the data for that specific partition. For example, if a heap has three partitions, there are three heap structures.<br />
</span></p>
<p><span style="color:gray;font-size:12pt;">The data pages and the rows within a heap are not in any specific order and are not linked. The only logical connection between data pages is the information recorded in the IAM pages. An IAM (<span style="text-decoration:underline;">I</span>ndex <span style="text-decoration:underline;">A</span>llocation <span style="text-decoration:underline;">M</span>ap) page tracks approximately 4GB worth of space in a single file also known as GAM interval. The column <strong>first_iam_page</strong> in the <strong>sys.system_internals_allocation_units</strong> system view points to the first IAM page in the chain of IAM pages that manage the space allocated to the heap in a specific partition. SQL Server uses the IAM pages to move through the heap.<br />
</span></p>
<p><span style="color:gray;font-family:Segoe UI;font-size:9pt;">The following illustration shows how the SQL Server Database Engine uses IAM pages to retrieve data rows in a single partition heap.<br />
</span></p>
<p><img src="http://thedailydba.files.wordpress.com/2011/10/101711_1951_heapfiles15.gif?w=450" alt="" /><span style="color:white;font-family:Segoe UI;font-size:9pt;"><br />
		</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thedailydba.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thedailydba.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thedailydba.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thedailydba.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/thedailydba.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/thedailydba.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/thedailydba.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/thedailydba.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thedailydba.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thedailydba.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thedailydba.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thedailydba.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thedailydba.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thedailydba.wordpress.com/125/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thedailydba.wordpress.com&amp;blog=7445466&amp;post=125&amp;subd=thedailydba&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thedailydba.wordpress.com/2011/10/17/heap-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d6a46bd5b9ca689ee21a1793c34f6df1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ldgaller</media:title>
		</media:content>

		<media:content url="http://thedailydba.files.wordpress.com/2011/10/101711_1951_heapfiles15.gif" medium="image" />
	</item>
		<item>
		<title>SSIS to Excel 2007 Export Issues</title>
		<link>http://thedailydba.wordpress.com/2010/02/05/ssis-to-excel-2007-export-issues/</link>
		<comments>http://thedailydba.wordpress.com/2010/02/05/ssis-to-excel-2007-export-issues/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 15:18:58 +0000</pubDate>
		<dc:creator>ldgaller</dc:creator>
				<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://thedailydba.wordpress.com/2010/02/05/ssis-to-excel-2007-export-issues/</guid>
		<description><![CDATA[Ever tried to export to Excel 2007 from SSIS and experienced issues with the output file then this blog entry may help. The default Microsoft Excel 2007 file fomat, with the file extension .xslx (a Zip file that contains multiple XML files). However Excel can also be saved to a binary format, with the file [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thedailydba.wordpress.com&amp;blog=7445466&amp;post=120&amp;subd=thedailydba&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Ever tried to export to Excel 2007 from SSIS and experienced issues with the output file then this blog entry may help. The default Microsoft Excel 2007 file fomat, with the file extension <strong>.xslx (</strong>a Zip file that contains multiple XML files). However Excel can also be saved to a binary format, with the file extension <strong>.xlsb</strong>.&#160; <a href="http://office.microsoft.com/en-us/excel/HP100141031033.aspx">Excel supported file formats</a>.</p>
<p>The SQL Server Books Online topic, <a href="http://msdn.microsoft.com/en-us/library/cc280527.aspx">How to: Connect to an Excel Workbook</a>, contains incomplete but potentially misleading information when instructing one to set <strong>Extended Properties = &quot;Excel 12.0&quot; </strong>on the OLE DB Connection Manager.</p>
<ul>
<li><strong>Importing</strong>. The driver doesn&#8217;t care which of the 2 values (listed below) you use for <strong>Extended Properties</strong> when you are <em>importing from </em>Excel 2007.&#160; The driver infers the proper Excel file format from the existing input file.</li>
<li><strong>Exporting</strong>. When you are <em>exporting to</em> Excel 2007, however, <strong>Extended Properties = &quot;Excel 12.0&quot;</strong> creates an Excel <em><strong>binary</strong> </em>file. This would normally not be an issue however if you gave your file the standard l <strong>.xslx </strong>file extension, the Excel application later complains that the file format is incorrect (because it&#8217;s really <strong>.xlsb</strong>) and refuses to open the file. </li>
</ul>
<p>To correct this simply use the property settings outlined below:</p>
<ul>
<li>Default file extension of <strong>.xslx (</strong>Excel XML format), and <strong>Extended Properties = &quot;Excel 12.0 Xml&quot;</strong></li>
<li>Non-default file extension of <strong>.xslb (</strong>Excel binary format), and <strong>Extended Properties = &quot;Excel 12.0&quot; </strong></li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thedailydba.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thedailydba.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thedailydba.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thedailydba.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/thedailydba.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/thedailydba.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/thedailydba.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/thedailydba.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thedailydba.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thedailydba.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thedailydba.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thedailydba.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thedailydba.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thedailydba.wordpress.com/120/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thedailydba.wordpress.com&amp;blog=7445466&amp;post=120&amp;subd=thedailydba&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thedailydba.wordpress.com/2010/02/05/ssis-to-excel-2007-export-issues/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d6a46bd5b9ca689ee21a1793c34f6df1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ldgaller</media:title>
		</media:content>
	</item>
		<item>
		<title>Moving tempdb</title>
		<link>http://thedailydba.wordpress.com/2010/01/28/moving-tempdb/</link>
		<comments>http://thedailydba.wordpress.com/2010/01/28/moving-tempdb/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 22:07:07 +0000</pubDate>
		<dc:creator>ldgaller</dc:creator>
				<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://thedailydba.wordpress.com/2010/01/28/moving-tempdb/</guid>
		<description><![CDATA[Moving the tempdb database in SQL Server is a simple process but does require the service to be restarted. By default, the tempdb database is created in the same location as master, model and msdb.&#160; tempdb is used to store temporary user created objects (e.g. temp tables), temporary internal objects (e.g. work tables for sorting) [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thedailydba.wordpress.com&amp;blog=7445466&amp;post=114&amp;subd=thedailydba&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Moving the tempdb database in SQL Server is a simple process but does require the service to be restarted.</p>
<p>By default, the tempdb database is created in the same location as master, model and msdb.&#160; tempdb is used to store temporary user created objects (e.g. temp tables), temporary internal objects (e.g. work tables for sorting) and any row version data.&#160; Each time SQL Server is started all the objects in tempdb are deleted but the file sizes are retained.&#160; </p>
<p>The primary reasons for wanting to move the tempdb are to increase performance or deal with file size issues.</p>
<p>Step 1: Determine\confirm the logical file names of of the data files for tempdb.&#160; You can run the following command in SQL Server 2000 \2005\2008:</p>
<p>USE tempdb GO </p>
<p>EXEC sp_helpfile </p>
<p>GO</p>
<p>name fileid filename</p>
<p> &#8212;&#8212;&#8212; &#8212;&#8212; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- </p>
<p>tempdev 1 c:\Data\MSSQL\data\tempdb.mdf </p>
<p>templog 2 c:\Data\MSSQL\data\templog.ldf</p>
<p>Unless modified the default will be 1 data file and 1 log file with the standard names tempdev and templog. </p>
<p>Step2: ALTER DATABASE Setting the FILENAME parameter to the location where you&#8217;d like each file.</p>
<p>USE master GO </p>
<p>ALTER DATABASE tempdb MODIFY FILE (NAME = tempdev, FILENAME = &#8216;D:\tempdb\Data\tempdb.mdf&#8217;) </p>
<p>GO </p>
<p>ALTER DATABASE tempdb MODIFY FILE (NAME = templog, FILENAME = &#8216;D:\tempdb\Log\tempdb.ldf&#8217;) </p>
<p>GO</p>
<p>Step 3: Restart SQL Server (Services)</p>
<p>Step 4: Delete old tempdb files</p>
<p>Volla you are done.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thedailydba.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thedailydba.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thedailydba.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thedailydba.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/thedailydba.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/thedailydba.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/thedailydba.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/thedailydba.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thedailydba.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thedailydba.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thedailydba.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thedailydba.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thedailydba.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thedailydba.wordpress.com/114/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thedailydba.wordpress.com&amp;blog=7445466&amp;post=114&amp;subd=thedailydba&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thedailydba.wordpress.com/2010/01/28/moving-tempdb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d6a46bd5b9ca689ee21a1793c34f6df1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ldgaller</media:title>
		</media:content>
	</item>
		<item>
		<title>Disabling SQL Server Network Protocols</title>
		<link>http://thedailydba.wordpress.com/2009/10/22/disabling-sql-server-network-protocols/</link>
		<comments>http://thedailydba.wordpress.com/2009/10/22/disabling-sql-server-network-protocols/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 12:24:07 +0000</pubDate>
		<dc:creator>ldgaller</dc:creator>
				<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://thedailydba.wordpress.com/2009/10/22/disabling-sql-server-network-protocols/</guid>
		<description><![CDATA[  Posted in SQL Server on May 8, 2009 by ldgaller I had a recent requirement to disable all but TCP\IP in the SQL Server Network protocol stack on about 200 of our remote database servers. This is something we normally do as part of our server builds but was missed on the golden image [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thedailydba.wordpress.com&amp;blog=7445466&amp;post=104&amp;subd=thedailydba&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h4> </h4>
<p>Posted in <a href="http://en.wordpress.com/tag/sql-server/">SQL Server</a> on May 8, 2009 by ldgaller</p>
<p>I had a recent requirement to disable all but TCP\IP in the SQL Server Network protocol stack on about 200 of our remote database servers. This is something we normally do as part of our server builds but was missed on the golden image for these servers. As this was going to be deployed via RemoteWare I opted to create and execute a VBScript via command line rather then a T-SQL utilizing the undocumented xp_regwrite.  As a bonus there is a bit of code to change the server audit level which ended up being part of an overall security configuration adjustment. Enjoy, however be sure and test thuroughly in your environment. LDG</p>
<p>Script:</p>
<p>‘——————————————<br />
‘Auth: L.D.Galler<br />
‘Date: 20090508<br />
‘Desc: Script to disable all but tcp\ip on<br />
‘        a given sql server instance &amp; Set Audit Level to ALL</p>
<p>‘Usage: SQLServerNetworkProtocolDefaults [-s server] [-r] [-i] [-l login] [-p password] [-w]</p>
<p>‘[-s server]     – server name<br />
‘[-r]            – restart the server after disabling protocols<br />
‘[-i]            – use integrated security<br />
‘[-l login]      – login<br />
‘[-p password]   – password<br />
‘[-w seconds]    – how many seconds keep trying start the server</p>
<p>‘Notes:<br />
‘You need to specify either [-i] or both [-l] and [-p].<br />
‘If you specify both, [-i] will take over<br />
‘-w defaults to 30 if not specified<br />
‘<br />
‘Audit Level Registry Value<br />
‘None         0×00000000 (0)<br />
‘Success     0×00000001 (1)<br />
‘Failure     0×00000002 (2)<br />
‘All         0×00000003 (3)</p>
<p>‘CSCRIPT SQLServerNetworkProtocolDefaults.vbs<br />
‘——————————————-<br />
Option Explicit</p>
<p>Dim oArgs, sServer, bRestart, bIntegratedSec, sUserid, sPwd, iWait, iNum,sAuditLevel,bSuccess<br />
sServer = &#8220;(local)&#8221;<br />
bRestart = False<br />
bIntegratedSec = True<br />
sUserid = &#8220;&#8221;<br />
sPwd = &#8220;&#8221;<br />
iWait = 30<br />
sAuditLevel = &#8220;3&#8243;<br />
bSuccess=False</p>
<p>‘verify arguments<br />
Dim bLS, bPS<br />
bLS = False<br />
bPS = False</p>
<p>iNum = 0<br />
Set oArgs = WScript.Arguments<br />
While iNum &lt; oArgs.Count<br />
    Select Case LCase(oArgs(iNum))<br />
        Case &#8220;-s&#8221;:<br />
            iNum = iNum + 1<br />
            If iNum &lt; oArgs.Count Then<br />
                sServer = oArgs(iNum)<br />
            Else<br />
                Call DisplayUsage<br />
            End If<br />
        Case &#8220;-r&#8221;:<br />
            bRestart = True<br />
        Case &#8220;-i&#8221;:<br />
            bIntegratedSec = True<br />
        Case &#8220;-l&#8221;:<br />
            iNum = iNum + 1<br />
            If iNum &lt; oArgs.Count Then<br />
                sUserid = oArgs(iNum)<br />
                bLS = True<br />
            Else<br />
                Call DisplayUsage<br />
            End If<br />
        Case &#8220;-p&#8221;:<br />
            iNum = iNum + 1<br />
            If iNum &lt; oArgs.Count Then<br />
                sPwd = oArgs(iNum)<br />
                bPS = True<br />
            Else<br />
                Call DisplayUsage<br />
            End If<br />
        Case &#8220;-w&#8221;:<br />
            iNum = iNum + 1<br />
            If iNum &lt; oArgs.Count Then<br />
                iWait = CInt(oArgs(iNum))<br />
            Else<br />
                Call DisplayUsage<br />
            End If<br />
        Case Else<br />
            Call DisplayUsage<br />
    End Select<br />
    iNum = iNum + 1<br />
WEnd</p>
<p>‘verify that [i] or both [-l] and [-p] were specified<br />
If bIntegratedSec Or (bLS And bPS) Then<br />
    Call DisableAllButTCP (sServer, bRestart, bIntegratedSec, sUserid, sPwd, iWait)<br />
    Call SetLoginAuditLevel<br />
Else<br />
    Call DisplayUsage<br />
End If<br />
‘ Tells the script to stop and exit.<br />
‘——————————————————<br />
Sub DisableAllButTCP(ServerName, Restart, Integrated, Login, Password, Wait)<br />
    ‘create the instance of SQLServer object<br />
    Dim oServer<br />
    Set oServer = CreateObject(&#8220;SQLDMO.SQLServer&#8221;)</p>
<p>    ’set login information<br />
    If Integrated Then<br />
        oServer.LoginSecure = True<br />
    Else<br />
        oServer.Login = Login<br />
        oServer.Password = Password<br />
    End If</p>
<p>    ’set server name<br />
    oServer.Name = ServerName</p>
<p>    ‘connect to the server<br />
    oServer.Connect</p>
<p>    ‘get registry information for the server<br />
    Dim oRegistry<br />
    Set oRegistry = oServer.Registry</p>
<p>    ’set registry key to enable only TCP/IP<br />
    oRegistry.SuperSocketList = &#8220;tcp&#8221;</p>
<p>    Set oRegistry = Nothing</p>
<p>    ‘restart the server<br />
    If Restart Then<br />
        ’stop the server<br />
        WScript.Echo &#8220;Stopping the server&#8221;<br />
        On Error Resume Next<br />
        oServer.Shutdown(True)<br />
        On Error Goto 0<br />
        oServer.DisConnect</p>
<p>        ‘try to restart<br />
        WScript.Echo &#8220;Trying to start the server&#8221;<br />
        Dim iCount, bReady<br />
        iCount = 0<br />
        bReady = False<br />
        On Error Resume Next<br />
        ‘try a few times<br />
        While (iCount &lt; Wait) And Not bReady<br />
            oServer.Start False, ServerName<br />
            If Err &lt;&gt; 0 Then<br />
                ‘delay 1s between retries<br />
                WScript.Sleep 1000<br />
            Else<br />
                bReady = True<br />
            End If<br />
            iCount = iCount + 1<br />
            Err = 0<br />
        WEnd<br />
        On Error Goto 0<br />
        If bReady Then<br />
            WScript.Echo &#8220;Server restarted successfully&#8221;<br />
        Else<br />
            WScript.Echo &#8220;Could not restart the server&#8221;<br />
        End If<br />
    End If</p>
<p>    oServer.DisConnect</p>
<p>    Set oServer = Nothing<br />
End Sub<br />
‘———————————————————<br />
Sub DisplayUsage<br />
    WScript.Echo &#8220;Usage: SQLServerNetworkProtocolDefaults [-s server] [-r] [-i] [-l login] [-p password] [-w]&#8220;<br />
    WScript.Echo &#8220;&#8221;<br />
    WScript.Echo &#8220;       [-s server]     – server name&#8221;<br />
    WScript.Echo &#8220;       [-r]            – restart the server after disabling protocols&#8221;<br />
    WScript.Echo &#8220;       [-i]            – use integrated security&#8221;<br />
    WScript.Echo &#8220;       [-l login]      – login&#8221;<br />
    WScript.Echo &#8220;       [-p password]   – password&#8221;<br />
    WScript.Echo &#8220;       [-w seconds]    – how many seconds keep trying start the server&#8221;<br />
    WScript.Echo &#8220;&#8221;<br />
    WScript.Echo &#8220;You need to specify either [-i] or both [-l] and [-p]. If you specify both, [-i] will take over&#8221;<br />
    WScript.Echo &#8220;Server name defaults to &#8220;&#8221;(local)&#8221;" if not specified&#8221;<br />
    WScript.Echo &#8220;-w defaults to 30 if not specified&#8221;<br />
WScript.Quit<br />
End Sub<br />
‘———————————————————<br />
Sub SetLoginAuditLevel<br />
Dim objShell, RegLocate, RegLocate1<br />
Set objShell = WScript.CreateObject(&#8220;WScript.Shell&#8221;)<br />
On Error Resume Next<br />
RegLocate = &#8220;HKEY_LOCAL_MACHINE\Software\Microsoft\MSSQLServer\MSSQLServer\AuditLevel&#8221;</p>
<p>objShell.RegWrite RegLocate,&#8221;3&#8243;,&#8221;REG_DWORD&#8221;</p>
<p>End Sub</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thedailydba.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thedailydba.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thedailydba.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thedailydba.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/thedailydba.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/thedailydba.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/thedailydba.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/thedailydba.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thedailydba.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thedailydba.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thedailydba.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thedailydba.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thedailydba.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thedailydba.wordpress.com/104/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thedailydba.wordpress.com&amp;blog=7445466&amp;post=104&amp;subd=thedailydba&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thedailydba.wordpress.com/2009/10/22/disabling-sql-server-network-protocols/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d6a46bd5b9ca689ee21a1793c34f6df1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ldgaller</media:title>
		</media:content>
	</item>
		<item>
		<title>SSIS SQL Server provider logging (Can&#8217;t log to sysdtslog90 table)</title>
		<link>http://thedailydba.wordpress.com/2009/07/31/ssis-sql-server-provider-logging-cant-log-to-sysdtslog90-table/</link>
		<comments>http://thedailydba.wordpress.com/2009/07/31/ssis-sql-server-provider-logging-cant-log-to-sysdtslog90-table/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 15:15:27 +0000</pubDate>
		<dc:creator>ldgaller</dc:creator>
				<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://thedailydba.wordpress.com/2009/07/31/ssis-sql-server-provider-logging-cant-log-to-sysdtslog90-table/</guid>
		<description><![CDATA[I recently migrated from SQL Server 2005 to SQL Server 2008 for our Data Warehouse and analytical reporting (SSIS, SSAS). In SQL Server 2005 I had created several template SSIS projects and a general infrastructure for auditing and error handling. Everything ported fine except for some reason I was not capturing the SSIS logging to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thedailydba.wordpress.com&amp;blog=7445466&amp;post=102&amp;subd=thedailydba&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I recently migrated from SQL Server 2005 to SQL Server 2008 for our Data Warehouse and analytical reporting (SSIS, SSAS). In SQL Server 2005 I had created several template SSIS projects and a general infrastructure for auditing and error handling. Everything ported fine except for some reason I was not capturing the SSIS logging to the normal dbo.sysdtslog90 table, which is created by default in the database specified in the connection object parameter when you turn the SQL Server logging provider on. I quickly found out that contrary to popular belief SQL Server 2008 (SSIS) does not log to dbo.sysdtslog90 but instead logs to the <strong><u>msdb.dbo.sysssislog</u></strong> table. </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thedailydba.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thedailydba.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thedailydba.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thedailydba.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/thedailydba.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/thedailydba.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/thedailydba.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/thedailydba.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thedailydba.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thedailydba.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thedailydba.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thedailydba.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thedailydba.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thedailydba.wordpress.com/102/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thedailydba.wordpress.com&amp;blog=7445466&amp;post=102&amp;subd=thedailydba&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thedailydba.wordpress.com/2009/07/31/ssis-sql-server-provider-logging-cant-log-to-sysdtslog90-table/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d6a46bd5b9ca689ee21a1793c34f6df1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ldgaller</media:title>
		</media:content>
	</item>
		<item>
		<title>Search All Databases for a Table</title>
		<link>http://thedailydba.wordpress.com/2009/07/28/search-all-databases-for-a-table/</link>
		<comments>http://thedailydba.wordpress.com/2009/07/28/search-all-databases-for-a-table/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 18:50:19 +0000</pubDate>
		<dc:creator>ldgaller</dc:creator>
				<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://thedailydba.wordpress.com/2009/07/28/search-all-databases-for-a-table/</guid>
		<description><![CDATA[I just had a user send me an application error stating that a table the process was trying to create already existed. The user running the process did not know which of the five application databases the process was referring to and not wanting to run a query against all five databases I created the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thedailydba.wordpress.com&amp;blog=7445466&amp;post=101&amp;subd=thedailydba&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I just had a user send me an application error stating that a table the process was trying to create already existed. The user running the process did not know which of the five application databases the process was referring to and not wanting to run a query against all five databases I created the following simple stored procedure that searches all the databases on a server for a given table name. It has been tested on SQL 2k5 &amp; SQL 2k8.</p>
<p>&#160;</p>
<p>Create PROCEDURE [Util].usp_SearchAllDBforTable   <br />&#160;&#160;&#160; @tablename sysname    <br />AS    <br />declare @cmd1 varchar(500)    <br />set @cmd1 = &#8216;USE ?    <br />SELECT [TABLE_CATALOG]    <br />&#160;&#160;&#160;&#160;&#160; ,[TABLE_SCHEMA]    <br />&#160;&#160;&#160;&#160;&#160; ,[TABLE_NAME]    <br />&#160;&#160;&#160;&#160;&#160; ,[TABLE_TYPE]    <br />&#160; FROM [INFORMATION_SCHEMA].[TABLES]    <br />&#160; WHERE [TABLE_NAME] = &#8221;&#8217; + @tablename + &#8221;&#8221;    <br />exec sp_MSforeachdb&#160; @command1=@cmd1    <br />GO</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thedailydba.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thedailydba.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thedailydba.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thedailydba.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/thedailydba.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/thedailydba.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/thedailydba.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/thedailydba.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thedailydba.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thedailydba.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thedailydba.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thedailydba.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thedailydba.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thedailydba.wordpress.com/101/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thedailydba.wordpress.com&amp;blog=7445466&amp;post=101&amp;subd=thedailydba&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thedailydba.wordpress.com/2009/07/28/search-all-databases-for-a-table/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d6a46bd5b9ca689ee21a1793c34f6df1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ldgaller</media:title>
		</media:content>
	</item>
		<item>
		<title>SSIS: Using IF Then Else logic in Derived Columns</title>
		<link>http://thedailydba.wordpress.com/2009/07/28/ssis-using-if-then-else-logic-in-derived-columns/</link>
		<comments>http://thedailydba.wordpress.com/2009/07/28/ssis-using-if-then-else-logic-in-derived-columns/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 15:05:10 +0000</pubDate>
		<dc:creator>ldgaller</dc:creator>
				<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://thedailydba.wordpress.com/2009/07/28/ssis-using-if-then-else-logic-in-derived-columns/</guid>
		<description><![CDATA[A lot of people tend to use a custom script in order to accomplish If Then Else logic simply because the interface for the derived column data object does not have an IF\IIF operator.. In order to place an IF statement for the derived column you would use the following syntax: ({Boolean Expression}?{True Part}:{False Part}) [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thedailydba.wordpress.com&amp;blog=7445466&amp;post=98&amp;subd=thedailydba&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A lot of people tend to use a custom script in order to accomplish If Then Else logic simply because the interface for the derived column data object does not have an IF\IIF operator.. In order to place an IF statement for the derived column you would use the following syntax:</p>
<p>({Boolean Expression}?{True Part}:{False Part})</p>
<p>So if I were checking against a ProductType column to determine whether I should use WholesalePrice or RetailPrice You could simply write up something like the following.</p>
<p>([ProductType ]==99?[WholesalePrice ]:[RetailPrice ])</p>
<p>In order to use multiple entries you would just need to expand the syntax. For example: </p>
<p>([ProductType ]==99?[x]:([ProductType ]==1?[y]:[z]))</p>
<p>A benefit to using the derived column data object instead of a custom script task is that the process is so much faster. In my experience with large ETL sets of data substituting the derived column for the custom script task cuts the processing for that event by 50%. </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thedailydba.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thedailydba.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thedailydba.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thedailydba.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/thedailydba.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/thedailydba.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/thedailydba.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/thedailydba.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thedailydba.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thedailydba.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thedailydba.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thedailydba.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thedailydba.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thedailydba.wordpress.com/98/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thedailydba.wordpress.com&amp;blog=7445466&amp;post=98&amp;subd=thedailydba&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thedailydba.wordpress.com/2009/07/28/ssis-using-if-then-else-logic-in-derived-columns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d6a46bd5b9ca689ee21a1793c34f6df1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ldgaller</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL Server service account locked</title>
		<link>http://thedailydba.wordpress.com/2009/07/17/sql-server-service-account-locked/</link>
		<comments>http://thedailydba.wordpress.com/2009/07/17/sql-server-service-account-locked/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 15:10:14 +0000</pubDate>
		<dc:creator>ldgaller</dc:creator>
				<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://thedailydba.wordpress.com/2009/07/17/sql-server-service-account-locked/</guid>
		<description><![CDATA[I received the following message in the SQL Server error log after an Active Directory change inadvertently locked one of our sql service accounts. “The SQL Network Interface library could not register the Service Principal Name (SPN) for the SQL Server service. Error: 0&#215;2098. Failure to register an SPN may cause integrated authentication to fall [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thedailydba.wordpress.com&amp;blog=7445466&amp;post=96&amp;subd=thedailydba&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I received the following message in the SQL Server error log after an Active Directory change inadvertently locked one of our sql service accounts.</p>
<p>“The SQL Network Interface library could not register the Service Principal Name (SPN) for the SQL Server service. Error: 0&#215;2098. Failure to register an SPN may cause integrated authentication to fall back to NTLM instead of Kerberos. This is an informational message. Further action is only required if Kerberos authentication is required by authentication policies.”</p>
<p>The SPN is essentially a mapping between a principal name and the Windows account that started the server instance service. This is needed because the client will use the server’s hostname and the TCP/IP port to which it connects to compose an SPN. If the SPN mapping has not been performed, then the Windows security layer will be unable to determine the account associated with the SPN and Kerberos authentication will not be used. In an attempt to facilitate this, the SQL Server 2005 instance will automatically try to register the SPN with the AD at startup if TCP/IP is enabled. This message results from the fact that only a domain administrator or a Local System account has the authority to register an SPN. Therefore, under a normal account, SQL Server will be unable to register the SPN for the instance. This should normally not prevent the services from starting but for us it acted as a cryptic indicator that there was an issue with AD. Had we not discovered that the account was locked we would have had all sorts of issues once the cached credentials for the service account had expired.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thedailydba.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thedailydba.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thedailydba.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thedailydba.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/thedailydba.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/thedailydba.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/thedailydba.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/thedailydba.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thedailydba.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thedailydba.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thedailydba.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thedailydba.wordpress.com/96/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thedailydba.wordpress.com/96/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thedailydba.wordpress.com/96/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thedailydba.wordpress.com&amp;blog=7445466&amp;post=96&amp;subd=thedailydba&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thedailydba.wordpress.com/2009/07/17/sql-server-service-account-locked/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d6a46bd5b9ca689ee21a1793c34f6df1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ldgaller</media:title>
		</media:content>
	</item>
		<item>
		<title>Property IsLocked is not available for Login</title>
		<link>http://thedailydba.wordpress.com/2009/07/10/property-islocked-is-not-available-for-login/</link>
		<comments>http://thedailydba.wordpress.com/2009/07/10/property-islocked-is-not-available-for-login/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 13:42:50 +0000</pubDate>
		<dc:creator>ldgaller</dc:creator>
				<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://thedailydba.wordpress.com/2009/07/10/property-islocked-is-not-available-for-login/</guid>
		<description><![CDATA[One of my users phoned stating that their application sql logon was unable to connect. I checked the error logs and indeed saw that the logon attempts where failing. I then went to check the account settings in management studio and received the follow error when right clicking on the logon properties: TITLE: Microsoft SQL [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thedailydba.wordpress.com&amp;blog=7445466&amp;post=95&amp;subd=thedailydba&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>One of my users phoned stating that their application sql logon was unable to connect. I checked the error logs and indeed saw that the logon attempts where failing. I then went to check the account settings in management studio and received the follow error when right clicking on the logon properties:</p>
<p>TITLE: Microsoft SQL Server Management Studio<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
Cannot show requested dialog.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
ADDITIONAL INFORMATION:<br />
Cannot show requested dialog. (SqlMgmt)<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
Property IsLocked is not available for Login &#8216;[xxxx]&#8216;. This property may<br />
not exist for this object, or may not be retrievable due to<br />
insufficient access rights. (Microsoft.SqlServer.Smo)</p>
<p>Apparently the account had been disabled or was in some kind of funky state. About to drop and re-create the logon I decided to try and re-enable the account. Thankfully that resolved the issue and I did not have to drop and re-create the logon. I am still trying to determine root cause but if you encounter the same issue then run the following where “thelogon” is the logon in question and “thepassword” is the password for the account:</p>
<p>ALTER LOGIN [thelogon] WITH PASSWORD=N&#8217;thepassword&#8217;, DEFAULT_DATABASE=[master], DEFAULT_LANGUAGE=[us_english], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF <br />
GO  <br />
ALTER LOGIN [thelogon] ENABLE</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thedailydba.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thedailydba.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thedailydba.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thedailydba.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/thedailydba.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/thedailydba.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/thedailydba.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/thedailydba.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thedailydba.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thedailydba.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thedailydba.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thedailydba.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thedailydba.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thedailydba.wordpress.com/95/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thedailydba.wordpress.com&amp;blog=7445466&amp;post=95&amp;subd=thedailydba&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thedailydba.wordpress.com/2009/07/10/property-islocked-is-not-available-for-login/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d6a46bd5b9ca689ee21a1793c34f6df1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ldgaller</media:title>
		</media:content>
	</item>
		<item>
		<title>Optimizing Integration Services Lookups</title>
		<link>http://thedailydba.wordpress.com/2009/07/07/optimizing-integration-services-lookups/</link>
		<comments>http://thedailydba.wordpress.com/2009/07/07/optimizing-integration-services-lookups/#comments</comments>
		<pubDate>Tue, 07 Jul 2009 18:36:52 +0000</pubDate>
		<dc:creator>ldgaller</dc:creator>
				<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://thedailydba.wordpress.com/2009/07/07/optimizing-integration-services-lookups/</guid>
		<description><![CDATA[Be selective about the lookup columns Most designers would use the obvious default behavior of the Lookup transform, selecting a table or view to look up in. However, choosing a table will be interpreted as “SELECT *”. This will cause the transformation to fetch un-needed data. That is a waste of effort, memory and resources. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thedailydba.wordpress.com&amp;blog=7445466&amp;post=94&amp;subd=thedailydba&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h5>Be selective about the lookup columns</h5>
<p>Most designers would use the obvious default behavior of the Lookup transform, selecting a table or view to look up in. However, choosing a table will be interpreted as “SELECT *”. This will cause the transformation to fetch un-needed data. That is a waste of effort, memory and resources. I recommend choosing “Use results of an SQL query” instead of naming a table, and in the query selecting only the columns that are used.</p>
<h5>Enable memory restriction</h5>
<p>Two things happen when memory restriction is enabled on a Lookup: First, the amount of memory that the Lookup is allowed to use is limited. A cache policy is used and new rows are added to the cache on demand. Second, the new rows are added to the cache individually. In other words, SSIS will query the relational database whenever data for a row cannot be located in the internal cache kept by SSIS. These are single-row queries, unlike the large set-based table queries that occur when memory restriction is not enabled. The benefit of enabling memory restriction is that large lookups can be performed which might not be possible otherwise. The cost is that single row queries are used, which collectively are usually slower than a single table query. However, I have found that this performance cost is not always as bad as one might expect, if appropriate indexes are present on the lookup table.</p>
<h5>Conclusion</h5>
<p>Most of the time you will get good performance from Lookup transforms with default settings. Sometimes, lookups can become significant in the performance of an SSIS package especially&#160; if processing a large amount of source rows. I have given a few tips that I have found make the biggest difference in lookup performance. I hope you find them useful in your package designs. </p>
<ul>
<li>Be selective about the columns you request in a lookup </li>
<li>Enable memory restriction if the lookup is using too much memory </li>
<li>Be sure you have an appropriate index on the lookup table when using memory restriction </li>
<li>Consider enabling memory restriction if the lookup refers to a small number of rows from the lookup table</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/thedailydba.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/thedailydba.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/thedailydba.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/thedailydba.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/thedailydba.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/thedailydba.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/thedailydba.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/thedailydba.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/thedailydba.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/thedailydba.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/thedailydba.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/thedailydba.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/thedailydba.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/thedailydba.wordpress.com/94/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=thedailydba.wordpress.com&amp;blog=7445466&amp;post=94&amp;subd=thedailydba&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://thedailydba.wordpress.com/2009/07/07/optimizing-integration-services-lookups/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d6a46bd5b9ca689ee21a1793c34f6df1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ldgaller</media:title>
		</media:content>
	</item>
	</channel>
</rss>
