<?xml version="1.0" encoding="utf-8"?>
<feed xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom">
  <title>George Wesolowski's .NET Weblog</title>
  <link rel="alternate" type="text/html" href="http://www.georgewesolowski.com/blog/" />
  <link rel="self" href="http://www.georgewesolowski.com/blog/SyndicationService.asmx/GetAtom" />
  <icon>favicon.ico</icon>
  <updated>2006-12-04T21:23:18.0445062-05:00</updated>
  <author>
    <name>George D. Wesolowski</name>
  </author>
  <subtitle />
  <id>http://www.georgewesolowski.com/blog/</id>
  <generator uri="http://www.dasblog.net" version="1.8.5223.0">DasBlog</generator>
  <entry>
    <title>SQL Server 2005 Bulk Insert using Windows Authentication ...</title>
    <link rel="alternate" type="text/html" href="http://www.georgewesolowski.com/blog/PermaLink,guid,6808c71c-9efb-47f7-9068-247e00501db3.aspx" />
    <id>http://www.georgewesolowski.com/blog/PermaLink,guid,6808c71c-9efb-47f7-9068-247e00501db3.aspx</id>
    <published>2006-12-04T21:23:18.0445062-05:00</published>
    <updated>2006-12-04T21:23:18.0445062-05:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Here's the scenario that tripped us up during our SQL Server 2005 upgrade:  
   </p>
        <p>
      Consider a stored procedure that executes a BULK INSERT command where the file in
      the FROM clause is located on a remote machine.  When executing this stored procedure
      using a trusted connection, i.e., Windows Authentication, the Windows account must
      be <em>trusted for delegation</em> in order for this stored procedure to be executed <strong><em>remotely</em></strong>. 
      However, based on my testing, the following scenarios will work:
   </p>
        <ol>
          <li>
         Modify the stored procedure to BULK INSERT a local file, i.e., local to the SQL Server. 
         The stored procedure can be successfully executed either locally or remotely,</li>
          <li>
         Execute the stored proceude that BULK INSERTs a remote file locally on the SQL Server
         machine.  In other words, the SQL Client and SQL Server machines must be one
         and the same.</li>
        </ol>
        <p>
      For the most common client / server scenario (separate client and server machines
      with the BULK INSERT file located on a third server) the Windows account used to execute
      the stored procedure must be trusted for delegation.  
   </p>
        <p>
      However, from a security perspective, using SQL authentication is probably the best
      solution ...
   </p>
        <p>
       
   </p>
        <img width="0" height="0" src="http://www.georgewesolowski.com/blog/aggbug.ashx?id=6808c71c-9efb-47f7-9068-247e00501db3" />
      </div>
    </content>
  </entry>
  <entry>
    <title>My Favorite Screen Saver ...</title>
    <link rel="alternate" type="text/html" href="http://www.georgewesolowski.com/blog/PermaLink,guid,a81be3de-01bb-480e-9fe3-376944ed9486.aspx" />
    <id>http://www.georgewesolowski.com/blog/PermaLink,guid,a81be3de-01bb-480e-9fe3-376944ed9486.aspx</id>
    <published>2006-11-16T14:00:20.6753614-05:00</published>
    <updated>2006-11-16T14:00:20.6753614-05:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      I'm not usually a big fan of screen savers - I always lock my desktop(s) before stepping
      away from my desk - but I've run into an excellent one <a href="http://www.microsoft.com/technet/sysinternals/miscellaneous/BlueScreen.mspx">here</a>. 
      It's a simulation of a "blue screen of death" followed by a reboot - very realistic
      (right down to simulating disk activity) ...
   </p>
        <p>
      Install this one and play a trick on your favorite network admin!  (But first
      make sure he has a sense of humor!)
   </p>
        <img width="0" height="0" src="http://www.georgewesolowski.com/blog/aggbug.ashx?id=a81be3de-01bb-480e-9fe3-376944ed9486" />
      </div>
    </content>
  </entry>
  <entry>
    <title>SQL Server Bulk Insert Woes ...</title>
    <link rel="alternate" type="text/html" href="http://www.georgewesolowski.com/blog/PermaLink,guid,830d4f54-6ad3-4673-8430-c24d61eebe0e.aspx" />
    <id>http://www.georgewesolowski.com/blog/PermaLink,guid,830d4f54-6ad3-4673-8430-c24d61eebe0e.aspx</id>
    <published>2006-11-15T13:50:38.0340000-05:00</published>
    <updated>2006-11-15T13:51:56.0673066-05:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Our recent conversion from SQL Server 2000 to SQL Server 2005 revealed a couple of
      issues with stored procedures that run BULK INSERT commands.  [These issues were
      not issues with under SQL Server 2000.]
   </p>
        <p>
      1.  "Operating system error code 5(Access is Denied)" when attempting to execute
      this command using Windows Authentication.  This appears to be an impersonation
      / delegation issue that we believe we can fix with delegation.  [<em>Stay tuned
      ...</em>]
   </p>
        <p>
      2.  Assorted format file errors "Invalid destination table column number ...",
      "Bulk load data conversion error (truncation)", etc.  We've been able to workaround
      these by increasing the column widths for some of the column definitions.
   </p>
        <p>
      The moral of the story is to test everything that calls a BULK INSERT carefully as
      part of the upgrade process ...
   </p>
        <img width="0" height="0" src="http://www.georgewesolowski.com/blog/aggbug.ashx?id=830d4f54-6ad3-4673-8430-c24d61eebe0e" />
      </div>
    </content>
  </entry>
  <entry>
    <title>SQL Server 2005 Upgrade et al ...</title>
    <link rel="alternate" type="text/html" href="http://www.georgewesolowski.com/blog/PermaLink,guid,ead45850-821d-4d61-9c99-d38a00c52878.aspx" />
    <id>http://www.georgewesolowski.com/blog/PermaLink,guid,ead45850-821d-4d61-9c99-d38a00c52878.aspx</id>
    <published>2006-11-13T13:39:28.4740000-05:00</published>
    <updated>2006-11-15T13:51:45.9889881-05:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      This space has been a little quiet for a while now but I've been busy with a major
      SQL Server upgrade as well as architecting a generic job scheduling environment (and
      working with DataGridViews for our standard data entry screens) ...
   </p>
        <p>
      Look for upcoming posts on the difficulties we've run into with our SQL Server upgrade
      ...
   </p>
        <img width="0" height="0" src="http://www.georgewesolowski.com/blog/aggbug.ashx?id=ead45850-821d-4d61-9c99-d38a00c52878" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Database File Permissions with Multiple Instances of SQL Server 2005 on a Single Box ...</title>
    <link rel="alternate" type="text/html" href="http://www.georgewesolowski.com/blog/PermaLink,guid,aee51d3d-94fc-4ce6-b492-7805ff8f83a9.aspx" />
    <id>http://www.georgewesolowski.com/blog/PermaLink,guid,aee51d3d-94fc-4ce6-b492-7805ff8f83a9.aspx</id>
    <published>2006-06-23T11:13:15.4557081-04:00</published>
    <updated>2006-06-23T11:13:15.4557081-04:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      I ran into a situation on my SQL Server 2005 test machine where I wanted to swap database
      files that were installed on two separate instances of SQL Server 2005.  [One
      instance is the "default" instance, and one is named "Instance1".]  The database
      files are located in a parallel file structure like so:
   </p>
        <p>
      D:\SQLData\MSSQL
   </p>
        <p>
      D:\SQLData\MSSQL$INSTANCE1
   </p>
        <p>
      I figured the easiest way to accomplish this is to detach the databases from both
      servers, shutdown the SQL Services, swap the names of the two directories, startup
      the SQL Services, and reattach the databases.  Upon reattaching the databases,
      I recieved a permissions failure ...
   </p>
        <p>
      To fix this, I examined the file permissions of the data and log files.  In my
      case, I needed both the local system account and the appropriate SQL Server user account
      corresponding to the SQL Server instance [in my case, the account is named SQLServer2005MSSQLUser$&lt;machine_name&gt;$&lt;instance_name&gt;]
      to have Full Control.  [Swapping the names of the folders meant the data and
      log files permissions gave Full Control to the user associated with the other instance.]
   </p>
        <p>
      All this assumes that the SQL Server instances run under the Local System account
      ...
   </p>
        <img width="0" height="0" src="http://www.georgewesolowski.com/blog/aggbug.ashx?id=aee51d3d-94fc-4ce6-b492-7805ff8f83a9" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Helpful Hint for Connecting to Multiple Instances of SQL Server 2005, Part Deux ...</title>
    <link rel="alternate" type="text/html" href="http://www.georgewesolowski.com/blog/PermaLink,guid,c9321fc7-9bbf-4d84-909a-b7076c13ea87.aspx" />
    <id>http://www.georgewesolowski.com/blog/PermaLink,guid,c9321fc7-9bbf-4d84-909a-b7076c13ea87.aspx</id>
    <published>2006-05-17T16:18:05.9692047-04:00</published>
    <updated>2006-05-17T16:18:05.9692047-04:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Here's another way around the problem:  enable and start the SQL Server Browser
      service on the SQL Server 2005 machine.  This will allow you to connect remotely
      to non-default instances without specifying the port number ...
   </p>
        <img width="0" height="0" src="http://www.georgewesolowski.com/blog/aggbug.ashx?id=c9321fc7-9bbf-4d84-909a-b7076c13ea87" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Helpful Hint for Connecting to Multiple Instances of SQL Server 2005 ... </title>
    <link rel="alternate" type="text/html" href="http://www.georgewesolowski.com/blog/PermaLink,guid,f0936e80-8411-48d5-959c-18f71027ee85.aspx" />
    <id>http://www.georgewesolowski.com/blog/PermaLink,guid,f0936e80-8411-48d5-959c-18f71027ee85.aspx</id>
    <published>2006-05-16T14:22:58.5110000-04:00</published>
    <updated>2006-05-17T14:28:13.7086818-04:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      In our test environment, we install multiple instances of SQL Server 2005 on the same
      box.  If you are having trouble remotely connecting to your non-default instances,
      be sure to do the following:
   </p>
        <p>
      1.  Make sure the TCP/IP protocol is enabled for your instance.  Use the
      SQL Server Configuration Manager (a SQL 2005 client tool) to do this.
   </p>
        <p>
      2.  While you are using this tool, make note of dynamic TCP port that your instance
      is using.  SQL Server instances communicate on a single port.  The default
      port is 1433, which is what you get for the default instance, but for additional instances,
      a dynamic port is randomly selected for you at install.
   </p>
        <p>
      3.  When remotely connecting to a SQL Server 2005 instance that is not the default
      instance, use the server name and port number.  For example, to connect to SERVER1\Instance5,
      enter "SERVER1\Instance5,&lt;nnnn&gt;", where &lt;nnnn&gt; is the dynamic port number
      of the specified instance.<br /></p>
        <p class="MsoNormal">
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
            <font face="Verdana">
            </font>
          </span>
        </p>
        <img width="0" height="0" src="http://www.georgewesolowski.com/blog/aggbug.ashx?id=f0936e80-8411-48d5-959c-18f71027ee85" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Visual Source Safe 2005 Integration with SQL Server 2005 ...</title>
    <link rel="alternate" type="text/html" href="http://www.georgewesolowski.com/blog/PermaLink,guid,a078bc68-0b3e-4460-88b1-31d1e13f125c.aspx" />
    <id>http://www.georgewesolowski.com/blog/PermaLink,guid,a078bc68-0b3e-4460-88b1-31d1e13f125c.aspx</id>
    <published>2006-03-10T19:58:45.2310000-05:00</published>
    <updated>2006-03-13T20:59:05.2397354-04:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      At my shop, we've been looking into the source code control integration that's available
      for our database objects such as stored procedures, functions, triggers, etc. 
      Since we are in the progress of migrating from SQL Server 2000 to SQL Server 2005,
      we looked at the integration that's available betweem VSS 2005 and SQL Server Management
      Studio ...
   </p>
        <p>
      In a nutshell, you can create a SQL Server Management Studio solution (*.ssmssln)
      that contains any number of SQL scripts (*.sql).  You have the option of scripting
      the entire database, including schema and code, in a single script, or scripting each
      object individually.  These scripts can then be managed by VSS 2005 as you would
      manage any piece of source code ...
   </p>
        <p>
      The only thing lacking is the fact that you can't directly manage what's checked into
      VSS at the "source" level vs. what's compiled in SQL Server.  However, if your
      development team is disciplined enough to use SQL Server Management Studio as the
      sole tool for managing SQL scripts (and executing the scripts as they are checked
      in), then source code management of SQL Server objects can be achieved using the combination
      of SQL Server Management Studio and VSS 2005 ...
   </p>
        <img width="0" height="0" src="http://www.georgewesolowski.com/blog/aggbug.ashx?id=a078bc68-0b3e-4460-88b1-31d1e13f125c" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Loading a .NET Assembly from a Network Drive ...</title>
    <link rel="alternate" type="text/html" href="http://www.georgewesolowski.com/blog/PermaLink,guid,4cc5fcdf-cc68-4cf0-a083-b22a8bdc92d6.aspx" />
    <id>http://www.georgewesolowski.com/blog/PermaLink,guid,4cc5fcdf-cc68-4cf0-a083-b22a8bdc92d6.aspx</id>
    <published>2006-02-17T20:24:21.5690000-05:00</published>
    <updated>2006-03-13T21:24:21.5696294-04:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      In lieu of installing a .NET application (including referenced assemblies) to an Intranet
      server or network share, you may be tempted to copy your assemblies to a network drive
      and execute them directly from there.  However, if you've ever tried to do this,
      your application probably threw a SecurityException ...
   </p>
        <p>
      To get around this, you have a few options that are documented at <a href="http://blogs.msdn.com/shawnfa/archive/2003/06/20/57023.aspx">the
      .Net Security Blog</a>.  You could open up your security policy to fully trust
      the Intranet Zone, which is probably a bad idea.  Or, you could strongly-name
      each assembly and configure the appropriate permissions for each assembly that you
      are going to deploy, which is a better idea.  However, this means that you need
      to modify configuration settings on each user's machine every time a new assembly
      is deployed ...
   </p>
        <p>
      To avoid this, you could configure a specific network folder (and subdirectories)
      to be fully trusted.  This way, all future assemblies can be deployed to this
      network folder without the need to individually configure each assembly.  Of
      course, you still open yourself up to rogue applictions that are installed in this
      folder being fully trusted, but you are more secure than if you fully trusted your
      entire Intranet!
   </p>
        <p>
      To fully trust a specific network folder:
   </p>
        <ol>
          <li>
         Open the <em>.NET Framework 2.0 Configuration</em> applet,</li>
          <li>
         Expand the tree to <em>My Computer</em>, <em>Runtime Security Policy</em>, <em>Machine</em>, <em>Code
         Groups</em>, <em>LocalIntranet_Zone</em>,</li>
          <li>
         Right-click <em>New...</em> to create a new code group,</li>
          <li>
         Name your code group,</li>
          <li>
         Choose <em>URL</em> as the condition type for this code group,</li>
          <li>
         For the <em>URL</em>, enter a UNC path using the following format:  <em>file://\\&lt;network
         drive&gt;\folder</em></li>
          <li>
         On the next page of the wizard, select Full Trust as the existing permission
         set,</li>
          <li>
         Click Finish to add the code group ...</li>
        </ol>
        <p>
      To test that your assembly is now fully-trusted from the network path, right-click
      at the <em>Runtime Security Policy</em> node and choose <em>Evaluate Assembly... </em>. 
      If you navigate to your assembly, you can validate that your assembly is indeed fully-trusted. 
      Of course, you can always execute your assembly to validate that your assembly no
      longer throws a SecurityException, but using <em>Evaluate Assembly... </em>can come
      in handy when debugging security problems ...
   </p>
        <img width="0" height="0" src="http://www.georgewesolowski.com/blog/aggbug.ashx?id=4cc5fcdf-cc68-4cf0-a083-b22a8bdc92d6" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Issue With Realtek 8110 Network Driver and Windows Server 2003 ...</title>
    <link rel="alternate" type="text/html" href="http://www.georgewesolowski.com/blog/PermaLink,guid,bd2bb040-4f2b-4792-a8df-461bed7880c0.aspx" />
    <id>http://www.georgewesolowski.com/blog/PermaLink,guid,bd2bb040-4f2b-4792-a8df-461bed7880c0.aspx</id>
    <published>2006-02-04T13:12:02.0490000-05:00</published>
    <updated>2006-02-06T13:12:02.0495259-05:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      I recently installed a hardware upgrade on my email server and was forced to reboot
      the machine.  [The machine is a year old or so, Socket 754 AMD64 processor, MSI
      K8T NEO-FIS2R motherboard.]  After the machine came back up, I noticed that the
      NIC driver (Realtek 8110S integrated NIC) did not load.  This had been working
      for the past 6 months or so (ever since I installed Windows Server 2003 on the machine)
      and has been used in a production environment without incident ...
   </p>
        <p>
      Perplexed, I went rooting around for a driver for this NIC that supports Windows Server
      2003 and could not find one specific to that operating system.  How in the world
      did I get it to work before ???
   </p>
        <p>
      To make a long story short, I discovered that I had previously installed the Realtek
      8169 driver, despite the warning that this driver did not match the hardware. 
      Installing this driver did the trick ...
   </p>
        <img width="0" height="0" src="http://www.georgewesolowski.com/blog/aggbug.ashx?id=bd2bb040-4f2b-4792-a8df-461bed7880c0" />
      </div>
    </content>
  </entry>
</feed>