<?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>I Learnt Today... &#187; Database</title>
	<atom:link href="http://www.ilearnttoday.com/category/information-technology/database/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ilearnttoday.com</link>
	<description>This is where I share what I learn day by day...</description>
	<lastBuildDate>Fri, 18 May 2012 13:36:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>How To Check For NULL Values Correctly In SQL</title>
		<link>http://www.ilearnttoday.com/nullcheckinsql</link>
		<comments>http://www.ilearnttoday.com/nullcheckinsql#comments</comments>
		<pubDate>Thu, 17 May 2012 09:15:43 +0000</pubDate>
		<dc:creator>Menol</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[checking for Null values]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://www.ilearnttoday.com/?p=665</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<pre class="brush: sql; title: ; notranslate">
SELECT PatientId FROM Patients WHERE Surname = NULL  --  THIS IS WRONG
SELECT PatientId FROM Patients WHERE Surname is NULL  --  THIS IS CORRECT

SELECT PatientId FROM Patients WHERE Surname != NULL  --  THIS IS WRONG
SELECT PatientId FROM Patients WHERE Surname is not NULL  --  THIS IS CORRECT
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ilearnttoday.com/nullcheckinsql/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using TimeStamp columns to keep track of database record versions</title>
		<link>http://www.ilearnttoday.com/timestamp-columns</link>
		<comments>http://www.ilearnttoday.com/timestamp-columns#comments</comments>
		<pubDate>Fri, 07 Oct 2011 14:27:47 +0000</pubDate>
		<dc:creator>Menol</dc:creator>
				<category><![CDATA[Data Access]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server 2008]]></category>
		<category><![CDATA[@@DBTS]]></category>
		<category><![CDATA[column]]></category>
		<category><![CDATA[database version]]></category>
		<category><![CDATA[insert into a timestamp column]]></category>
		<category><![CDATA[record version]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Timestamp]]></category>
		<category><![CDATA[version]]></category>
		<category><![CDATA[version control]]></category>

		<guid isPermaLink="false">http://www.ilearnttoday.com/?p=543</guid>
		<description><![CDATA[2011-10-07 Timestamp is a value that is incremented by the database whenever an insert or update operation is performed. Even<a href="http://www.ilearnttoday.com/timestamp-columns" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p><span style="color: #c0c0c0;">2011-10-07</span><br />
<script type="text/javascript">// <![CDATA[
      google_ad_client = "ca-pub-5478118713208336"; /* LeadIn */ google_ad_slot = "2638602320"; google_ad_width = 468; google_ad_height = 15;
// ]]&gt;</script><br />
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">// <![CDATA[</p>
<p>// ]]&gt;</script></p>
<p>Timestamp is a value that is incremented by the database whenever an insert or update operation is performed.</p>
<p>Even though the name Timestamp could be a bit misleading, this value has no relevance to a clock related time. This only shows a linear progression of time.</p>
<p>For an example , it is something like your database saying it has been two update or insert commands since your last visit.</p>
<p>You can see this value by referring to <a>@@DBTS</a>  [ select @@DBTS ]</p>
<p><div id="attachment_544" class="wp-caption alignnone" style="width: 212px"><a href="http://www.ilearnttoday.com/wp-content/uploads/2011/10/1.png"><img class="size-full wp-image-544" title="Database Timestamp Value" src="http://www.ilearnttoday.com/wp-content/uploads/2011/10/1.png" alt="Database Timestamp Value" width="202" height="117" /></a><p class="wp-caption-text">Database Timestamp Value</p></div><br />
<br />
How can this be helpful at all?</p>
<p>Well, in simple terms, this helps to keep track of versions of records.</p>
<p>For an example, assume a scenario where you have to fetch a record from a table, manipulate the data and write it back.</p>
<p>What if the record gets changed (from another database call) after you fetched data? You will manipulate the old data and update the record without knowing somebody has updated the record in between your fetching and updating commands.</p>
<p>How can timestamp help?</p>
<p>You can add a column to your table (you can call it &#8220;Version&#8221;) and set its data type to TimeStamp. Then whenever you update or insert a record to this table, this column will record the database timestamp after that transaction.</p>
<p>So before writing your manipulated data, you can check if the timestamp value remains the same as what you read at the beginning of the transaction.</p>
<p>Following example demonstrates how timestamp can be used to monitor versions:</p>
<p>The Person table used for this example has a column called &#8220;Version&#8221; which is of type Timestamp.</p>
<p>First simply query the Version column of the table for the person called &#8220;Robert&#8221;</p>
<p><div id="attachment_546" class="wp-caption alignnone" style="width: 609px"><a href="http://www.ilearnttoday.com/wp-content/uploads/2011/10/person_before1.png"><img class="size-full wp-image-546" title="Timestamp before update" src="http://www.ilearnttoday.com/wp-content/uploads/2011/10/person_before1.png" alt="Timestamp before update" width="599" height="155" /></a><p class="wp-caption-text">Timestamp before update</p></div><br />
<br />
After an update to the same record, we will check the version (timestamp) of the same record:</p>
<p><div id="attachment_548" class="wp-caption alignnone" style="width: 585px"><a href="http://www.ilearnttoday.com/wp-content/uploads/2011/10/person_after.png"><img class="size-full wp-image-548" title="Timestamp after update" src="http://www.ilearnttoday.com/wp-content/uploads/2011/10/person_after.png" alt="Timestamp after update" width="575" height="181" /></a><p class="wp-caption-text">Timestamp after update</p></div><br />
<br />
As you can see, the timestamp value for the record has been automatically updated.</p>
<p>Note: Timestamp columns are automatically updated by the database engine so you do not have to specify value when either inserting or updating a row of a table which has a timestamp (version) column.</p>
<p>So to insert a record to a table with a timestamp column simply omit the timestamp column from your insert statement.</p>
<p>i.e. &#8211; Person table has following columns [Id, Given_Name, Family_Name, Age, Version]</p>
<p>Insert statement would be:</p>
<pre class="brush: sql; title: ; notranslate">
Insert into Person(Id, Given_Name, Family_Name, Age)
Values(001, &quot;Robert&quot;, &quot;Nox&quot;, 78);
</pre>
<p>
The database will take care of the timestamp (version) column.</p>
<p><script type="text/javascript">// <![CDATA[
     google_ad_client = "pub-5478118713208336"; /* BelowPost_BlendIn */ google_ad_slot = "0823141458"; google_ad_width = 468; google_ad_height = 60;
// ]]&gt;</script><br />
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">// <![CDATA[</p>
<p>// ]]&gt;</script></p>
<p style="text-align: justify;"><span style="color: #008000;">Was this post helpful to you? How can I improve? &#8211; </span><span style="color: #008000;">Your comment is highly appreciated!</span></p>
<p style="text-align: justify;"><span style="color: #c0c0c0;">Cassian Menol Razeek</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ilearnttoday.com/timestamp-columns/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to use (escape) single quotation mark in sql statements</title>
		<link>http://www.ilearnttoday.com/how-to-escape-single-quotation-mark-in-sql</link>
		<comments>http://www.ilearnttoday.com/how-to-escape-single-quotation-mark-in-sql#comments</comments>
		<pubDate>Thu, 06 Oct 2011 16:01:47 +0000</pubDate>
		<dc:creator>Menol</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server 2008]]></category>
		<category><![CDATA[apostrophe]]></category>
		<category><![CDATA[escape apostrophe]]></category>
		<category><![CDATA[escape single quotation]]></category>
		<category><![CDATA[exec]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.ilearnttoday.com/?p=523</guid>
		<description><![CDATA[06-10-2011 We all get that day when we get an exception complaining about the single quotation or apostrophe that was<a href="http://www.ilearnttoday.com/how-to-escape-single-quotation-mark-in-sql" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p><span style="color: #c0c0c0;">06-10-2011</span><br />
<script type="text/javascript">// <![CDATA[
   google_ad_client = "ca-pub-5478118713208336"; /* LeadIn */ google_ad_slot = "2638602320"; google_ad_width = 468; google_ad_height = 15;
// ]]&gt;</script><br />
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">// <![CDATA[</p>
<p>// ]]&gt;</script></p>
<p>We all get that day when we get an exception complaining about the single quotation or apostrophe that was in our SQL statement.</p>
<p>The best advisable thing to do is to use stored procedures so that all data are passed as parameters. However there are situations we have to use in-line SQL statements and even there are situations where even SQL parameters cannot manage this issue.</p>
<p>For example, if you use the exec method in you stored procedure body to do some dynamic stuff [read more about using exec to generate dynamic queries in stored procedures <a title="A stored procedure that can auto-genarate SQL queries using exec method" href="http://www.ilearnttoday.com/dynamic-stored-procedure">here</a> ] you will have noticed that even if you pass a string with an apostrophe to an sql parameter it will still throw an exception at you !</p>
<p>So the only way out is to escape this character. Once you instruct the SQL parser to escape the character it will take the apostrophe as part of the string input not part of the command.</p>
<p>How to?</p>
<p>Simply replace your apostrophe / single quotation with two apostrophes / two single quotations .</p>
<p>i.e.<br />
Replace <span style="color: #3366ff;">Bob&#8217;s world</span> With <span style="color: #339966;">Bob&#8217;<span style="color: #ff0000;">&#8216;</span>s world</span>  &lt;- these are two single quotation characters (not one double quotation character)</p>
<p>This can be easily done by using the <span style="color: #008000;">string.replace</span> method.</p>
<p><span style="color: #008000;">Was this post helpful to you? How can I improve? – Your comment is highly appreciated!</span></p>
<p><span style="color: #c0c0c0;">Cassian Menol Razeek</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ilearnttoday.com/how-to-escape-single-quotation-mark-in-sql/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A stored procedure that can auto-genarate SQL queries using exec method</title>
		<link>http://www.ilearnttoday.com/dynamic-stored-procedure</link>
		<comments>http://www.ilearnttoday.com/dynamic-stored-procedure#comments</comments>
		<pubDate>Thu, 06 Oct 2011 13:11:45 +0000</pubDate>
		<dc:creator>Menol</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[Menol]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server 2005]]></category>
		<category><![CDATA[exec]]></category>
		<category><![CDATA[execute]]></category>
		<category><![CDATA[flexible dynamic stored procedure]]></category>
		<category><![CDATA[parameterize]]></category>

		<guid isPermaLink="false">http://www.ilearnttoday.com/?p=513</guid>
		<description><![CDATA[06-10-2011 Have you ever wanted to write a flexible and dynamic stored procedure that would allow you to send the table<a href="http://www.ilearnttoday.com/dynamic-stored-procedure" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p><span style="color: #c0c0c0;">06-10-2011</span><br />
<script type="text/javascript"><!--
google_ad_client = "ca-pub-5478118713208336";
/* LeadIn */
google_ad_slot = "2638602320";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>Have you ever wanted to write a flexible and dynamic stored procedure that would allow you to send the table name as a parameter?</p>
<p>Have you ever wanted to write a flexible and dynamic stored procedure that would allow you to send only the condition but also the column name you want to include in the where clause?</p>
<p>Well I did. I wanted to create a stored procedure that would take Table name, Criteria column name  and the Target criteria value as parameters and create the SQL query dynamically.</p>
<p>Usually, we have to write our SQL code in the stored procedure body where we cannot treat our sql statement as a string.</p>
<p>The way to achieve this, however, is by using the Exec method provided in SQL.</p>
<p>Exec (execute) allows you to execute a command or a character string that contains Transact-SQL command(s).</p>
<p>Without wasting more time, following is the code I used to achieve my goal:</p>
<pre class="brush: sql; title: ; notranslate">
CREATE PROCEDURE GetRowCountByStringColumn

@TableName nvarchar(50),
@CriteriaColumnName nvarchar(50),
@CriteriaValue nvarchar(150)
AS
BEGIN

EXEC('SELECT  Count(*) FROM ' + @TableName
+ ' WHERE ' + @CriteriaColumnName + ' = ''' + @CriteriaValue + '''')

END
GO
</pre>
<p>As you can see the procedure takes three arguments:</p>
<p>TableName<br />
CriteriaColumnName &#8211; the name of the column that should be checked in the where clause<br />
CriteriaValue &#8211; the value the Criteria Column Name should be checked against</p>
<p>The exec command creates the SQL command (at run time) and executes it.</p>
<p>This helped me to create many dynamic stored procedures for my current project and saved me from having to create stored procedures for each table.</p>
<p><span style="color: #008000;">Was this post helpful to you? How can I improve? – Your comment is highly appreciated!</span></p>
<p><span style="color: #c0c0c0;">Cassian Menol Razeek</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ilearnttoday.com/dynamic-stored-procedure/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to auto save the data table in memory into database?</title>
		<link>http://www.ilearnttoday.com/commandbinder</link>
		<comments>http://www.ilearnttoday.com/commandbinder#comments</comments>
		<pubDate>Tue, 04 Oct 2011 13:27:46 +0000</pubDate>
		<dc:creator>Menol</dc:creator>
				<category><![CDATA[C# .Net]]></category>
		<category><![CDATA[C#.NET]]></category>
		<category><![CDATA[Data Access]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[SQL Server 2005]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Auto update]]></category>
		<category><![CDATA[Command Binder]]></category>
		<category><![CDATA[CommandBinder]]></category>
		<category><![CDATA[Data adaptor]]></category>
		<category><![CDATA[data table]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[synchronize]]></category>

		<guid isPermaLink="false">http://www.ilearnttoday.com/?p=479</guid>
		<description><![CDATA[2010-04-01 We frequently get to fetch data from the database, update them and then write them back to the database. Most of<a href="http://www.ilearnttoday.com/commandbinder" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p><span style="color: #c0c0c0;">2010-04-</span><span style="color: #c0c0c0;">01</span></p>
<p><span style="color: #ff0000;"> <script type="text/javascript"><!--
google_ad_client = "ca-pub-5478118713208336";
/* LeadIn */
google_ad_slot = "2638602320";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></span></p>
<p>We frequently get to fetch data from the database, update them and then write them back to the database.</p>
<p>Most of the time we only have to write them back as individual records.</p>
<p>How about updating a whole database table in the memory and having to synchronize all changes to the actual data table?</p>
<p>My initial thought was this would be full of complex coding. However, thanks to Microsoft, there&#8217;s nothing much to be done at all.</p>
<p>So how are we gonna do this is&#8230;</p>
<p>We will use a data adaptor to fill our data table as usual.</p>
<p>The only new thing is the use of a Command Binder.</p>
<p>Command Binder: A command binder is capable to detect changes that have occurred to a table (in the memory) and then automatically generate appropriate SQL statements to save those changes into the actual data table (in the database).</p>
<p>Following is a simple example: Scenario: In my application I had to take a database table name and present data in a data grid and then save all changes made by the user.</p>
<p>What we need: a data table an adaptor a connection a command builder I have defined them at the form level so I can use them across the form from different events.</p>
<pre class="brush: csharp; title: ; notranslate">
private DataTable _tbl;

private SqlDataAdapter _adptr;

private SqlConnection _conn;

private SqlCommandBuilder _cbldr;
</pre>
<p>Step1: Initialize connection and retrieve data from the database</p>
<pre class="brush: csharp; title: ; notranslate">
_tbl = new DataTable();
_conn = FetchData.GetOpenConnection();
_adptr = new SqlDataAdapter(&quot;Select * from &quot; + DatabaseTableName, _conn);
_cbldr = new SqlCommandBuilder(_adptr);
_adptr.Fill(_tbl);
</pre>
<p>Step2: Let the user to change data (in here simply bind the table to a grid)</p>
<pre class="brush: csharp; title: ; notranslate">
dgMainGrid.DataSource = _tbl;
</pre>
<p>Step3: Save (synchronize) changes to the actual database table Even though this is a complex process and undoubtedly would take a lot of effort to do manually, Thanks to .net framework all we need is a line of code.</p>
<pre class="brush: csharp; title: ; notranslate">
_adptr.Update(_tbl);
</pre>
<p>Once you call the adaptor to update the table, it will use the command builder attached to it to generate all necessary SQL command building. The database table is now up-to-date!</p>
<p><span style="color: #008000;">Was this post helpful to you? How can I improve? – Your comment is highly appreciated!</span></p>
<p><span style="color: #c0c0c0;">Cassian Menol Razeek</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ilearnttoday.com/commandbinder/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>D LINQ : How to Map Columns Which Auto Generate Values At the Database</title>
		<link>http://www.ilearnttoday.com/d-linq-how-to-map-columns-which-auto-generate-values-at-the-database</link>
		<comments>http://www.ilearnttoday.com/d-linq-how-to-map-columns-which-auto-generate-values-at-the-database#comments</comments>
		<pubDate>Mon, 11 May 2009 17:37:17 +0000</pubDate>
		<dc:creator>Menol</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[Menol]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[SQL Server 2005]]></category>
		<category><![CDATA[VB.Net]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[.NET exception]]></category>
		<category><![CDATA[annotation]]></category>
		<category><![CDATA[auto-generate]]></category>
		<category><![CDATA[Cannot insert explicit value for identity column in table 'tbl_Process' when IDENTITY_INSERT is set to OFF]]></category>
		<category><![CDATA[DLINQ]]></category>
		<category><![CDATA[IDENTITY_INSERT]]></category>
		<category><![CDATA[IsDbGenerated]]></category>
		<category><![CDATA[IsDbGenerated:=True]]></category>
		<category><![CDATA[LINQ]]></category>
		<category><![CDATA[primary key]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server exception]]></category>
		<category><![CDATA[Windows Application]]></category>

		<guid isPermaLink="false">http://www.ilearnttoday.com/?p=390</guid>
		<description><![CDATA[2009-05-11 I have being working on a software application made on .Net and recently my client asked me to use<a href="http://www.ilearnttoday.com/d-linq-how-to-map-columns-which-auto-generate-values-at-the-database" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;"><!--[endif]--><span style="color: silver;">2009-05-11</span></p>
<p><script type="text/javascript"><!--
google_ad_client = "ca-pub-5478118713208336";
/* LeadIn */
google_ad_slot = "2638602320";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p style="text-align: justify;">I have being working on a software application made on .Net and recently my client asked me to use D LINQ instead of SQL.</p>
<p style="text-align: justify;">D LINQ has great benefits loaded! As I started working with DLINQ I started to know that preventing SQL injection is not a headache anymore and misspelled SQL queries will not trouble agian at run time because DLINQ generates all necessary SQL inside the framework!</p>
<p style="text-align: justify;">I chose to use annotations inside the class instead of using separate xml file. Following is a part of the first class I ported to D LINQ.</p>
<p style="text-align: justify;">
<pre class="brush: vb; title: ; notranslate">&lt;/p&gt;
_
Public Class Process
_
Public ProcessID As Integer
_
Public BusinessProcessID As String
_
Public ProcessText As String
...
...
</pre>
<p style="text-align: justify;">ProcessID column is the primary key of my database table tbl_Process.</p>
<p style="text-align: justify;">Important Point: I use database to auto-generate values for the primary key column (integer value incremented by one).</p>
<p style="text-align: justify;">So when I run the application, It gave me this unexpected error:</p>
<p style="text-align: justify;"><strong><em>Cannot insert explicit value for identity column in table &#8216;tbl_Process&#8217; when IDENTITY_INSERT is set to OFF.</em></strong></p>
<p style="text-align: justify;">Basically, the <strong><em>IDENTITY_INSERT</em></strong> when using the database to auto generate value for a field but when I ran a SQL insert statement at the database end it worked fine!</p>
<p style="text-align: justify;">After some tough time I found out the solution for this problem!</p>
<p style="text-align: justify;">When we use an auto-generate field in a data table we have to specifically mention it in the matching field in the appropriate class.</p>
<p style="text-align: justify;">The code to state this is:</p>
<p style="text-align: justify;"><em>Syntax:</em></p>
<p style="text-align: justify;"><strong><em>IsDbGenerated:=True</em></strong></p>
<p style="text-align: justify;">This has to be added to the annotation added for the specific column like:</p>
<p style="text-align: justify;">
<pre class="brush: vb; title: ; notranslate">&lt;/p&gt;
_
Public ProcessID As Integer
</pre>
<p style="text-align: justify;">Now D LINQ can understand that the field value is auto-generated by the database!</p>
<p style="text-align: justify;"><span style="color: green;">Was this post helpful to you? How can I improve? &#8211; Your comment is highly appreciated!</span></p>
<p style="text-align: justify;"><span style="color: silver;">Cassian Menol Razeek</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ilearnttoday.com/d-linq-how-to-map-columns-which-auto-generate-values-at-the-database/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to (Full and Transaction Log) backup and restore a database in Microsoft SQL Server 2005</title>
		<link>http://www.ilearnttoday.com/backup-a-database-in-sql-server-2005</link>
		<comments>http://www.ilearnttoday.com/backup-a-database-in-sql-server-2005#comments</comments>
		<pubDate>Thu, 04 Dec 2008 05:22:12 +0000</pubDate>
		<dc:creator>Menol</dc:creator>
				<category><![CDATA[Backup]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Full Backup]]></category>
		<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[Menol]]></category>
		<category><![CDATA[Restore]]></category>
		<category><![CDATA[SQL Server 2005]]></category>
		<category><![CDATA[Transaction Log Backup]]></category>
		<category><![CDATA[Complete manual on SQL Server backup and restore]]></category>
		<category><![CDATA[download manual]]></category>
		<category><![CDATA[recover data]]></category>
		<category><![CDATA[recover transactions]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Tail log]]></category>
		<category><![CDATA[Tail log backup]]></category>
		<category><![CDATA[Transaction Log]]></category>

		<guid isPermaLink="false">http://ilearnttoday.wordpress.com/?p=31</guid>
		<description><![CDATA[2008-12-04 In this article I will discus how to backup a database as a FULL backup or with Transaction Log<a href="http://www.ilearnttoday.com/backup-a-database-in-sql-server-2005" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p><span style="color:#c0c0c0;">2</span><span style="color:#c0c0c0;">008-12-04<br />
</span></p>
<p><span style="color:#c0c0c0;"><span style="color:#000000;">In this article I will discus how to backup a database as a FULL backup or with Transaction Log (Tail Log) backup and how to restore the database, how to recover transactions made after you taking the backup, etc.</span></span></p>
<p><span style="color:#c0c0c0;"><span style="color:#000000;">Since it is not easy to use and organize images in the post itself I have uploaded a compiled pdf file of this article.</span></span></p>
<p><span style="color:#c0c0c0;"><span style="color:#000000;">Please download the complete manual from following link:</span></span></p>
<p><span style="color:#c0c0c0;"><span style="color:#000000;"><span style="color:#99cc00;"><a href="http://ilearnttoday.files.wordpress.com/2008/12/how-to-backup-and-restore-a-database-in-microsoft-sql-server-2005.pdf" target="_blank"><span class="wp-caption">How to backup and restore a database in Microsoft SQL Server 2005</span></a></span><br />
</span></span></p>
<p><span style="color:#008000;">Was this post helpful to you? How can I improve? &#8211; <span style="color:#008000;">Your comment is highly appreciated!</span></span></p>
<p><span style="color:#c0c0c0;">Cassian Menol Razeek</span><strong><br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ilearnttoday.com/backup-a-database-in-sql-server-2005/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle Trunc Function</title>
		<link>http://www.ilearnttoday.com/oracle-trunc-function</link>
		<comments>http://www.ilearnttoday.com/oracle-trunc-function#comments</comments>
		<pubDate>Mon, 24 Nov 2008 18:03:11 +0000</pubDate>
		<dc:creator>Menol</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[Menol]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Cassian Menol Razeek]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[date type]]></category>
		<category><![CDATA[Example]]></category>
		<category><![CDATA[numeric value]]></category>
		<category><![CDATA[Oracle Trunc function]]></category>
		<category><![CDATA[parameter]]></category>
		<category><![CDATA[syntax]]></category>
		<category><![CDATA[Trunc]]></category>
		<category><![CDATA[Trunc Example]]></category>
		<category><![CDATA[Trunc function]]></category>
		<category><![CDATA[value]]></category>

		<guid isPermaLink="false">http://ilearnttoday.wordpress.com/?p=24</guid>
		<description><![CDATA[2008-11-24 Among various helpful functions provided by Oracle, Trunc function took my attention today because I had to fix a<a href="http://www.ilearnttoday.com/oracle-trunc-function" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p><span style="color:#c0c0c0;">2008-11-24</span></p>
<p>Among various helpful functions provided by Oracle, Trunc function took my attention today because I had to fix a defect where some one has misunderstood and misused this function.</p>
<p>As the name itself suggests, the trunc function is capable of truncating a value. This function can be used either on a date type value or a numeric value.</p>
<p><strong><span style="text-decoration:underline;">Using trunc for numeric values</span></strong></p>
<p>When it comes to numbers, trunc function can return a number truncated to a certain number of decimal places.</p>
<p><span style="text-decoration:underline;">syntax:</span></p>
<p>trunc( number, [ decimal_places ] )</p>
<p><span style="text-decoration:underline;">Example usage:</span></p>
<table border="0" cellspacing="0" cellpadding="3" width="323">
<tbody>
<tr>
<td class="function_example" width="133">trunc(125.815)</td>
<td class="function_desc">would return 125</td>
</tr>
<tr>
<td class="function_example">trunc(125.815, 0)</td>
<td class="function_desc">would return 125</td>
</tr>
<tr>
<td class="function_example">trunc(125.815, 1)</td>
<td class="function_desc">would return 125.8</td>
</tr>
<tr>
<td class="function_example">trunc(125.815, 2)</td>
<td class="function_desc">would return 125.81</td>
</tr>
<tr>
<td class="function_example">trunc(125.815, 3)</td>
<td class="function_desc">would return 125.815</td>
</tr>
<tr>
<td class="function_example">trunc(-125.815, 2)</td>
<td class="function_desc">would return -125.81</td>
</tr>
<tr>
<td class="function_example">trunc(125.815, -1)</td>
<td class="function_desc">would return 120</td>
</tr>
<tr>
<td class="function_example">trunc(125.815, -2)</td>
<td class="function_desc">would return 100</td>
</tr>
<tr>
<td class="function_example">trunc(125.815, -3)</td>
<td class="function_desc">would return 0</td>
</tr>
</tbody>
</table>
<p><span style="color:#ffffff;">Menol</span></p>
<p>Note: The trunc function does not round the values like in round function. It simply truncates the number as instructed.</p>
<p><strong><span style="text-decoration:underline;">Using trunc for date values</span></strong></p>
<p>The trunc function is capable to truncate a date value to a specific unit of measure.</p>
<p><span style="text-decoration:underline;">Syntax:</span></p>
<p>trunc ( date, [ format ] )</p>
<p><span style="text-decoration:underline;">Possible values for format parameter:</span></p>
<table class="parm_values" border="1" cellspacing="0" cellpadding="3" width="386">
<tbody>
<tr class="th_left_top">
<th width="135">Unit</th>
<th>Valid format parameters</th>
</tr>
<tr>
<td>Year</td>
<td>SYYYY, YYYY, YEAR, SYEAR, YYY, YY, Y</td>
</tr>
<tr>
<td>ISO Year</td>
<td>IYYY, IY, I</td>
</tr>
<tr>
<td>Quarter</td>
<td>Q</td>
</tr>
<tr>
<td>Month</td>
<td>MONTH, MON, MM, RM</td>
</tr>
<tr>
<td>Week</td>
<td>WW</td>
</tr>
<tr>
<td>IW</td>
<td>IW</td>
</tr>
<tr>
<td>W</td>
<td>W</td>
</tr>
<tr>
<td>Day</td>
<td>DDD, DD, J</td>
</tr>
<tr>
<td>Start day of the week</td>
<td>DAY, DY, D</td>
</tr>
<tr>
<td>Hour</td>
<td>HH, HH12, HH24</td>
</tr>
<tr>
<td>Minute</td>
<td>MI</td>
</tr>
</tbody>
</table>
<p><span style="color:#ffffff;">Menol</span></p>
<p><span style="text-decoration:underline;">Example Usage:</span></p>
<table border="0" cellspacing="0" cellpadding="3" width="462">
<tbody>
<tr>
<td class="function_example" width="253">trunc(to_date(&#8217;22-AUG-03&#8242;), &#8216;YEAR&#8217;)</td>
<td class="function_desc">would return &#8217;01-JAN-03&#8242;</td>
</tr>
<tr>
<td class="function_example">trunc(to_date(&#8217;22-AUG-03&#8242;), &#8216;Q&#8217;)</td>
<td class="function_desc">would return &#8217;01-JUL-03&#8242;</td>
</tr>
<tr>
<td class="function_example">trunc(to_date(&#8217;22-AUG-03&#8242;), &#8216;MONTH&#8217;)</td>
<td class="function_desc">would return &#8217;01-AUG-03&#8242;</td>
</tr>
<tr>
<td class="function_example">trunc(to_date(&#8217;22-AUG-03&#8242;), &#8216;DDD&#8217;)</td>
<td class="function_desc">would return &#8217;22-AUG-03&#8242;</td>
</tr>
<tr>
<td class="function_example">trunc(to_date(&#8217;22-AUG-03&#8242;), &#8216;DAY&#8217;)</td>
<td class="function_desc">would return &#8217;17-AUG-03&#8242;</td>
</tr>
</tbody>
</table>
<p><span style="color:#ffffff;">Menol</span></p>
<p><span style="color:#008000;">Was this post helpful to you? How can I improve? &#8211; <span style="color:#008000;">Your comment is highly appreciated!</span></span></p>
<p><span style="color:#c0c0c0;">Cassian Menol Razeek</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ilearnttoday.com/oracle-trunc-function/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

