<?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>Data Analysts, Crystal Reports and Sql Reporting Services Consultants &#187; SQL Server 2000</title>
	<atom:link href="http://datamart.org/category/sql-server-2000/feed/" rel="self" type="application/rss+xml" />
	<link>http://datamart.org</link>
	<description>Feel free to ask tough questions relating to Crystal Reports / SQL Reporting Services / SQL  and get answers from Collective intelligence</description>
	<lastBuildDate>Wed, 08 Feb 2012 09:01:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Examples Use string concatenation</title>
		<link>http://datamart.org/2010/09/18/examples-use-string-concatenation/</link>
		<comments>http://datamart.org/2010/09/18/examples-use-string-concatenation/#comments</comments>
		<pubDate>Sun, 19 Sep 2010 00:14:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[SQL Server 2000]]></category>
		<category><![CDATA[Sql Server 2005]]></category>
		<category><![CDATA[Sql Server 2008]]></category>

		<guid isPermaLink="false">http://datamart.org/?p=1337</guid>
		<description><![CDATA[Recently I was trying to import datafeeds into the wordpress blog. images on the post and links needs some html tags. I used SQL language string concatenation operator to fill up the missing tags as follows; select  [name], &#8216;&#60;img src=&#8221;&#8216; + &#8221; +IMAGEURL + &#8216;&#8221;&#8216; + &#8216; Detail: &#8216; + [description]+ &#8216;, &#8216;+ &#8216;Price in [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://datamart.org/wp-content/uploads/2010/09/query.SQL_view.jpg"><img class="alignnone size-medium wp-image-1338" title="query.SQL_view" src="http://datamart.org/wp-content/uploads/2010/09/query.SQL_view-300x143.jpg" alt="" width="300" height="143" /></a>Recently I was trying to import datafeeds into the wordpress blog. images on the post and links needs some html tags. I used SQL language string concatenation operator to fill up the missing tags as follows;</p>
<p>select  [name], &#8216;&lt;img src=&#8221;&#8216; + &#8221; +IMAGEURL + &#8216;&#8221;&#8216; + &#8216; Detail: &#8216; + [description]+ &#8216;, &#8216;+ &#8216;Price in USD:&#8217;+ &#8216;, &#8216;+ cast(PRICE as CHAR)+ &#8216;, &#8216;+ &#8216;&lt;a href=&#8221;&#8216; + &#8221; +BUYURL +  &#8216;&#8221;&gt;[Read More and Booking information] &lt;/a&gt;&#8217;</p>
<p>,  KEYWORDS from</p>
<p> dbo.['Hotels_com-International_Hotels$']</p>
<p> where KEYWORDS like &#8216;%doha%&#8217; or</p>
<p> KEYWORDS like &#8216;%Manama%&#8217; or</p>
<p> KEYWORDS like &#8216;%Mumbai%&#8217; or</p>
<p> KEYWORDS like &#8216;%Tokyo%&#8217; or</p>
<p> KEYWORDS like &#8216;%Dubai%&#8217; or</p>
<p> KEYWORDS like &#8216;%Dallas%&#8217; or</p>
<p> KEYWORDS like &#8216;%Houston%&#8217; or</p>
<p> KEYWORDS like &#8216;%Chicago%&#8217; or</p>
<p> KEYWORDS like &#8216;%NYC%&#8217;  or</p>
<p> KEYWORDS like &#8216;%toronto%&#8217;</p>
]]></content:encoded>
			<wfw:commentRss>http://datamart.org/2010/09/18/examples-use-string-concatenation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Example &#8211; Buliding a sample data warehouse using SQL Server</title>
		<link>http://datamart.org/2010/05/21/example-buliding-a-sample-data-warehouse-using-sql-server/</link>
		<comments>http://datamart.org/2010/05/21/example-buliding-a-sample-data-warehouse-using-sql-server/#comments</comments>
		<pubDate>Sat, 22 May 2010 05:40:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Data Mart Examples]]></category>
		<category><![CDATA[SQL Server 2000]]></category>
		<category><![CDATA[SQL, BI, IT news]]></category>

		<guid isPermaLink="false">http://datamart.org/?p=1093</guid>
		<description><![CDATA[This post is about an example of populating fact tables in Funds data warehouse. All the data from dbo.tranhistory was extracted along with the foreign keys for four dimensions Managers, Offices, Funds, and Accounts. In writing this post we followed the Funds Database example in SQL Server OLAP Developer’s Guide by William C Amo published [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://datamart.org/wp-content/uploads/2010/05/funds_star.jpg"><img src="http://datamart.org/wp-content/uploads/2010/05/funds_star-300x181.jpg" alt="" title="funds_star" width="300" height="181" class="alignnone size-medium wp-image-1095" /></a><a href="http://datamart.org/wp-content/uploads/2010/05/fundaccnt.jpg"><img src="http://datamart.org/wp-content/uploads/2010/05/fundaccnt-300x227.jpg" alt="" title="fundaccnt" width="300" height="227" class="alignnone size-medium wp-image-1094" /></a>This post is about an example of populating fact tables in Funds data warehouse. All the data from dbo.tranhistory  was extracted along with the foreign keys for four dimensions Managers, Offices, Funds, and Accounts.  </p>
<p>In writing this post we followed the Funds Database example in SQL Server OLAP Developer’s Guide by William C Amo published year 2000, check with Amazon if this is available. We like this  example because it elaborated the process of populating the fact table very well.</p>
<p>The sql statement was executed to populate fact 2 fact tables (Please see funds Star Schema picture)<br />
as follows;<br />
1-	Investments<br />
2-	Dividends </p>
<p>Sql statement for populating fact table Investments<br />
select a.manager_num, M.office_num, f.fund_cd,f.fundacctno,t.trandate,<br />
t.amount from accounts a INNER join managers m on a.manager_num=m.manager_num<br />
inner join fundaccounts f on a.acct_no = f.ACCT_NO<br />
INNER JOIN TRANHISTORY T ON (F.FUND_CD = T.fUND_CD) And f.fundacctno = t.fundacctno<br />
Where t.trantype = ‘invest’<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Sql statement for populating fact table Dividends<br />
select a.manager_num, M.office_num, f.fund_cd,f.fundacctno,t.trandate,<br />
t.amount from accounts a INNER join managers m on a.manager_num=m.manager_num<br />
inner join fundaccounts f on a.acct_no = f.ACCT_NO<br />
INNER JOIN TRANHISTORY T ON (F.FUND_CD = T.fUND_CD) And f.fundacctno = t.fundacctno<br />
Where t.trantype <> ‘invest’</p>
<p>Creating four dimensions &#8211;  Managers, Offices, Funds, and Accounts sions should be simple (Please see Funds OLTP Picture and Funds Star Schema), we will write more in our next post please feel free to add more o this topic.</p>
<p><a href="http://datamart.org/2010/04/27/star-schema-%e2%80%93-fact-table-a-closer-look/">Read similar topic</a></p>
]]></content:encoded>
			<wfw:commentRss>http://datamart.org/2010/05/21/example-buliding-a-sample-data-warehouse-using-sql-server/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Data integrity example</title>
		<link>http://datamart.org/2010/03/18/data-integrity-example/</link>
		<comments>http://datamart.org/2010/03/18/data-integrity-example/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 20:40:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[SQL Server 2000]]></category>
		<category><![CDATA[Sql Server 2005]]></category>
		<category><![CDATA[Sql Server 2008]]></category>
		<category><![CDATA[SQL, BI, IT news]]></category>

		<guid isPermaLink="false">http://datamart.org/?p=759</guid>
		<description><![CDATA[An example of a data integrity mechanism is the parent and child relationship of related records. If a parent record owns one or more related child records all of the referential integrity processes are handled by the database itself, which automatically insures the accuracy and integrity of the data so that no child record can [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://datamart.org/wp-content/uploads/2010/03/integrity-triangle-1.jpg"><img src="http://datamart.org/wp-content/uploads/2010/03/integrity-triangle-1.jpg" alt="" title="integrity-triangle-1" width="269" height="243" class="alignnone size-full wp-image-760" /></a></p>
<p>An example of a data integrity mechanism is the parent and child relationship of related records. If a parent record owns one or more related child records all of the referential integrity processes are handled by the database itself, which automatically insures the accuracy and integrity of the data so that no child record can exist without a parent (also called being orphaned) and that no parent loses their child records. It also insures that no parent record can be deleted while the parent record owns any child records. All of this is handled at the database level and does not require coding integrity checks into each application.</p>
<p>source: Wikipedia.org</p>
]]></content:encoded>
			<wfw:commentRss>http://datamart.org/2010/03/18/data-integrity-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>System Databases and Data in SQL Server</title>
		<link>http://datamart.org/2010/03/10/system-databases-and-data-in-sql-server/</link>
		<comments>http://datamart.org/2010/03/10/system-databases-and-data-in-sql-server/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 21:48:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[SQL Server 2000]]></category>

		<guid isPermaLink="false">http://datamart.org/?p=658</guid>
		<description><![CDATA[The purpose of this post is clarify the Master, Model, Temp db and MSDB differences. Many people who are experts in SqL Server sometimes overlook this information which is frequently asked in interviews. Microsoft® SQL Server™ 2000 systems have four system databases: master The master database records all of the system level information for a [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://datamart.org/wp-content/uploads/2010/03/dbms_sql_server.gif"><img src="http://datamart.org/wp-content/uploads/2010/03/dbms_sql_server-300x260.gif" alt="" title="dbms_sql_server" width="300" height="260" class="alignnone size-medium wp-image-659" /></a>The purpose of this post is clarify the Master, Model, Temp db and MSDB differences. Many people who are experts in SqL Server sometimes overlook this information which is frequently asked in interviews.</p>
<p>Microsoft® SQL Server™ 2000 systems have four system databases: </p>
<p><strong>master </strong><br />
The master database records all of the system level information for a SQL Server system. It records all login accounts and all system configuration settings. master is the database that records the existence of all other databases, including the location of the database files. master records the initialization information for SQL Server; always have a recent backup of master available.<br />
<strong><br />
tempdb </strong><br />
tempdb holds all temporary tables and temporary stored procedures. It also fills any other temporary storage needs such as work tables generated by SQL Server. tempdb is a global resource; the temporary tables and stored procedures for all users connected to the system are stored there. tempdb is re-created every time SQL Server is started so the system starts with a clean copy of the database. Because temporary tables and stored procedures are dropped automatically on disconnect, and no connections are active when the system is shut down, there is never anything in tempdb to be saved from one session of SQL Server to another.</p>
<p>By default, tempdb autogrows as needed while SQL Server is running. Unlike other databases, however, it is reset to its initial size each time the database engine is started. If the size defined for tempdb is small, part of your system processing load may be taken up with autogrowing tempdb to the size needed to support your workload each time to restart SQL Server. You can avoid this overhead by using ALTER DATABASE to increase the size of tempdb.</p>
<p><strong>model </strong><br />
The model database is used as the template for all databases created on a system. When a CREATE DATABASE statement is issued, the first part of the database is created by copying in the contents of the model database, then the remainder of the new database is filled with empty pages. Because tempdb is created every time SQL Server is started, the model database must always exist on a SQL Server system.</p>
<p><strong>msdb </strong><br />
The msdb database is used by SQL Server Agent for scheduling alerts and jobs, and recording operators.</p>
]]></content:encoded>
			<wfw:commentRss>http://datamart.org/2010/03/10/system-databases-and-data-in-sql-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rules and Check constraint</title>
		<link>http://datamart.org/2010/03/07/rules-and-check-constraint/</link>
		<comments>http://datamart.org/2010/03/07/rules-and-check-constraint/#comments</comments>
		<pubDate>Sun, 07 Mar 2010 20:45:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[data analyses]]></category>
		<category><![CDATA[Data Model]]></category>
		<category><![CDATA[SQL Server 2000]]></category>
		<category><![CDATA[Sql Server 2005]]></category>
		<category><![CDATA[Sql Server 2008]]></category>
		<category><![CDATA[SQL, BI, IT news]]></category>

		<guid isPermaLink="false">http://datamart.org/?p=624</guid>
		<description><![CDATA[Rules are a backward-compatibility feature that perform some of the same functions as CHECK constraints. CHECK constraints are the preferred, standard way to restrict the values in a column. CHECK constraints are also more concise than rules; there can only be one rule applied to a column, but multiple CHECK constraints can be applied. CHECK [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://datamart.org/wp-content/uploads/2010/03/check_cnstrnt.gif"><img src="http://datamart.org/wp-content/uploads/2010/03/check_cnstrnt-240x300.gif" alt="" title="check_cnstrnt" width="240" height="300" class="alignnone size-medium wp-image-640" /></a>Rules are a backward-compatibility feature that perform some of the same functions as CHECK constraints. CHECK constraints are the preferred, standard way to restrict the values in a column. CHECK constraints are also more concise than rules; there can only be one rule applied to a column, but multiple CHECK constraints can be applied. CHECK constraints are specified as part of the CREATE TABLE statement, while rules are created as separate objects and then bound to the column.</p>
<p>This example creates a rule that performs the same function as the CHECK constraint example in the preceding topic. The CHECK constraint is the preferred method to use in Microsoft® SQL Server™ 2000.</p>
<p>CREATE RULE id_chk AS @id BETWEEN 0 and 10000<br />
GO<br />
CREATE TABLE cust_sample<br />
   (<br />
   cust_id            int<br />
   PRIMARY KEY,<br />
   cust_name         char(50),<br />
   cust_address         char(50),<br />
   cust_credit_limit   money,<br />
   )<br />
GO<br />
sp_bindrule id_chk, &#8216;cust_sample.cust_id&#8217;<br />
GO</p>
<p>Sourec: Sql Server 2000 books online</p>
]]></content:encoded>
			<wfw:commentRss>http://datamart.org/2010/03/07/rules-and-check-constraint/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Difference between Index and Primary Key</title>
		<link>http://datamart.org/2010/03/07/difference-between-index-and-primary-key/</link>
		<comments>http://datamart.org/2010/03/07/difference-between-index-and-primary-key/#comments</comments>
		<pubDate>Sun, 07 Mar 2010 20:21:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[data analyses]]></category>
		<category><![CDATA[SQL Server 2000]]></category>
		<category><![CDATA[SQL, BI, IT news]]></category>

		<guid isPermaLink="false">http://datamart.org/?p=622</guid>
		<description><![CDATA[This post is on very important topic &#8211; &#8220;Difference between Index and Key&#8221; and is explained in very clear and easy terms by Michael J. Hernandez in his book Database Design for Mer Mortals on page 61. We are emphasizing in this post that most of the IT books lacks clarity or makes concepts more [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://datamart.org/wp-content/uploads/2010/03/primary_key1.gif"><img src="http://datamart.org/wp-content/uploads/2010/03/primary_key1-300x222.gif" alt="" title="_primary_key" width="300" height="222" class="alignnone size-medium wp-image-653" /></a>This post is on very important topic &#8211; &#8220;Difference between Index and Key&#8221; and is explained in very clear and easy terms by Michael J. Hernandez in his book Database Design for Mer Mortals on page 61. We are emphasizing in this post that most of the IT books lacks clarity or makes concepts more complicated resultantly negative impact on the productivity and probably should look at the above book how it explains an important topic.</p>
<p>An index is a structure RDBMS provides to improves the data processing. Your particular RDBMS program will determine how the index works and how you use it. How index has absolutely nothing to do with logical data structure and people often confuse it with term key.</p>
<p>Index and key are just two more terms that are widely and frequently misused throughout the database industry and in numerous database related publications – you’ll always know the difference between the two if you remember that keys are logical structures you use to identify records within a table and indexes are physical structures you use to optimize data processing. </p>
]]></content:encoded>
			<wfw:commentRss>http://datamart.org/2010/03/07/difference-between-index-and-primary-key/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Temp table a useful tool in many reports</title>
		<link>http://datamart.org/2009/12/28/temp-table-a-useful-tool-in-many-reports/</link>
		<comments>http://datamart.org/2009/12/28/temp-table-a-useful-tool-in-many-reports/#comments</comments>
		<pubDate>Mon, 28 Dec 2009 15:56:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Sql Reporting Services]]></category>
		<category><![CDATA[SQL Server 2000]]></category>
		<category><![CDATA[Sql Server 2005]]></category>
		<category><![CDATA[Sql Server 2008]]></category>
		<category><![CDATA[Sql Server 2008 Express]]></category>
		<category><![CDATA[Transact-SQL]]></category>

		<guid isPermaLink="false">http://datamart.org/?p=580</guid>
		<description><![CDATA[Reporting the payments received against shipment’s C&#38;F value. In this example our client was facing an  issue where shipments are made  and C&#38;F value amount is taken as Accounts Receivable, payments are received in 2 to 3  installments.  Management wants to know how much is outstanding against each shipment C&#38;F Invoice. In database invoice is [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://datamart.org/wp-content/uploads/2009/12/TmpTable1.jpg"><img src="http://datamart.org/wp-content/uploads/2009/12/TmpTable1-300x136.jpg" alt="" title="TmpTable" width="300" height="136" class="alignnone size-medium wp-image-656" /></a>Reporting the payments received against shipment’s C&amp;F value.</p>
<p>In this example our client was facing an  issue where shipments are made  and C&amp;F value amount is taken as Accounts Receivable, payments are received in 2 to 3  installments.  Management wants to know how much is outstanding against each shipment C&amp;F Invoice.</p>
<p>In database invoice is generated on C&amp;F basis where comprehensive information is recorded like invoice no,  Bill of Lading No, C&amp;F Amount, Shipment NO and so on.</p>
<p>When Payments are received it is recorded exportpayments table along with shipment NO.</p>
<p>In order to create a report to what is outstanding against respective invoice we created a SQL Query  using select into Transact-SQL  as follows;</p>
<p>select sn1, sum(amt) as cfvl</p>
<p> into #sd4</p>
<p>from dbo.exportpayments</p>
<p>group by sn1</p>
<p>Select Sn, CFvlu,sn1, cfvl, Cfvlu-cfvl as balance from</p>
<p> dbo.invocesexpressions inner join #sd4 on</p>
<p>dbo.invocesexpressions.sn = #sd4.sn1</p>
<p>drop table #sd4</p>
<p>In the above example we selected Shipment NO SN1 and sum amount Sum(amt) as cfvlu</p>
<p>Into temp table SD4 and then we selected Shipment no SN, CFVLU from invoices table and CFVL from Temp table #SD4 and join Invoices table and #sd4 based on Shipment NO</p>
<p>At the end we dropped thetemp table  #SD4.</p>
<p>This example utilized the temp table for generating outstanding payments report.</p>
<p>Shipmnt              CFVLU          Shpmnt  Amnt RCD       Blnc</p>
<table border="0" cellspacing="0" cellpadding="0" width="326" align="left">
<tbody>
<tr>
<td width="64" valign="bottom">
<p align="right">311</p>
</td>
<td width="70" valign="bottom">
<p align="right">672000</p>
</td>
<td width="64" valign="bottom">
<p align="right">311</p>
</td>
<td width="64" valign="bottom">
<p align="right">672000</p>
</td>
<td width="64" valign="bottom">
<p align="right">0</p>
</td>
</tr>
<tr>
<td width="64" valign="bottom">
<p align="right">315</p>
</td>
<td width="70" valign="bottom">
<p align="right">48950</p>
</td>
<td width="64" valign="bottom">
<p align="right">315</p>
</td>
<td width="64" valign="bottom">
<p align="right">48950</p>
</td>
<td width="64" valign="bottom">
<p align="right">0</p>
</td>
</tr>
<tr>
<td width="64" valign="bottom">
<p align="right">316</p>
</td>
<td width="70" valign="bottom">
<p align="right">62968.75</p>
</td>
<td width="64" valign="bottom">
<p align="right">316</p>
</td>
<td width="64" valign="bottom">
<p align="right">62969</p>
</td>
<td width="64" valign="bottom">
<p align="right">-0.25</p>
</td>
</tr>
<tr>
<td width="64" valign="bottom">
<p align="right">317</p>
</td>
<td width="70" valign="bottom">
<p align="right">43775</p>
</td>
<td width="64" valign="bottom">
<p align="right">317</p>
</td>
<td width="64" valign="bottom">
<p align="right">42819</p>
</td>
<td width="64" valign="bottom">
<p align="right">956</p>
</td>
</tr>
<tr>
<td width="64" valign="bottom">
<p align="right">318</p>
</td>
<td width="70" valign="bottom">
<p align="right">43775</p>
</td>
<td width="64" valign="bottom">
<p align="right">318</p>
</td>
<td width="64" valign="bottom">
<p align="right">43776</p>
</td>
<td width="64" valign="bottom">
<p align="right">-1</p>
</td>
</tr>
<tr>
<td width="64" valign="bottom">
<p align="right">325</p>
</td>
<td width="70" valign="bottom">
<p align="right">48950</p>
</td>
<td width="64" valign="bottom">
<p align="right">325</p>
</td>
<td width="64" valign="bottom">
<p align="right">48950</p>
</td>
<td width="64" valign="bottom">
<p align="right">0</p>
</td>
</tr>
<tr>
<td width="64" valign="bottom">
<p align="right">326</p>
</td>
<td width="70" valign="bottom">
<p align="right">48950</p>
</td>
<td width="64" valign="bottom">
<p align="right">326</p>
</td>
<td width="64" valign="bottom">
<p align="right">48950</p>
</td>
<td width="64" valign="bottom">
<p align="right">0</p>
</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://datamart.org/2009/12/28/temp-table-a-useful-tool-in-many-reports/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Real world example of usage of Case statement in SQL Server Stored Procedure</title>
		<link>http://datamart.org/2009/10/26/real-world-example-of-usage-of-case-statement-in-sql-server-stored-procedure/</link>
		<comments>http://datamart.org/2009/10/26/real-world-example-of-usage-of-case-statement-in-sql-server-stored-procedure/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 14:43:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Sql Reporting Services]]></category>
		<category><![CDATA[SQL Server 2000]]></category>
		<category><![CDATA[SQL, BI, IT news]]></category>
		<category><![CDATA[Transact-SQL]]></category>

		<guid isPermaLink="false">http://datamart.org/?p=578</guid>
		<description><![CDATA[This post is our practical experience of using Case statement in Calculating monthly overtime amount. Issue was actually usage of different no hours for Overtime worked for different departments. In this case Security departments overtime was calculated based on 12 hours and in all other departments base was 8 hours. Salary was categorize by monthly [...]]]></description>
			<content:encoded><![CDATA[<p>This post is our practical experience of using Case statement in Calculating monthly overtime amount. Issue was actually usage of different no hours for Overtime worked for different departments. </p>
<p>In this case Security departments overtime was calculated based on 12 hours and in all other departments base was 8 hours.</p>
<p>Salary was categorize by monthly type as [monthlytype]  SG for Security Guard where ovetime was calculated based on 12 hours.</p>
<p>code is given below and was in included in select statement;</p>
<p>CASE monthlytype WHEN &#8216;sg&#8217; THEN dbo.wrkshopattndnc.TOTAL_OVERTIME * dbo.[wrkshop employees].Salary / DAY(dbo.wrkshopattndnc.month)/12</p>
<p>ELSE dbo.wrkshopattndnc.TOTAL_OVERTIME * dbo.[wrkshop employees].Salary / DAY(dbo.wrkshopattndnc.month) / 8 </p>
<p>END AS ovtamnt</p>
]]></content:encoded>
			<wfw:commentRss>http://datamart.org/2009/10/26/real-world-example-of-usage-of-case-statement-in-sql-server-stored-procedure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Practicality of  Floor function in SQL Server</title>
		<link>http://datamart.org/2009/10/03/practicality-of-floor-function-in-sql-server/</link>
		<comments>http://datamart.org/2009/10/03/practicality-of-floor-function-in-sql-server/#comments</comments>
		<pubDate>Sun, 04 Oct 2009 05:49:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Business Intelligence]]></category>
		<category><![CDATA[SQL Server 2000]]></category>
		<category><![CDATA[Sql Server 2005]]></category>
		<category><![CDATA[Sql Server 2008]]></category>
		<category><![CDATA[Transact-SQL]]></category>

		<guid isPermaLink="false">http://datamart.org/?p=573</guid>
		<description><![CDATA[We are writing this post to share our experience of usefulness of Floor function. We use the floor function in calculating product manufactured and raw material wastage in the process. The problem was to calculate how many units of a product can be manufactured from certain weight of a raw material. We were getting answer [...]]]></description>
			<content:encoded><![CDATA[<p>We are writing this post to share our experience of usefulness of Floor function. We use the floor function in calculating product manufactured and raw material wastage in the process. The problem was to calculate how many units of a product can be manufactured from certain weight of a raw material. </p>
<p>We were getting answer like 8.67 products manufactured from 50 kgs of raw material. We talked to the manufacturing department they confirmed that 8 no of products are manufactured and 0.67 is the wastage. We calculated the weight of each product and then multiply by 8   which gave us the weight in kgs of 8 no of products.<br />
After that weight of 1 product was multiplied with .67 of product and got the weight of wastage in  kgs.<br />
In the above scenario we needed the decimal value of .67 separated from 8.67 in separate column to show wastage. Our data was in SQL Server, we utilized the floor function to make 8.67 into 8 and then subtracted the 8 from 8.67. The issue was resolved by using floor function.</p>
<p>Below is the related information about Floor function as obtained from SQL Server books Online.</p>
<p>CEILING and FLOOR</p>
<p>The CEILING function returns the smallest integer greater than or equal to the given numeric expression. The FLOOR function returns the largest integer less than or equal to the given numeric expression. For example, given a numeric expression of 12.9273, CEILING returns 13, and FLOOR returns 12. The return value of both FLOOR and CEILING has the same data type as the input numeric expression.</p>
]]></content:encoded>
			<wfw:commentRss>http://datamart.org/2009/10/03/practicality-of-floor-function-in-sql-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Precision and Scale in Sql Server</title>
		<link>http://datamart.org/2009/10/02/precision-and-scale-in-sql-server/</link>
		<comments>http://datamart.org/2009/10/02/precision-and-scale-in-sql-server/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 06:22:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MS Access 2007]]></category>
		<category><![CDATA[Slowly Changing Dimension]]></category>
		<category><![CDATA[SQL Server 2000]]></category>

		<guid isPermaLink="false">http://datamart.org/?p=571</guid>
		<description><![CDATA[We are writing this post because recently we received a query regarding automatic rounding in quantity column. The user was previously using MS Access and they upgraded to SQL Server database. Although solution is simple but sometimes it becomes difficult to resolve when confronting the problem. SQL Server Books online very well addressed the concern [...]]]></description>
			<content:encoded><![CDATA[<p>We are writing this post because recently we received a query regarding automatic rounding in quantity column. The user was previously using MS Access and they upgraded to SQL Server database. Although solution is simple but sometimes it becomes difficult to resolve when confronting the problem.<br />
SQL Server Books online very well addressed the concern and is reproduced below;</p>
<p>Precision is the number of digits in a number. Scale is the number of digits to the right of the decimal point in a number. For example, the number 123.45 has a precision of 5 and a scale of 2.</p>
]]></content:encoded>
			<wfw:commentRss>http://datamart.org/2009/10/02/precision-and-scale-in-sql-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

