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

<channel>
	<title>Digital Formula - Technical &#187; Databases</title>
	<atom:link href="http://digitalformula.net/technical/category/databases/feed/" rel="self" type="application/rss+xml" />
	<link>http://digitalformula.net/technical</link>
	<description>Chris Rasmussen · Photographer · Infrastructure Guy · Code Dabbler · Traveller</description>
	<lastBuildDate>Thu, 17 Jun 2010 00:36:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>How to use SQL Server CE with C# 3.5 &#8211; The absolute basics</title>
		<link>http://digitalformula.net/technical/how-to-use-sql-server-ce-with-c-3-5-the-absolute-basics/</link>
		<comments>http://digitalformula.net/technical/how-to-use-sql-server-ce-with-c-3-5-the-absolute-basics/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 12:46:02 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[.net 3.5 c#.net]]></category>
		<category><![CDATA[c sharp]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[Development (Non-MS)]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[sql ce]]></category>
		<category><![CDATA[sql ce 3.5]]></category>
		<category><![CDATA[sql server]]></category>
		<category><![CDATA[sql server ce]]></category>

		<guid isPermaLink="false">http://digitalformula.net/?p=603</guid>
		<description><![CDATA[I&#8217;m writing this article because a small project I&#8217;ve been working on required me to look for information on using SQL Server CE with C# 3.5. I couldn&#8217;t find very many useful articles on the topic so I&#8217;ve decided to write my own and summarise some of the useful bits I found. For starters, why [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m writing this article because a small project I&#8217;ve been working on required me to look for information on using SQL Server CE with C# 3.5.  I couldn&#8217;t find very many useful articles on the topic so I&#8217;ve decided to write my own and summarise some of the useful bits I found.<span id="more-603"></span></p>
<p>For starters, why use SQL Server CE?  I think it&#8217;s an easy way of implementing a high supported and functional database solution for various types of applications although this article will focus on using SQL Server CE in a small Windows forms application.  To begin with you&#8217;ll need to download SQL Server CE from the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=DC614AEE-7E1C-4881-9C32-3A6CE53384D9&#038;displaylang=en" target="_blank">Microsoft website</a>.</p>
<p>In the past I think I&#8217;ve gone a bit overboard with the length of my posts so I&#8217;m going to attempt to keep this one short.  The application I used this code in is pretty well split up and uses a number of different layers but you don&#8217;t need to go this far to use SQL CE with your applications.  The code below is a summary only and covers the key things I think you need to know &#8211; feel free to ask any questions you need to.</p>
<p>I&#8217;m also aware that the code below *will* need modification before you can just throw it into your own applications but, as mentioned above, please post questions on this post if there is anything you need clarification on.</p>
<p>Creating the database ::</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p603code4'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p6034"><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code" id="p603code4"><pre class="csharp" style="font-family:monospace;"><span style="color: #6666cc; font-weight: bold;">string</span> connStr <span style="color: #008000;">=</span> <span style="color: #6666cc; font-weight: bold;">String</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Format</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Data Source = C:<span style="color: #008080; font-weight: bold;">\t</span>emp<span style="color: #008080; font-weight: bold;">\d</span>atabase.sdf&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008000;">&#40;</span>SqlCeEngine engine <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> SqlCeEngine<span style="color: #008000;">&#40;</span>connStr<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
   engine<span style="color: #008000;">.</span><span style="color: #0000FF;">CreateDatabase</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>Running a SQL command that doesn&#8217;t return a result set (note that this is, in some cases, where you would execute SQL to create the database structure after using the code above to create the database file itself) ::</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p603code5'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p6035"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code" id="p603code5"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008000;">&#40;</span>SqlCeConnection conn <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> SqlCeConnection<span style="color: #008000;">&#40;</span>connStr<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
   <span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008000;">&#40;</span>SqlCeCommand cmd <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> SqlCeCommand<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
   <span style="color: #008000;">&#123;</span>
      cmd<span style="color: #008000;">.</span><span style="color: #0000FF;">Connection</span> <span style="color: #008000;">=</span> conn<span style="color: #008000;">;</span>
      conn<span style="color: #008000;">.</span><span style="color: #0000FF;">Open</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
      cmd<span style="color: #008000;">.</span><span style="color: #0000FF;">CommandText</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;SELECT * FROM table_name&quot;</span><span style="color: #008000;">;</span>
   <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>Getting a record from the database ::</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p603code6'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p6036"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
</pre></td><td class="code" id="p603code6"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008000;">&#40;</span>var conn <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> SqlCeConnection<span style="color: #008000;">&#40;</span>connStr<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
   conn<span style="color: #008000;">.</span><span style="color: #0000FF;">Open</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
   <span style="color: #6666cc; font-weight: bold;">string</span> query <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;SELECT * FROM Applications WHERE id = @Id&quot;</span><span style="color: #008000;">;</span>
&nbsp;
   <span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008000;">&#40;</span>var cmd <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> SqlCeCommand<span style="color: #008000;">&#40;</span>query, conn<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
   <span style="color: #008000;">&#123;</span>
      <span style="color: #008080; font-style: italic;">// appId is a variable passed to the method that uses this code sample</span>
      cmd<span style="color: #008000;">.</span><span style="color: #0000FF;">Parameters</span><span style="color: #008000;">.</span><span style="color: #0000FF;">AddWithValue</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;@Id&quot;</span>, appId<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
      var reader <span style="color: #008000;">=</span> cmd<span style="color: #008000;">.</span><span style="color: #0000FF;">ExecuteResultSet</span><span style="color: #008000;">&#40;</span>ResultSetOptions<span style="color: #008000;">.</span><span style="color: #0000FF;">Scrollable</span> <span style="color: #008000;">|</span> ResultSetOptions<span style="color: #008000;">.</span><span style="color: #0000FF;">Updatable</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
      <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>reader<span style="color: #008000;">.</span><span style="color: #0000FF;">HasRows</span><span style="color: #008000;">&#41;</span>
      <span style="color: #008000;">&#123;</span>
         <span style="color: #0600FF; font-weight: bold;">while</span> <span style="color: #008000;">&#40;</span>reader<span style="color: #008000;">.</span><span style="color: #0000FF;">Read</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
         <span style="color: #008000;">&#123;</span>
            <span style="color: #6666cc; font-weight: bold;">int</span> Id <span style="color: #008000;">=</span> Convert<span style="color: #008000;">.</span><span style="color: #0000FF;">ToInt32</span><span style="color: #008000;">&#40;</span>reader<span style="color: #008000;">&#91;</span><span style="color: #666666;">&quot;Id&quot;</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #008080; font-style: italic;">// more code here to deal with other columns in the record that was selected from the database, if any</span>
         <span style="color: #008000;">&#125;</span>
      <span style="color: #008000;">&#125;</span>
   <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>That&#8217;s about as basic as it gets but I&#8217;m also in the process of writing another article about a basic application that uses this code in a &#8220;real-world&#8221; situation.</p>
]]></content:encoded>
			<wfw:commentRss>http://digitalformula.net/technical/how-to-use-sql-server-ce-with-c-3-5-the-absolute-basics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to perform an unattended installation of SQL Server 2008 Express</title>
		<link>http://digitalformula.net/technical/how-to-perform-an-unattended-installation-of-sql-server-2008-express/</link>
		<comments>http://digitalformula.net/technical/how-to-perform-an-unattended-installation-of-sql-server-2008-express/#comments</comments>
		<pubDate>Fri, 27 Mar 2009 03:32:33 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[.NET - C#]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[silent]]></category>
		<category><![CDATA[sql 2008]]></category>
		<category><![CDATA[sql 2008 express]]></category>
		<category><![CDATA[sql server 2008]]></category>
		<category><![CDATA[sql server 2008 express]]></category>
		<category><![CDATA[Unattended]]></category>

		<guid isPermaLink="false">http://digitalformula.net/?p=581</guid>
		<description><![CDATA[A while ago I wrote an article called &#8220;How to perform an unattended installation of SQL Server 2005 Express&#8220;. With the release of SQL Server 2008 it&#8217;s time to write another one about how to do the same but for SQL Server 2008 Express. So, let&#8217;s get started &#8230; Unattended installations of SQL Server can [...]]]></description>
			<content:encoded><![CDATA[<p>A while ago I wrote an article called &#8220;<a href="http://digitalformula.net/infrastructure/how-to-perform-an-unattended-installation-of-sql-server-2005-express/" target="_blank">How to perform an unattended installation of SQL Server 2005 Express</a>&#8220;.  With the release of SQL Server 2008 it&#8217;s time to write another one about how to do the same but for SQL Server 2008 Express.  So, let&#8217;s get started &#8230;<span id="more-581"></span></p>
<p>Unattended installations of SQL Server can be as involved as you want &#8211; pretty much every option can be specified in the configuration file.  For this example I’m going to perform a relatively basic installation with minimal customisation so you can see the process at work.  The installation will specify most of what I think are the critical options you&#8217;ll be interested in.  Note that for this example I&#8217;m using the x86 (32-bit) version with advanced services.</p>
<p>Assumptions:</p>
<ol>
<li>You&#8217;ve downloaded the x86 (32-bit) version of SQL Server 2008 Express from <a href="http://www.microsoft.com/express/sql/default.aspx" target="_blank">the Microsoft Microsoft SQL Server 2008 Express website</a></li>
<li>Your system meets the <a href="http://msdn.microsoft.com/en-us/library/ms143506.aspx" target="_blank">requirements for installing SQL Server 2008</a></li>
<li>You are installing from C:\Install\SQL2008 (you can change this as necessary but please make sure you update the paths in the examples below)</li>
<li>You&#8217;ll save your configuration file as C:\Install\sql-2008-express.ini</li>
</ol>
<p>Once you&#8217;ve satisfied those requirements follow the steps below.</p>
<ol>
<li>Run the executable you downloaded with the /x parameter (e.g. C:\Install\SQL2008\SQLEXPRADV_x86_ENU.exe</li>
<li>Choose a location to extract the installation files to.</li>
<li>Create a new text file that will become the unattended installation configuration file.  Leave it empty for now.</li>
</ol>
<p>Now that you’ve got a nicely extracted copy of the installation files you can carry on. The above steps were necessary for what’s coming up.</p>
<p>So, you can now create your own configuration file using <a href="http://msdn.microsoft.com/en-us/library/dd239405.aspx" target="_blank">Microsoft&#8217;s documentation</a> or you can use the version I&#8217;ve included in this article.</p>
<p><strong>Be careful with the Microsoft documentation as there is an error on the page called <a href="http://msdn.microsoft.com/en-us/library/ms144259.aspx" target="_blank">How to: Install SQL Server 2008 from the Command Prompt</a>.  It mentions a parameter called /BROWSERSVRACCOUNT but this should be /BROWSERSVCACCOUNT.  If you get this wrong the installation WILL fail.</strong></p>
<p>You can download the configuration file I&#8217;ve made below.  The changes I&#8217;ve made are as follows (you may need to change these to match your settings).</p>
<ul>
<li>Set the QUIETSIMPLE parameter to &#8220;True&#8221;.</li>
<li>Set the MEDIASOURCE parameter to the appropriate installation path.</li>
<li>Added a parameter called SAPWD and set it to the strong &#8216;sa&#8217; password.</li>
<li>Set the INDICATEPROGRESS parameter to &#8220;True&#8221;.</li>
<li>Set the SQLSYSADMINACCOUNTS value to &#8220;MYPC\Administrator&#8221;.</li>
</ul>
<p>Once you have your answer file all nicely setup and ready to use you’ll need to tell the setup program how to use it.</p>
<p>From a command prompt (or Start > Run if you’re into that) run the following command. Remember to change the file and path names to the ones that match your system.</p>
<div class="scriptsample">C:\Install\SQL2008\setup.exe /CONFIGURATIONFILE=C:\Install\sql-2008-express.ini</div>
<p>If you’ve done everything right this will start the installation process and you’ll end up with a SQL Server 2008 instance called SQLExpress running on your system. Easy!</p>
<p><a href='http://digitalformula.net/wp-content/uploads/2009/03/sql-2008-express.zip'>Click here to download a ZIP file that contains the full configuration file I&#8217;ve used in this article plus a script that does an unattended installation based on the configuration file.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://digitalformula.net/technical/how-to-perform-an-unattended-installation-of-sql-server-2008-express/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>SQLCMD.EXE on SQL 2008 doesn&#8217;t work &#8211; HResult 0&#215;2, Level 16, State 1</title>
		<link>http://digitalformula.net/technical/sqlcmdexe-on-sql-2008-doesnt-work-hresult-0x2-level-16-state-1/</link>
		<comments>http://digitalformula.net/technical/sqlcmdexe-on-sql-2008-doesnt-work-hresult-0x2-level-16-state-1/#comments</comments>
		<pubDate>Fri, 20 Mar 2009 04:13:40 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[.NET - C#]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[HResult 0x2]]></category>
		<category><![CDATA[Level 16]]></category>
		<category><![CDATA[sql 2008]]></category>
		<category><![CDATA[sql server]]></category>
		<category><![CDATA[sql server 2008]]></category>
		<category><![CDATA[SQLCMD]]></category>
		<category><![CDATA[SQLCMD.EXE]]></category>
		<category><![CDATA[Sqlcmd: Error: Microsoft SQL Server Native Client 10.0 : Login timeout expired]]></category>
		<category><![CDATA[State 1]]></category>

		<guid isPermaLink="false">http://digitalformula.net/?p=563</guid>
		<description><![CDATA[I&#8217;ve built one of my test servers with SQL Server Express 2008 w/ Advanced Services. On a whole load of our servers I use SQL Express for local installations and SQLCMD.EXE works well as a good way to run scheduled backups. It&#8217;s done this way because SQL Express doesn&#8217;t support SSIS (SQL Server Integration Services), [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve built one of my test servers with SQL Server Express 2008 w/ Advanced Services.  On a whole load of our servers I use SQL Express for local installations and SQLCMD.EXE works well as a good way to run scheduled backups.  It&#8217;s done this way because SQL Express doesn&#8217;t support SSIS (SQL Server Integration Services), the component required for scheduled tasks.  I wrote an article about this a while back called <a href="http://digitalformula.net/databases/sql-server-2005-express-scheduled-backup-how/">SQL Server 2005 Express Scheduled Backup &#8211; How?</a>  With SQL 2008, however, that SQLCMD.EXE didn&#8217;t work for me out of the box.  Here&#8217;s how I fixed it &#8230;<span id="more-563"></span></p>
<p>The instance in question has the default name of SQLEXPRESS.  Obviously this means that to connect to the server you need to use SERVER\SQLEXPRESS &#8211; that works fine from Management Studio and from the Java application installed on this particular server.  You can read about the problems I had with this installation in my article called <a href="http://digitalformula.net/scripts/apache-tomcat-6-war-wont-deploy/">Apache Tomcat 6 &#8211; .WAR won’t deploy</a>.</p>
<p>When using SQLCMD.EXE from the command line the full error message looks like this:</p>
<div class="scriptsample">HResult 0&#215;2, Level 16, State 1<br />
Named Pipes Provider: Could not open a connection to SQL Server [2].<br />
Sqlcmd: Error: Microsoft SQL Server Native Client 10.0 : A network-related or instance-specific error has occurred while establishing<br />
a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured<br />
to allow remote connections. For more information see SQL Server Books Online.<br />
Sqlcmd: Error: Microsoft SQL Server Native Client 10.0 : Login timeout expired.</div>
<p>Some Googling suggested that this problem could be caused by one of 2 things.  Firstly, that the SQL Browser service isn&#8217;t running &#8211; on my server it was running.  Secondly, named pipes aren&#8217;t enabled in the SQL Server Configuration Manager &#8230; on mine they are.  Hmmm.</p>
<p>I&#8217;ve had problems in the past with named instances of SQL Server so I had a look at the properties of the named pipes configuration and, sure enough, it said \\.\pipe\MSSQL$SQLEXPRESS\sql\query.  That *looks* ok, right?  Yes but it&#8217;s the cause of the problem.</p>
<p>I changed the named pipe to the following.</p>
<div class="scriptsample">\\.\pipe\sql\query</div>
<p>Voila!  SQLCMD.EXE now works from the command line meaning my scheduled backups now work too.  Not being a full-time DBA I&#8217;d put this down to a bit of a fluke on my part although I then found <a href="http://www.teamjohnston.net/blogs/jesse/post/2008/09/13/Using-SQL-Server-2008-Express-as-a-default-instance.aspx" target="_blank">an article by Jesse Johnston</a> that confirmed the same steps worked in their situation too.</p>
]]></content:encoded>
			<wfw:commentRss>http://digitalformula.net/technical/sqlcmdexe-on-sql-2008-doesnt-work-hresult-0x2-level-16-state-1/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>MS Access and C# &#8211; Syntax error in INSERT INTO statement</title>
		<link>http://digitalformula.net/technical/ms-access-and-c-syntax-error-in-insert-into-statement/</link>
		<comments>http://digitalformula.net/technical/ms-access-and-c-syntax-error-in-insert-into-statement/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 11:58:33 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[access]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[c# access]]></category>
		<category><![CDATA[microsoft access]]></category>
		<category><![CDATA[MS Access]]></category>

		<guid isPermaLink="false">http://digitalformula.net/?p=432</guid>
		<description><![CDATA[Recently I was working on a small application that required writing to a local Microsoft Access database. This was done using Microsoft C# .NET 3.5 (SP1) but every time I clicked the submit button on the relevant form I received an error message saying there was a syntax error in the INSERT INTO statement. Here&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I was working on a small application that required writing to a local Microsoft Access database.  This was done using Microsoft C# .NET 3.5 (SP1) but every time I clicked the submit button on the relevant form I received an error message saying there was a syntax error in the INSERT INTO statement.  Here&#8217;s how to fix this error &#8230;<span id="more-432"></span></p>
<p>For a start, the INSERT statement&#8217;s syntax was perfectly fine &#8211; I tested it using a new query from within Microsoft Access.  The fields in question were called &#8216;email&#8217; and &#8216;identifier&#8217; and it turned &#8216;email&#8217; is a reserved word in Microsoft Access.  One of the original SQL statements looked something like this:</p>
<div class="scriptsample">INSERT INTO mailinglist (email,identifier) VALUES (&#8216;test@test.com&#8217;,&#8217;111-111&#8242;);</div>
<p>That is one of the statements that caused the error.  Because of the Microsoft Access reserved words you must enclose the column names in square brackets, like this:</p>
<div class="scriptsample">INSERT INTO mailinglist ([email],[identifier]) VALUES (&#8216;test@test.com&#8217;,&#8217;111-111&#8242;);</div>
<p>Enclosing the column names in square brackets is apparently best practice anyway (as found in many MS SQL Server queries) but nonetheless &#8230; problem solved!</p>
]]></content:encoded>
			<wfw:commentRss>http://digitalformula.net/technical/ms-access-and-c-syntax-error-in-insert-into-statement/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>SQL Server 2005 Express Unattended Install &#8211; Further Info</title>
		<link>http://digitalformula.net/technical/sql-server-2005-express-unattended-install-further-info/</link>
		<comments>http://digitalformula.net/technical/sql-server-2005-express-unattended-install-further-info/#comments</comments>
		<pubDate>Tue, 19 Aug 2008 01:35:31 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[.NET - C#]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[silent]]></category>
		<category><![CDATA[sql server]]></category>
		<category><![CDATA[sql server 2005]]></category>
		<category><![CDATA[sql server 2005 express]]></category>
		<category><![CDATA[Unattended]]></category>
		<category><![CDATA[unattended install]]></category>

		<guid isPermaLink="false">http://www.digitalformula.net/?p=334</guid>
		<description><![CDATA[Recently I posted an article about how to perform an unattended installation of SQL Server 2005 Express. A comment was posted asking how to set some specific options during the installation &#8211; here&#8217;s how. The question posted was the following: Maybe you can help, cause i’ve pretty much give up :-/ These are the settings [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I posted an article about how to perform an <a href="http://www.digitalformula.net/infrastructure/how-to-perform-an-unattended-installation-of-sql-server-2005-express/">unattended installation of SQL Server 2005 Express</a>.  A comment was posted asking how to set some specific options during the installation &#8211; here&#8217;s how.<span id="more-334"></span></p>
<p>The question posted was the following:</p>
<div class="special">Maybe you can help, cause i’ve pretty much give up :-/<br />
These are the settings i need:<br />
Uncheck for “Hide the advanced configuration options”<br />
Enable all features except “Replication”<br />
i need it as “Default Instance”<br />
Using “Local System and “Use the build-in system account”<br />
I need both SQL Server and Browse<br />
and i need Mixed Mode</p>
<p>Is it possible to do that in the script file ?</p></div>
<p>The answer is as follows (with the exception of the hide advanced configuration options &#8211; it&#8217;s not necessary to worry about that during an unattended install).</p>
<div class="special">Yes, all the options you’ve asked about can be set in the script file. Here you go …</p>
<p>There is a section that begins with ADDLOCAL. Replication isn’t a valid option for SQL Express so I assume you’re trying to install SQL Express w/ Advanced Services? If so, set the ADDLOCAL= section to something like the following:</p>
<p>ADDLOCAL=SQL_Engine,SQL_Data_Files,Client_Components,Connectivity,SQL_SSMSEE,SDK</p>
<p>That will install the SQL Engine, data files, client components, client connectivity, management studio express and the SQL SDK. Note that SQL_SSMSEE is only valid for SQL Express w/ Advanced Services. Simply add ‘Replication’ to the list above if you *do* want to install replication (remember to comma-separate the options …)</p>
<p>For the default instance just set the INSTANCENAME= to the following:</p>
<p>INSTANCENAME=MSSQLSERVER</p>
<p>For the browser service, set the SQLBROWSERAUTOSTART= section to the following:</p>
<p>SQLBROWSERAUTOSTART=1</p>
<p>If you want SQL and the SQL Agent to auto start too, set the above section to the following:</p>
<p>SQLBROWSERAUTOSTART=1<br />
SQLAUTOSTART=1<br />
AGTAUTOSTART=1</p>
<p>For mixed mode, set the SECURITYMODE= section to the following:</p>
<p>SECURITYMODE=SQL</p>
<p>Note that if you configure your installation for mixed mode you also need to specify a strong SA password, for example:</p>
<p>SECURITYMODE=SQL<br />
SAPWD=sQ15Erv3R</p>
<p>To specify that the SQL Server service should use Local System as the credential, set the SQLACCOUNT= section to the following:</p>
<p>SQLACCOUNT=”NT AUTHORITY\LOCAL SERVICE”</p></div>
<p>Hope that helps someone.</p>
]]></content:encoded>
			<wfw:commentRss>http://digitalformula.net/technical/sql-server-2005-express-unattended-install-further-info/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL Server 2005 Express Scheduled Backup &#8211; How?</title>
		<link>http://digitalformula.net/technical/sql-server-2005-express-scheduled-backup-how/</link>
		<comments>http://digitalformula.net/technical/sql-server-2005-express-scheduled-backup-how/#comments</comments>
		<pubDate>Tue, 12 Aug 2008 01:21:24 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[maintenance plan]]></category>
		<category><![CDATA[scheduled backup]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[sql server]]></category>
		<category><![CDATA[sql server backup]]></category>
		<category><![CDATA[ssis]]></category>

		<guid isPermaLink="false">http://www.digitalformula.net/?p=290</guid>
		<description><![CDATA[A lot of my articles make use of or mention SQL Server Express, the light and cut-down and FREE version of Microsoft&#8217;s flagship database product Microsoft SQL Server. One of the features of the full and very expensive version of SQL Server 2005 is the ability to run scheduled backups using SQL Maintenance Plans. SQL [...]]]></description>
			<content:encoded><![CDATA[<p>A lot of my articles make use of or mention <a href="http://www.microsoft.com/sql/editions/express/default.mspx">SQL Server Express</a>, the light and cut-down and FREE version of Microsoft&#8217;s flagship database product <a href="http://www.microsoft.com/SQL/default.mspx">Microsoft SQL Server</a>.</p>
<p>One of the features of the full and very expensive version of SQL Server 2005 is the ability to run scheduled backups using SQL Maintenance Plans.  SQL Server requires SSIS (SQL Server Integration Services) for these to be available &#8211; unfortunately SQL Server Express doesn&#8217;t include SSIS.  There is a way to get scheduled backups for SQL Server Express though.<span id="more-290"></span></p>
<p>Before you begin you&#8217;ll need to install <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=C243A5AE-4BD1-4E3D-94B8-5A0F62BF7796&#038;displaylang=en">SQL Server Management Studio Express</a>.</p>
<p>Part 1 &#8211; Create a backup script</p>
<p>- Open SQL Server Management Studio Express and login as a user with sufficient permission to access the database(s) you want to backup.  You can do this as &#8216;sa&#8217; if you want.<br />
- Expand the name of your server or instance, expand Databases and select the database you want to backup.<br />
- Right-click the database name, select Tasks and then select Back Up.<br />
- Set the options you require for the backup.  For example you might want to change the location where the backup files get created, edit backup set retention period etc.<br />
- Once you&#8217;ve set the options necessary click the Script drop-down option at the top of the backup window and select either &#8216;Script Action to File&#8217;, or, if you want to see/edit the contents of the script before saving it, select &#8216;Script Action to New Query Window&#8217;.  I find it&#8217;s best to script the backup to a new query window because you can test it before saving.<br />
- Save the created script when you&#8217;re finished editing or enter an appropriate filename immediately if you selected &#8216;Script Action to File&#8217;.<br />
- If you saved the script, open it up &#8211; we&#8217;re going to test it before making it &#8216;live&#8217;.<br />
- Once you have the script open click the checkmark/tick button just to make absolutely sure the script is valid (it&#8217;s SQL Server-generated so it&#8217;d better be!).<br />
- Click the &#8216;Execute&#8217; button if you want to run a test.  If you are backing up a very large database this can take a while and you won&#8217;t get a whole lot of feedback while the backup is being run.  When the backup finishes the results will be displayed in the Results pane, successful or not.  If it fails, figure out why (e.g. check for sufficient disk space, permissions for the folder you&#8217;re backing up to etc).</p>
<p>The complete script for one of my databases is shown at the end of this article.</p>
<p>Part 2 &#8211; Schedule the backup</p>
<p>This part is simply about creating a Windows scheduled task &#8211; pretty easy really.</p>
<p>If you installed SQL Server Express into the default location the syntax for the command you need to run is as follows (note the Binn directory used, not Bin!)</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p290code10'); return false;">View Code</a> DOS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p29010"><td class="code" id="p290code10"><pre class="dos" style="font-family:monospace;">C:\Program Files\Microsoft SQL Server\<span style="color: #cc66cc;">90</span>\Tools\Binn\SQLCMD.EXE -s &lt;database&gt; -i &lt;sql script&gt;</pre></td></tr></table></div>

<p>For example:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p290code11'); return false;">View Code</a> DOS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p29011"><td class="code" id="p290code11"><pre class="dos" style="font-family:monospace;">C:\Program Files\Microsoft SQL Server\<span style="color: #cc66cc;">90</span>\Tools\Binn\SQLCMD.EXE -s my_database -i c:\scripts\backup_my_database.sql</pre></td></tr></table></div>

<p>So, let&#8217;s setup the scheduled task.</p>
<p>- Open Control Panel and select Scheduled Tasks<br />
- Click Add Scheduled Task, and browse to C:\Program Files\Microsoft SQL Server\90\Tools\Binn\SQLCMD.EXE when prompted for the command to run.<br />
- Select an appropriate frequency for the job and click Next.<br />
- Enter when you want the job to run and click Next.<br />
- Enter the credentials for the job.  These credentials should have permissions to both the database and the directory the database will be backed up to.  CLick Next.<br />
- Check the box that says open advanced properties for this task when I click Finish then click Finish.<br />
- Change the &#8216;Run&#8217; command to be the complete command above including the name of the database and the script you want to run, e.g. <i>C:\Program Files\Microsoft SQL Server\90\Tools\Binn\SQLCMD.EXE -s my_database -i c:\scripts\backup_my_database.sql</i>.<br />
- Click OK and confirm the password for the user running the scheduled task if you are prompted to do so.</p>
<p>That&#8217;s it, you&#8217;re done.  If you want to make absolutely sure it&#8217;s going to run as expected you can right-click the scheduled task and select &#8216;Run&#8217; &#8211; this will do make sure everything is configured ok.  Make sure you see a SQL backup file in the selected location after this.  If so, everything should be ok for the scheduled run.</p>
<p><strong>Don&#8217;t forget to add the backup directory to your offsite or tape backups (if you are doing them, AND YOU SHOULD BE!)</strong></p>
<p>Here is a complete backup script for one of my databases.  It&#8217;s configured to backup everything in a database called &#8216;prod&#8217; and retain the backups for a period of 7 days after which they will expire.  This helps limit the amount of disk space used by the backups.  This script is also set to verify the backup when done.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p290code12'); return false;">View Code</a> SQL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p29012"><td class="code" id="p290code12"><pre class="sql" style="font-family:monospace;">BACKUP <span style="color: #993333; font-weight: bold;">DATABASE</span> <span style="color: #66cc66;">&#91;</span>prod<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">TO</span>  DISK <span style="color: #66cc66;">=</span> N<span style="color: #ff0000;">'C:<span style="color: #000099; font-weight: bold;">\B</span>ackups<span style="color: #000099; font-weight: bold;">\S</span>QL<span style="color: #000099; font-weight: bold;">\p</span>rod.bak'</span> <span style="color: #993333; font-weight: bold;">WITH</span>  RETAINDAYS <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">7</span><span style="color: #66cc66;">,</span> NOFORMAT<span style="color: #66cc66;">,</span> NOINIT<span style="color: #66cc66;">,</span>  NAME <span style="color: #66cc66;">=</span> N<span style="color: #ff0000;">'prod-Full Database Backup'</span><span style="color: #66cc66;">,</span> SKIP<span style="color: #66cc66;">,</span> NOREWIND<span style="color: #66cc66;">,</span> NOUNLOAD<span style="color: #66cc66;">,</span>  STATS <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">10</span>
GO
declare @backupSetId <span style="color: #993333; font-weight: bold;">as</span> int
<span style="color: #993333; font-weight: bold;">select</span> @backupSetId <span style="color: #66cc66;">=</span> position <span style="color: #993333; font-weight: bold;">from</span> msdb<span style="color: #66cc66;">..</span>backupset <span style="color: #993333; font-weight: bold;">where</span> database_name<span style="color: #66cc66;">=</span>N<span style="color: #ff0000;">'prod'</span> <span style="color: #993333; font-weight: bold;">and</span> backup_set_id<span style="color: #66cc66;">=</span><span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">select</span> max<span style="color: #66cc66;">&#40;</span>backup_set_id<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">from</span> msdb<span style="color: #66cc66;">..</span>backupset <span style="color: #993333; font-weight: bold;">where</span> database_name<span style="color: #66cc66;">=</span>N<span style="color: #ff0000;">'prod'</span> <span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">if</span> @backupSetId <span style="color: #993333; font-weight: bold;">is</span> <span style="color: #993333; font-weight: bold;">null</span> begin raiserror<span style="color: #66cc66;">&#40;</span>N<span style="color: #ff0000;">'Verify failed. Backup information for database '</span><span style="color: #ff0000;">'prod'</span><span style="color: #ff0000;">' not found.'</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">16</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> end
RESTORE VERIFYONLY <span style="color: #993333; font-weight: bold;">FROM</span>  DISK <span style="color: #66cc66;">=</span> N<span style="color: #ff0000;">'C:<span style="color: #000099; font-weight: bold;">\B</span>ackups<span style="color: #000099; font-weight: bold;">\S</span>QL<span style="color: #000099; font-weight: bold;">\p</span>rod.bak'</span> <span style="color: #993333; font-weight: bold;">WITH</span>  FILE <span style="color: #66cc66;">=</span> @backupSetId<span style="color: #66cc66;">,</span>  NOUNLOAD<span style="color: #66cc66;">,</span>  NOREWIND
GO</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://digitalformula.net/technical/sql-server-2005-express-scheduled-backup-how/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Error 29506 when installing SQL Server 2005 Management Studio Express on Vista</title>
		<link>http://digitalformula.net/technical/error-29506-when-installing-sql-server-2005-management-studio-express-on-vista/</link>
		<comments>http://digitalformula.net/technical/error-29506-when-installing-sql-server-2005-management-studio-express-on-vista/#comments</comments>
		<pubDate>Wed, 25 Jun 2008 01:02:54 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[29506]]></category>
		<category><![CDATA[microsoft sql server management studio express setup]]></category>
		<category><![CDATA[msi]]></category>
		<category><![CDATA[sql server 2005 management studio express]]></category>
		<category><![CDATA[ssmsee]]></category>
		<category><![CDATA[the error code is 29506]]></category>
		<category><![CDATA[this may indicate a problem with this package]]></category>
		<category><![CDATA[Vista]]></category>

		<guid isPermaLink="false">http://www.digitalformula.net/?p=241</guid>
		<description><![CDATA[If you need to install SQL Server 2005 Management Studio Express on Windows Vista you might receive an error like the screenshot below. This is due to the new Vista feature called User Account Control or UAC. The fix is pretty simple and there are 2 different ways of implementing it. 1. Under &#8216;Accessories&#8217; from [...]]]></description>
			<content:encoded><![CDATA[<p>If you need to install SQL Server 2005 Management Studio Express on Windows Vista you might receive an error like the screenshot below.<span id="more-241"></span></p>
<p><img src="http://www.digitalformula.net/wp-content/uploads/2008/06/ss.jpg" alt="SSMSE installation error on Windows Vista" title="SSMSE installation error on Windows Vista" width="366" height="171" class="alignnone size-full wp-image-242" /></p>
<p>This is due to the new Vista feature called User Account Control or UAC.  The fix is pretty simple and there are 2 different ways of implementing it.</p>
<div class="special">1. Under &#8216;Accessories&#8217; from &#8216;All Programs&#8217;, right-click the Command Prompt shortcut and select &#8216;Run as Administrator&#8217;.  Accept the UAC warning when prompted.<br />
2. From the command prompt change to the directory that holds the SSMSEE installation .MSI file.<br />
3. Enter the command .\SQLServer2005_SSMSEE_x64.msi if you&#8217;re running Vista x64 (64-bit) or .\SQLServer2005_SSMSEE.msi if you&#8217;re running Vista x86 (32-bit)<br />
4. Press enter and complete the installation as normal.</div>
<p>The second method is to disable UAC completely but I wouldn&#8217;t recommend it.</p>
]]></content:encoded>
			<wfw:commentRss>http://digitalformula.net/technical/error-29506-when-installing-sql-server-2005-management-studio-express-on-vista/feed/</wfw:commentRss>
		<slash:comments>65</slash:comments>
		</item>
		<item>
		<title>So, what’s this Oracle thing then?</title>
		<link>http://digitalformula.net/technical/so-whats-this-oracle-thing-then/</link>
		<comments>http://digitalformula.net/technical/so-whats-this-oracle-thing-then/#comments</comments>
		<pubDate>Tue, 31 Jul 2007 00:40:14 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[Databases]]></category>

		<guid isPermaLink="false">http://www.digitalformula.net/?p=120</guid>
		<description><![CDATA[Note: Since writing this article back in 2007 I&#8217;ve finished the Diploma and papers listed below, including attaining a first-in-class A-grade pass in 157.223, Information Systems Design. First, some background info. I studied The National Diploma in Business Computing ages ago but started work before I completed it. A big mistake on my part as [...]]]></description>
			<content:encoded><![CDATA[<p>Note: Since writing this article back in 2007 I&#8217;ve finished the Diploma and papers listed below, including attaining a first-in-class A-grade pass in 157.223, Information Systems Design.</p>
<p>First, some background info.   I studied The National Diploma in Business Computing ages ago but started work before I completed it.   A big mistake on my part as it turns out that pretty much every job you go for these days wants to see some evidence of the ability to complete studies, projects &#8230; anything that demonstrates commitment really.<span id="more-120"></span></p>
<p>Before I continue I&#8217;ll just say that this article is a bit of a brain dump.   It&#8217;s as much for me as it is for anyone else as I find it easier to remember stuff if I write something about it.   If you get something out of this article, cool.   Please keep in mind that until I started this paper I could spell Oracle but that was about it &#8230; apologies to any Oracle gurus out there who think my ramblings are a waste of time.   <img src='http://digitalformula.net/technical/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Recently I looked into how much of my Diploma I had to go before it was finished.   Up until then I thought I had maybe 5 or 6 papers to do but I found that I only had 2!   The first paper, <a href="http://is157723.massey.ac.nz/papers/paperinfo.php?papercode=157221&#038;dlvryMode=&#038;location=&#038;registrnPeriod=0701">157.221 (Information Systems Analysis)</a>, is a pre-requisite for <a href="http://is157723.massey.ac.nz/papers/paperinfo.php?papercode=157223&#038;dlvryMode=I&#038;location=04&#038;registrnPeriod=0702">157.223 (Information Systems Design)</a>.   157.221 was already underway so I was a bit gutted as I thought I wouldn&#8217;t be able to complete the necessary papers in time (157.223 is being phased out at the end of 2007).</p>
<p>So anyway, I did some more digging and the Information Systems staff at <a href="http://www.massey.ac.nz/">Massey University of Wellington</a> agreed to grant me the right to study 157.223 without having completed 157.221.   This was after an interview with two of the Information Systems staff members to assess my ability to complete 157.223 without studying the material in 157.221.   Sweet!</p>
<p>So now that the background is out of the way, what&#8217;s this <a href="http://www.oracle.com">Oracle</a> thing then?</p>
<p>Ok, I&#8217;m not really going to harp on about what <a href="http://www.oracle.com">Oracle</a> is other than to say it&#8217;s currently one of best known database systems around.   The 157.223 course concentrates on using Oracle to teach the concepts of database design and implementation (Oracle-style of course).</p>
<p>So far we&#8217;ve only had 1 lab session on Oracle but it&#8217;s pretty cool &#8230; HUGE, but cool.   The Oracle people have been kind enough to give anyone the right to <a href="http://www.oracle.com/technology/software/products/database/oracle10g/index.html">download and install Oracle 10g</a>, the previous version of Oracle Database (the latest is <a href="http://www.oracle.com/database/index.html">Oracle 11g</a>).   The only requirement is that you don&#8217;t use the downloaded software for commercial purposes.</p>
<p>In the first lab session we hacked about with Oracle Designer, the tool that supplies utilities that allow you to start from no more than an idea and work your way towards a fully-functional database system.   The recommended steps of database design are all covered by the Oracle Designer utilities.   In other words you can get the GUI tool to create, amongst other things, your ER diagrams and table structures, both obviously critical parts of the final design.   It seems to me that even if you&#8217;ve had very little experience with database design you could probably grab Oracle 10g and throw together a fully-functioning system pretty quickly &#8230; yes you&#8217;ll need to read the manuals but that shouldn&#8217;t be a problem for anyone wanting to do it properly.</p>
<p>I&#8217;m typing this during what is supposed to be Lab #2 but unfortunately that isn&#8217;t happening due to a &#8220;glitch in The Matrix&#8221; &#8230; in other words the IT Services staff here have mucked something up and Oracle isn&#8217;t installed on our lab machines anymore.   Damn.   Interestingly they use <a href="http://www.altiris.com/Products/DeploymentSolution.aspx">Altiris Deployment Server</a>, a product I&#8217;ve had reasonably extensive experience with.   In the time they spent finding out that things were broken they probably could&#8217;ve got Oracle installed on all the lab machines &#8230; maybe they should&#8217;ve asked me.   Just kidding.   <img src='http://digitalformula.net/technical/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Anyway, where was I.   Oh yeah, Oracle.      We&#8217;ve also spent some time using the Database Design Transformer, a tool that can be used to create your database&#8217;s initial, first-cut design from the analysis data model &#8211; a representation of the business&#8217;s information needs.   The result of this process is to, for example, describe basic transformation rules and predict the resulting transformations.</p>
<p>After we had our first-cut design sorted out we then had to use the Design Editor to refine that design even further.   The Design Editor is described in our text as &#8220;the primary Oracle Designer tool for design and build tasks.&#8221;   So far I&#8217;d agree &#8230; hehe.</p>
<p>In the lab scheduled for today we were supposed to do a whole load more with refinement of our design but as mentioned earlier there&#8217;s no Oracle around for me to use right now so I&#8217;ll have to skip writing about that &#8230; doh.   Maybe next week Oracle will be reinstalled and I can actually write something interesting.</p>
<p>Bye!</p>
]]></content:encoded>
			<wfw:commentRss>http://digitalformula.net/technical/so-whats-this-oracle-thing-then/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MSDE Authentication Modes</title>
		<link>http://digitalformula.net/technical/msde-authentication-modes/</link>
		<comments>http://digitalformula.net/technical/msde-authentication-modes/#comments</comments>
		<pubDate>Wed, 18 Apr 2007 03:22:20 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[Databases]]></category>

		<guid isPermaLink="false">http://www.digitalformula.net/?p=94</guid>
		<description><![CDATA[When you install Microsoft MSDE you might need to change the security configuration so that you use one of the following methods of authentication. - SQL Authentication [ login to the server using a SQL Server login ] - Windows Authentication [ login to the server using a Windows/Active Directory login ] - Mixed Mode [...]]]></description>
			<content:encoded><![CDATA[<p>When you install <a href="http://www.microsoft.com/sql/prodinfo/previousversions/msde/prodinfo.mspx">Microsoft MSDE</a> you might need to change the security configuration so that you use one of the following methods of authentication.<span id="more-94"></span></p>
<p>- SQL Authentication [ login to the server using a SQL Server login ]<br />
- Windows Authentication [ login to the server using a Windows/Active Directory login ]<br />
- Mixed Mode Authentication [ login to the server using either of the two types above ]</p>
<p>There are a couple of ways to accomplish this.   Most people, sometimes to their demise, configure their servers for &#8220;Mixed Mode&#8221; authentication, i.e. allow both SQL and Windows logins access to the server.   Sometimes, however, this is a requirement, for example if the application connecting to MSDE simple can&#8217;t use Windows authentication.   To enable mixed mode authentication you can specify the option during setup, as follows :</p>
<div class="scriptsample">setup.exe SECURITYMODE=SQL SAPWD=p@ssw0rd&#038;23</div>
<p>Note the use of the SAPWD parameter to specify a strong &#8216;sa&#8217; password at install time.</p>
<p>If you&#8217;ve already installed MSDE and don&#8217;t want to reinstall it you can modify the authentication mode by using Enterprise Manager and changing the properties of the SQL instance you&#8217;re working with or you can use the registry editor (the registry edit method may be the only option available to you if you don&#8217;t have any administration tools like Enterprise Manager installed).   If we assume you&#8217;re modifying a default instance of SQL Server the registry key you need to change is :</p>
<div class="scriptsample">HKLM\Software\Microsoft\MSSqlserver\MSSqlServer\LoginMode</div>
<p>The modes are as follows :</p>
<p>0 = SQL Authentication<br />
1 = Windows Authentication<br />
2 = Mixed Mode Authentication</p>
<p>After you&#8217;ve made this change you will need to stop and restart the MSDE services.</p>
<p>USE REGISTRY EDITOR AT YOUR OWN RISK!</p>
<p>Here is the Microsoft article re <a href="http://support.microsoft.com/kb/325022">MSDE Security &#038; Authentication</a>.</p>
<p>Click the following link to read my post about fixing <a href="http://www.digitalformula.net/databases/access-denied-when-connecting-to-msde-remotely-after-installation/">“Access Denied” errors when connecting to MSDE remotely after installation</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://digitalformula.net/technical/msde-authentication-modes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;Access Denied&#8221; when connecting to MSDE remotely after installation</title>
		<link>http://digitalformula.net/technical/access-denied-when-connecting-to-msde-remotely-after-installation/</link>
		<comments>http://digitalformula.net/technical/access-denied-when-connecting-to-msde-remotely-after-installation/#comments</comments>
		<pubDate>Tue, 17 Apr 2007 23:11:26 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[Databases]]></category>

		<guid isPermaLink="false">http://www.digitalformula.net/?p=92</guid>
		<description><![CDATA[I had to install a product today that requires some sort of SQL Server installation. The server it&#8217;s on didn&#8217;t have the full SQL Server product installed (it&#8217;d be overkill) so MSDE 2000 was installed. First up, you need to set a strong password for &#8216;sa&#8217; account when installing MSDE. You do this by running [...]]]></description>
			<content:encoded><![CDATA[<p>I had to install a product today that requires some sort of SQL Server installation.   The server it&#8217;s on didn&#8217;t have the full SQL Server product installed (it&#8217;d be overkill) so <a href="http://www.microsoft.com/sql/prodinfo/previousversions/msde/prodinfo.mspx">MSDE 2000</a> was installed.<span id="more-92"></span>   First up, you need to set a strong password for &#8216;sa&#8217; account when installing MSDE.   You do this by running the following :</p>
<div class="scriptsample">setup.exe SAPWD=
<password></div>
<p>where
<password> is the password you want for the &#8216;sa&#8217; account.   For example :</p>
<div class="scriptsample">setup.exe SAPWD=passw0rd&#038;23</div>
<p>Click here for <a href="http://support.microsoft.com/kb/810826/">more information on the parameters you can use when running MSDE setup</a>.</p>
<p>So anyway, once you&#8217;ve done that you might find you can&#8217;t connect to your nice new shiny MSDE server over the network due to an error that looks like the following :</p>
<p><img src='http://www.digitalformula.net/wp-content/uploads/2007/04/sql_server_access_denied.jpg' alt='MSDE - Access Denied' class="postphoto" /></p>
<p>This is because by default there are no remote protocols enabled, i.e. you can&#8217;t connect remotely.   To fix this you can either hack up the registry but we&#8217;re not going to do that here.   Instead we&#8217;re going to use the SVRNETCN.EXE utility that comes with SQL Server.   Unless you&#8217;ve installed MSDE as a named instance this executable is available in the following path :</p>
<div class="scriptsample">C:\Program Files\Microsoft SQL Server\80\Tools\Binn\SVRNETCN.exe</div>
<p>Run this and you&#8217;ll get something that looks like the following.</p>
<p><img src='http://www.digitalformula.net/wp-content/uploads/2007/04/sql_server_svrnetcn.jpg' alt='MSDE SVRNETCN Screenshot' class="postphoto" /></p>
<p>For typical networks/installations using TCP/IP will be sufficient.   If this is ok for you select TCP/IP from the list of &#8216;Disabled Protocols&#8217; on the left side of the screen and click the &#8216;Enable >>&#8217; button to enable the protocol.   Click OK and accept the message that comes up saying you need to restart SQL Server before the change will take effect.</p>
<p>From Control Panel | Administrative Tools | Services you&#8217;ll then need to find the service for the instance of SQL that you&#8217;re working with (by default this is called &#8220;MSSQLSERVER&#8221;) and restart it &#8230; right-click the service name and select &#8220;Restart&#8221;.   If SQLSERVERAGENT is running you&#8217;ll be asked if you want to restart this too &#8211; you&#8217;ll need to say Yes to continue.</p>
<p>After this you should be able to use Query Analyser or Enterprise Manager to administer your MSDE installation using the &#8216;sa&#8217; account (note that MSDE doesn&#8217;t come with these tools as standard though).</p>
<p>If you want to login to your MSDE server using Windows Authentication you have to enable that too &#8230; I&#8217;ll post about that shortly (there are registry changes involved if you don&#8217;t run setup with the appropriate switches at install time).</p>
]]></content:encoded>
			<wfw:commentRss>http://digitalformula.net/technical/access-denied-when-connecting-to-msde-remotely-after-installation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
