<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Web Funda, webSite Optimization, SEO,SEM,.NET,PHP,LAMP,Sql</title>
	<atom:link href="http://webfunda.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://webfunda.wordpress.com</link>
	<description>Web Funda, webSite Optimization, SEO,SEM,.NET,PHP,LAMP,Sql</description>
	<lastBuildDate>Thu, 24 Dec 2009 06:14:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='webfunda.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Web Funda, webSite Optimization, SEO,SEM,.NET,PHP,LAMP,Sql</title>
		<link>http://webfunda.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://webfunda.wordpress.com/osd.xml" title="Web Funda, webSite Optimization, SEO,SEM,.NET,PHP,LAMP,Sql" />
	<atom:link rel='hub' href='http://webfunda.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Sorting in Collection in C#.net</title>
		<link>http://webfunda.wordpress.com/2009/12/24/sorting-in-collection-in-c-net/</link>
		<comments>http://webfunda.wordpress.com/2009/12/24/sorting-in-collection-in-c-net/#comments</comments>
		<pubDate>Thu, 24 Dec 2009 06:14:35 +0000</pubDate>
		<dc:creator>Praveen Srivastava</dc:creator>
				<category><![CDATA[.net 2005]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[Asp.net]]></category>
		<category><![CDATA[C#.net]]></category>
		<category><![CDATA[collection]]></category>
		<category><![CDATA[generic]]></category>
		<category><![CDATA[IComparer]]></category>
		<category><![CDATA[sorting in collection]]></category>

		<guid isPermaLink="false">http://webfunda.wordpress.com/?p=28</guid>
		<description><![CDATA[ComparerCollection.cs using System; using System.Collections.Generic; using System.Text; using System.Collections; namespace Data1.Entity { public class CompareCollection : IComparer { public CompareCollection() { } private string sortField; private string filterField; private string sortOrder; public string SortField { get { return sortField; } set { sortField = value; } } public string FilterField { get { return filterField; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webfunda.wordpress.com&amp;blog=11063229&amp;post=28&amp;subd=webfunda&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>ComparerCollection.cs</p>
<p>using System;<br />
using System.Collections.Generic;<br />
using System.Text;<br />
using System.Collections;<br />
namespace Data1.Entity<br />
{</p>
<p>public class CompareCollection : IComparer<br />
{<br />
public CompareCollection() { }</p>
<p>private string sortField;<br />
private string filterField;<br />
private string sortOrder;</p>
<p>public string SortField<br />
{<br />
get<br />
{<br />
return sortField;<br />
}<br />
set<br />
{<br />
sortField = value;<br />
}<br />
}<br />
public string FilterField<br />
{<br />
get<br />
{<br />
return filterField;<br />
}<br />
set<br />
{<br />
filterField = value;<br />
}<br />
}<br />
// ASC or DESC ways to order collection</p>
<p>public string SortOrder<br />
{<br />
get<br />
{<br />
return sortOrder;<br />
}<br />
set<br />
{<br />
sortOrder = value;<br />
}<br />
}</p>
<p>public int Compare(object x, object y)<br />
{<br />
Cumulative xCumulative = (Cumulative)x;<br />
Cumulative yCumulative = (Cumulative)y;</p>
<p>switch (SortField)<br />
{<br />
// compare CumulativeDesc column</p>
<p>case (&#8220;RawData&#8221;):<br />
if (xCumulative.RawData.CompareTo(yCumulative.RawData) == -1)<br />
return (SortOrder == &#8220;ASC&#8221;) ? -1 : 1;<br />
else if (xCumulative.RawData.CompareTo(yCumulative.RawData) == 1)<br />
return (SortOrder == &#8220;ASC&#8221;) ? 1 : -1;<br />
else<br />
return 0;</p>
<p>// compare MinLvl column</p>
<p>case (&#8220;ActiveData&#8221;):<br />
if (xCumulative.ActiveData &lt; yCumulative.ActiveData)<br />
return (SortOrder == &#8220;ASC&#8221;) ? -1 : 1;<br />
else if (xCumulative.ActiveData &gt; yCumulative.ActiveData)<br />
return (SortOrder == &#8220;ASC&#8221;) ? 1 : -1;<br />
else<br />
return 0;</p>
<p>// compare MaxLvl column</p>
<p>case (&#8220;PassiveData&#8221;):<br />
if (xCumulative.PassiveData &lt; yCumulative.PassiveData)<br />
return (SortOrder == &#8220;ASC&#8221;) ? -1 : 1;<br />
else if (xCumulative.PassiveData &gt; yCumulative.PassiveData)<br />
return (SortOrder == &#8220;ASC&#8221;) ? 1 : -1;<br />
else<br />
return 0;</p>
<p>// compare CumulativeId column by default</p>
<p>default:<br />
if (xCumulative.DeadData &lt; yCumulative.DeadData)<br />
return (SortOrder == &#8220;ASC&#8221;) ? -1 : 1;<br />
else if (xCumulative.DeadData &gt; yCumulative.DeadData)<br />
return (SortOrder == &#8220;ASC&#8221;) ? 1 : -1;<br />
else<br />
return 0;<br />
}<br />
}</p>
<p>public int Filter(object x)<br />
{<br />
Cumulative xCumulative = (Cumulative)x;<br />
//    Cumulative yCumulative = (Cumulative)y;</p>
<p>switch (FilterField)<br />
{<br />
// compare CumulativeDesc column</p>
<p>case (&#8220;RawData&#8221;):<br />
if (xCumulative.RawData.CompareTo(yCumulative.RawData) == -1)<br />
return (SortOrder == &#8220;ASC&#8221;) ? -1 : 1;<br />
else if (xCumulative.RawData.CompareTo(yCumulative.RawData) == 1)<br />
return (SortOrder == &#8220;ASC&#8221;) ? 1 : -1;<br />
else<br />
return 0;</p>
<p>// compare MinLvl column</p>
<p>case (&#8220;ActiveData&#8221;):<br />
if (xCumulative.ActiveData &lt; yCumulative.ActiveData)<br />
return (SortOrder == &#8220;ASC&#8221;) ? -1 : 1;<br />
else if (xCumulative.ActiveData &gt; yCumulative.ActiveData)<br />
return (SortOrder == &#8220;ASC&#8221;) ? 1 : -1;<br />
else<br />
return 0;</p>
<p>// compare MaxLvl column</p>
<p>case (&#8220;PassiveData&#8221;):<br />
if (xCumulative.PassiveData &lt; yCumulative.PassiveData)<br />
return (SortOrder == &#8220;ASC&#8221;) ? -1 : 1;<br />
else if (xCumulative.PassiveData &gt; yCumulative.PassiveData)<br />
return (SortOrder == &#8220;ASC&#8221;) ? 1 : -1;<br />
else<br />
return 0;</p>
<p>// compare CumulativeId column by default</p>
<p>default:<br />
if (xCumulative.DeadData &lt; yCumulative.DeadData)<br />
return (SortOrder == &#8220;ASC&#8221;) ? -1 : 1;<br />
else if (xCumulative.DeadData &gt; yCumulative.DeadData)<br />
return (SortOrder == &#8220;ASC&#8221;) ? 1 : -1;<br />
else<br />
return 0;<br />
}<br />
}<br />
}<br />
}</p>
<p>/*********Cumulative class and collection for sorting in collection********/<br />
using System;<br />
using System.Collections;<br />
using System.Collections.Generic;<br />
using System.ComponentModel;<br />
using System.Data;<br />
using System.Data.SqlClient;<br />
using System.Text;</p>
<p>namespace Data1.Entity<br />
{<br />
public class Cumulative<br />
{<br />
#region Fields<br />
private Int32 userID;<br />
private Int32 catId;<br />
private string userName;<br />
private string catName;<br />
private Int32 rawData;<br />
private Int32 activeData;<br />
private Int32 passiveData;<br />
private Int32 deadData;<br />
private Int32 archiveData;<br />
private Int32 assignedData;<br />
private Int32 rawAdvertiser;<br />
private Int32 activeAdvertiser;<br />
private Int32 passiveAdvertiser;<br />
private Int32 deadAdvertiser;</p>
<p>private Int32 activeOrder;<br />
private Int32 pendingOrder;<br />
private DateTime date;</p>
<p>#endregion</p>
<p>#region Properties<br />
public Int32 UserID<br />
{<br />
get { return userID; }<br />
set { userID = value; }<br />
}<br />
public Int32 CatId<br />
{<br />
get { return catId; }<br />
set { catId = value; }<br />
}<br />
public string UserName<br />
{<br />
get { return userName; }<br />
set { userName = value; }<br />
}<br />
public string CatName<br />
{<br />
get { return catName; }<br />
set { catName = value; }<br />
}<br />
public Int32 RawData<br />
{<br />
get { return rawData; }<br />
set { rawData = value; }<br />
}<br />
public Int32 ActiveData<br />
{<br />
get { return activeData; }<br />
set { activeData = value; }<br />
}<br />
public Int32 PassiveData<br />
{<br />
get { return passiveData; }<br />
set { passiveData = value; }<br />
}<br />
public Int32 DeadData<br />
{<br />
get { return deadData; }<br />
set { deadData = value; }<br />
}<br />
public Int32 ArchiveData<br />
{<br />
get { return archiveData; }<br />
set { archiveData = value; }<br />
}<br />
public Int32 AssignedData<br />
{<br />
get { return assignedData; }<br />
set { assignedData = value; }<br />
}<br />
public Int32 RawAdvertiser<br />
{<br />
get { return rawAdvertiser; }<br />
set { rawAdvertiser = value; }<br />
}<br />
public Int32 ActiveAdvertiser<br />
{<br />
get { return activeAdvertiser; }<br />
set { activeAdvertiser = value; }<br />
}<br />
public Int32 PassiveAdvertiser<br />
{<br />
get { return passiveAdvertiser; }<br />
set { passiveAdvertiser = value; }<br />
}<br />
public Int32 DeadAdvertiser<br />
{<br />
get { return deadAdvertiser; }<br />
set { deadAdvertiser = value; }<br />
}<br />
public Int32 ActiveOrder<br />
{<br />
get { return activeOrder; }<br />
set { activeOrder = value; }<br />
}<br />
public Int32 PendingOrder<br />
{<br />
get { return pendingOrder; }<br />
set { pendingOrder = value; }<br />
}<br />
public DateTime Date<br />
{<br />
get { return date; }<br />
set { date = value; }<br />
}<br />
#endregion<br />
}</p>
<p>public class CumulativeCollection : CollectionBase<br />
{<br />
public Cumulative this[int index]<br />
{<br />
get<br />
{<br />
return (Cumulative)List[index];<br />
}<br />
}</p>
<p>public void Add(Cumulative obj)<br />
{<br />
List.Add(obj);<br />
}</p>
<p>public void Remove(Cumulative obj)<br />
{<br />
List.Remove(obj);<br />
}</p>
<p>public bool Contains(Cumulative obj)<br />
{<br />
return List.Contains(obj);<br />
}</p>
<p>public void Insert(int index, Cumulative obj)<br />
{<br />
InnerList.Insert(index, obj);<br />
}</p>
<p>public void Sort()<br />
{<br />
InnerList.Sort(null);<br />
}<br />
public void Sort(string sortField, string sortOrder)<br />
{<br />
CompareCollection comparer = new CompareCollection();<br />
comparer.SortField = sortField;<br />
comparer.SortOrder = sortOrder;<br />
this.InnerList.Sort(comparer);</p>
<p>}</p>
<p>public void CopyTo(Cumulative[] array, int index)<br />
{<br />
((ICollection)this).CopyTo(array, index);<br />
}</p>
<p>public int IndexOf(Cumulative value)<br />
{<br />
return ((IList)this).IndexOf(value);<br />
}<br />
}<br />
}</p>
<p>public class test{</p>
<p>public void main(){</p>
<p>Cumulative objCumulative = new Cumulative();<br />
objCumulative.RawData = 11;<br />
objCumulativeCollection.Sort(&#8220;RawData&#8221;, &#8220;ASC&#8221;);</p>
<p>}</p>
<p>}</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/webfunda.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/webfunda.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/webfunda.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/webfunda.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/webfunda.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/webfunda.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/webfunda.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/webfunda.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/webfunda.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/webfunda.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/webfunda.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/webfunda.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/webfunda.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/webfunda.wordpress.com/28/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webfunda.wordpress.com&amp;blog=11063229&amp;post=28&amp;subd=webfunda&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://webfunda.wordpress.com/2009/12/24/sorting-in-collection-in-c-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>0.000000 0.000000</georss:point>
		<geo:lat>0.000000</geo:lat>
		<geo:long>0.000000</geo:long>
		<media:content url="http://1.gravatar.com/avatar/f73d42f103ce9495578330ee8fa0a936?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Praveen Srivastava</media:title>
		</media:content>
	</item>
		<item>
		<title>Top 10 SEO Tips</title>
		<link>http://webfunda.wordpress.com/2009/12/23/top-10-seo-tips/</link>
		<comments>http://webfunda.wordpress.com/2009/12/23/top-10-seo-tips/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 06:16:02 +0000</pubDate>
		<dc:creator>Praveen Srivastava</dc:creator>
				<category><![CDATA[SEO]]></category>
		<category><![CDATA[SEM]]></category>

		<guid isPermaLink="false">http://webfunda.wordpress.com/?p=19</guid>
		<description><![CDATA[1. Insert keywords within the title tag so that search engine robots will know what your page is about. The title tag is located right at the top of your document within the head tags. Inserting a keyword or key phrase will greatly improve your chances of bringing targeted traffic to your site. Make sure [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webfunda.wordpress.com&amp;blog=11063229&amp;post=19&amp;subd=webfunda&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>1.</strong> Insert keywords within the title tag so that search engine robots will know what your page is about. The title tag is located right at the top of your document within the <em>head</em> tags. Inserting a keyword or key phrase will greatly improve your chances of bringing targeted traffic to your site.</p>
<p>Make sure that the title tag contains text which a human can relate to. The text within the title tag is what shows up in a <a id="KonaLink2" href="http://www.ezau.com/latest/articles/0147.shtml#" target="undefined"><span style="color:#f8941d;">search result</span></a>. Treat it like a headline.</p>
<p><strong>2.</strong> Use the same keywords as anchor text to link to the page from different pages on your site. This is especially useful if your site contains many pages. The more keywords that link to a specific page the better.</p>
<p><strong>3.</strong> Make sure that the text within the title tag is also within the body of the page. It is unwise to have keywords in the title tag which are not contained within the body of the page.</p>
<p>Adding the exact same text for your h1 tag will tell the reader who clicks on your page from a search engine result that they have clicked on the correct link and have arrived at the page where they intended to visit. Robots like this too because now there is a relation between the title of your page and the headline.</p>
<p>Also, sprinkle your keywords throughout your article. The most important keywords can be bolded or colored in red. A good place to do this is once or twice in the body at the top of your article and in the sub-headings.</p>
<p><strong>4.</strong> Do not use the exact same title tag on every page on your website. Search engine robots might determine that all your pages are the same if all your title tags are the same. If this happens, your pages might not get indexed.</p>
<p>I always use the headline of my pages as the title tag to help the robots know exactly what my page is about. A good place to insert the headline is within the h1 tag. So the headline is the same as the title tag text.</p>
<p><strong>5.</strong> Do not spam the description or keyword <a id="KonaLink3" href="http://www.ezau.com/latest/articles/0147.shtml#" target="undefined"><span style="color:#f8941d;">meta tag</span></a> by stuffing meaningless keywords or even spend too much time on this tag. SEO pros all agree that these tags are not as important today as they once were. I just place my headline once within the keywords and description tags.</p>
<p><strong>6.</strong> Do not link to link-farms or <a id="KonaLink4" href="http://www.ezau.com/latest/articles/0147.shtml#" target="undefined"><span style="color:#f8941d;">other search engine</span></a> <a href="http://www.ezau.com/latest/articles/0199.shtml">unfriendly neighborhoods</a>.</p>
<p><strong>7.</strong> Do not use doorway pages. Doorway pages are designed for robots only, not humans. Search engines like to index human friendly pages which contain content which is relevant to the search.</p>
<p><strong>8.</strong> Title tags for text links. Insert the title tag within the HTML of your text link to add weight to the link and the page where the link resides. This is like the alt tag for images.</p>
<p>My site contains navigation menus on the left and right of the page. The menu consists of links not images. When you hover over the link with your mouse, the title of the link appears. View the source of this page to see how to add this tag to your links.</p>
<p><strong>9.</strong> Describe your images with the use of the alt tag. This will help search engines that index images to find your pages and will also help readers who use text only web browsers.</p>
<p><strong>10.</strong> Submit to the search engines yourself. Do not use a submission service or submission software. Doing so could get your site penalized or even banned.</p>
<p>Here is the submission page for google: <a href="http://www.google.com/addurl.html" target="_blank">http://www.google.com/addurl.html</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/webfunda.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/webfunda.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/webfunda.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/webfunda.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/webfunda.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/webfunda.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/webfunda.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/webfunda.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/webfunda.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/webfunda.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/webfunda.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/webfunda.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/webfunda.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/webfunda.wordpress.com/19/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webfunda.wordpress.com&amp;blog=11063229&amp;post=19&amp;subd=webfunda&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://webfunda.wordpress.com/2009/12/23/top-10-seo-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f73d42f103ce9495578330ee8fa0a936?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Praveen Srivastava</media:title>
		</media:content>
	</item>
		<item>
		<title>Types of User Defined Function in sql server 2005</title>
		<link>http://webfunda.wordpress.com/2009/12/22/types-of-user-defined-function-in-sql-server-2005/</link>
		<comments>http://webfunda.wordpress.com/2009/12/22/types-of-user-defined-function-in-sql-server-2005/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 11:59:54 +0000</pubDate>
		<dc:creator>Praveen Srivastava</dc:creator>
				<category><![CDATA[MSSQL 2005]]></category>
		<category><![CDATA[sql server 2005]]></category>
		<category><![CDATA[types of user defined function]]></category>

		<guid isPermaLink="false">http://webfunda.wordpress.com/?p=13</guid>
		<description><![CDATA[There are three types of UDFs: - Scalar - Inline - Multi-statement or Table-Valued Scalar Functions Scalar functions return a data type such as int, money, varchar, real, etc. They can be used anywhere a built-in SQL function is allowed. The syntax for a scalar function is the following: CREATE FUNCTION dbo.Factorial ( @iNumber int [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webfunda.wordpress.com&amp;blog=11063229&amp;post=13&amp;subd=webfunda&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="font-family:Georgia;font-size:small;">There are three types of UDFs:<br />
- Scalar<br />
- Inline<br />
- Multi-statement or Table-Valued</span></p>
<p><strong>Scalar Functions</strong></p>
<p>Scalar functions return a data type such as int, money, varchar, real, etc. They can be used anywhere a built-in SQL function is allowed. The syntax for a scalar function is the following:</p>
<pre>CREATE FUNCTION dbo.Factorial ( @iNumber int )
RETURNS INT
AS
BEGIN
DECLARE @i	int

	IF @iNumber &lt;= 1
		SET @i = 1
	ELSE
		SET @i = @iNumber * dbo.Factorial( @iNumber - 1 )
RETURN (@i)
END

<strong>II.  In-Line Table Functions</strong>

In-line table functions are functions that return the output of a single SELECT statement as a table data type.   Since this type of function returns a table, the output can be used in joins of queries as if it was a standard table. The syntax for an in-line table function is as follows:

<strong>II.  In-Line Table Functions</strong>

In-line table functions are functions that return the output of a single SELECT statement as a table data type.   Since this type of function returns a table, the output can be used in joins of queries as if it was a standard table. The syntax for an in-line table function is as follows:
<pre>CREATE FUNCTION dbo.AuthorsForState(@cState char(2) )
RETURNS TABLE
AS
RETURN (SELECT * FROM Authors WHERE state = @cState)

<strong>III. Multistatement Table Functions</strong> Multistatement table functions are similar to stored procedures except that they return a table.  This type of function is suited to address situations where more logic is required than can be expressed in a single query.  The following is the syntax for a multistatement table function:
<pre>CREATE FUNCTION dbo.GetManagerReports ( @iEmployeeID int )
RETURNS @ManagerReports TABLE
   (
   	EmployeeID			int,
   	EmployeeFirstName     		nvarchar(10),
   	EmployeeLastName 		nvarchar(20),
	Title				nvarchar(30),
	TitleOfCourtesy			nvarchar(25),
	Extension			nvarchar(4),
   	ManagerID			int
   )
AS
BEGIN

	DECLARE

@iRowsAdded	int, 		-- Counts rows added to
-- table with each iteration
	@PREPROCESSED			tinyint,		-- Constant
for record prior
-- to processing
	@PROCESSING			tinyint,		-- Constant
for record
-- being processed
	@POSTPROCESSED			tinyint		-- Constant for
records that
-- have been processed

	SET	@PREPROCESSED 		= 0
	SET	@PROCESSING 		= 1
	SET	@POSTPROCESSED 		= 2

	DECLARE	@tblReports TABLE (
-- Holds employees added with each pass thru source employees table
		EmployeeID				int,
   		EmployeeFirstName     			nvarchar(10),
   		EmployeeLastName 			nvarchar(20),
		Title					nvarchar(30),
		TitleOfCourtesy				nvarchar(25),
		Extension				nvarchar(4),
   		ManagerID				int,
		ProcessedState				tinyint
	DEFAULT 0
		)

	--Begin by adding employees who report to the Manager directly.
	INSERT INTO @tblReports
	SELECT EmployeeID, FirstName, LastName, Title, TitleOfCourtesy,
Extension, ReportsTo, @PREPROCESSED
		FROM Employees
	WHERE ReportsTo = @iEmployeeID

	--Save number of direct reports
	SET @iRowsAdded = @@ROWCOUNT

	-- Loop through Employees table until no more iterations are necessary
	--	(e.g., no more rows added) to add all indirect reports.
	WHILE @iRowsAdded &gt; 0
	BEGIN
		--Set just added employees ProcessedState to PROCESSING
-- (for first pass)
		UPDATE @tblReports
			SET ProcessedState = @PROCESSING
		WHERE ProcessedState = @PREPROCESSED

		--Add employees who report to Managers in
-- ProcessedState = PROCESSING
		INSERT INTO @tblReports
SELECT e.EmployeeID, e.FirstName, e.LastName, e.Title,
e.TitleOfCourtesy, e.Extension, e.ReportsTo, @PREPROCESSED
			FROM Employees e
INNER JOIN @tblReports r ON e.ReportsTo = r.EmployeeID
		WHERE r.ProcessedState = @PROCESSING
			AND e.ReportsTo &lt;&gt; @iEmployeeID

		--Save number of rows added for this iteration
		SET @iRowsAdded = @@ROWCOUNT

--Set ProcessedState to POSTPROCESSED for Managers whose
--reports were added in this iteration
		UPDATE @tblReports
			SET ProcessedState = @POSTPROCESSED
		WHERE ProcessedState = @PROCESSING
	END

	--Save all data to output table
	INSERT INTO @ManagerReports
SELECT EmployeeID, EmployeeFirstName, EmployeeLastName, Title,
TitleOfCourtesy, Extension, ManagerID
		FROM @tblReports
   	RETURN
END
</pre>
</pre>
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/webfunda.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/webfunda.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/webfunda.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/webfunda.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/webfunda.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/webfunda.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/webfunda.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/webfunda.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/webfunda.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/webfunda.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/webfunda.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/webfunda.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/webfunda.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/webfunda.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webfunda.wordpress.com&amp;blog=11063229&amp;post=13&amp;subd=webfunda&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://webfunda.wordpress.com/2009/12/22/types-of-user-defined-function-in-sql-server-2005/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f73d42f103ce9495578330ee8fa0a936?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Praveen Srivastava</media:title>
		</media:content>
	</item>
		<item>
		<title>What are Magic Table?</title>
		<link>http://webfunda.wordpress.com/2009/12/22/what-are-magic-table/</link>
		<comments>http://webfunda.wordpress.com/2009/12/22/what-are-magic-table/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 11:47:33 +0000</pubDate>
		<dc:creator>Praveen Srivastava</dc:creator>
				<category><![CDATA[MSSQL 2005]]></category>
		<category><![CDATA[MAGIC TABLE]]></category>
		<category><![CDATA[mssql2005]]></category>

		<guid isPermaLink="false">http://webfunda.wordpress.com/?p=11</guid>
		<description><![CDATA[magic table two part 1)Inserted a)Insert b)update 2)Deleted MAGIC TABLES NOTHING BUT INSERTED AND DELETED WHICH ARE TEMPORARY OBJECTS CREATED BY SERVER INTERNALLY TO HOLD RECENTLY INSERTED VALUES IN THE CASE OF INSERT,TO HOLD RECENTLY DELETED VALUES IN THE CASE OF DELETE,TO HOLD BEFORE UPDATING VALUES OR AFTER UPDATING VALUES IN THE CASE OF UPDATE.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webfunda.wordpress.com&amp;blog=11063229&amp;post=11&amp;subd=webfunda&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<pre>
<pre>
<pre>magic table two part
1)Inserted
 a)Insert
 b)update
2)Deleted</pre>
</pre>
<p>MAGIC TABLES NOTHING BUT INSERTED AND DELETED WHICH ARE<br />
TEMPORARY OBJECTS CREATED BY SERVER INTERNALLY TO HOLD<br />
RECENTLY INSERTED VALUES IN THE CASE OF INSERT,TO HOLD<br />
RECENTLY DELETED VALUES IN THE CASE OF DELETE,TO HOLD<br />
BEFORE UPDATING VALUES OR AFTER UPDATING VALUES IN THE CASE<br />
OF UPDATE.</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/webfunda.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/webfunda.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/webfunda.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/webfunda.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/webfunda.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/webfunda.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/webfunda.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/webfunda.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/webfunda.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/webfunda.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/webfunda.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/webfunda.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/webfunda.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/webfunda.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webfunda.wordpress.com&amp;blog=11063229&amp;post=11&amp;subd=webfunda&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://webfunda.wordpress.com/2009/12/22/what-are-magic-table/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f73d42f103ce9495578330ee8fa0a936?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Praveen Srivastava</media:title>
		</media:content>
	</item>
		<item>
		<title>Difference between STUFF &amp; replace function</title>
		<link>http://webfunda.wordpress.com/2009/12/22/difference-between-stuff-replace-function/</link>
		<comments>http://webfunda.wordpress.com/2009/12/22/difference-between-stuff-replace-function/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 11:40:29 +0000</pubDate>
		<dc:creator>Praveen Srivastava</dc:creator>
				<category><![CDATA[MSSQL 2005]]></category>
		<category><![CDATA[mssql2005]]></category>
		<category><![CDATA[replace]]></category>
		<category><![CDATA[STUFF]]></category>

		<guid isPermaLink="false">http://webfunda.wordpress.com/?p=7</guid>
		<description><![CDATA[STUFF function is used to overwrite existing characters. Using this syntax, STUFF (string_expression,start,length,replacement_characters) where string_expression is the string that will have characters substituted, start is the starting position, length is the number of characters in the string that are substituted, and replacement_characters are the new characters interjected into the string. If we only wanted to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webfunda.wordpress.com&amp;blog=11063229&amp;post=7&amp;subd=webfunda&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>STUFF</strong> function is used to overwrite existing characters.<br />
Using this syntax, STUFF (string_expression,start,length,replacement_characters)</p>
<p>where<br />
string_expression is the string that will have characters substituted,<br />
start is the starting position,<br />
length is the number of characters in the string that are substituted, and replacement_characters are the new characters interjected into the string.</p>
<p><span style="font-size:small;"><span style="font-family:Times New Roman;">If we only wanted to replace the first one, Replace wouldn’t work, since it always replaces ALL occurrences of the string. But Stuff would, since it only replaces the string it finds at the starting location we tell it for the number of chars we want it to replace. </span></span></p>
<pre>select stuff('Hello world',7, 5,'Manish')</pre>
<p><strong>Result:</strong> Hello Manish</p>
<p>REPLACE function to replace existing characters of all occurrences.</p>
<p>Using the syntax REPLACE (string_expression, search_string, replacement_string), where every incidence of search_string found in the string_expression will be replaced with replacement_string.</p>
<pre>select replace('welcome in C# Corner','el','c')</pre>
<p><span style="font-size:small;"><span style="font-family:Times New Roman;"><strong>Result:</strong> wccome in C# Corner</span></span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/webfunda.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/webfunda.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/webfunda.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/webfunda.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/webfunda.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/webfunda.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/webfunda.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/webfunda.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/webfunda.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/webfunda.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/webfunda.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/webfunda.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/webfunda.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/webfunda.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webfunda.wordpress.com&amp;blog=11063229&amp;post=7&amp;subd=webfunda&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://webfunda.wordpress.com/2009/12/22/difference-between-stuff-replace-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f73d42f103ce9495578330ee8fa0a936?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Praveen Srivastava</media:title>
		</media:content>
	</item>
		<item>
		<title>Curl Function to make a Multiple File UPLOAD at a URL (PHP, CURL, LAMP)</title>
		<link>http://webfunda.wordpress.com/2009/12/22/curl-function-to-make-a-multiple-file-upload-at-a-url-php-curl-lamp/</link>
		<comments>http://webfunda.wordpress.com/2009/12/22/curl-function-to-make-a-multiple-file-upload-at-a-url-php-curl-lamp/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 07:38:53 +0000</pubDate>
		<dc:creator>Praveen Srivastava</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Curl]]></category>
		<category><![CDATA[Curl Multiple File Upload]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[Multiple File Upload]]></category>

		<guid isPermaLink="false">http://webfunda.wordpress.com/?p=3</guid>
		<description><![CDATA[The function below can be used top make a Mulitple file upload a URL. Here the function takes two inputs 1) URL &#8211; Location where we have to  save data. 2) Data &#8211; Variable which will be a array of data to be saved at remote Location. function multiRequest($data, $url) { // array of curl [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webfunda.wordpress.com&amp;blog=11063229&amp;post=3&amp;subd=webfunda&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The function below can be used top make a Mulitple file upload a URL.</p>
<p>Here the function takes two inputs</p>
<p>1) URL &#8211; Location where we have to  save data.<br />
2) Data &#8211; Variable which will be a array of data to be saved at remote Location.</p>
<p>function multiRequest($data, $url) {<br />
// array of curl handles<br />
$curly = array();<br />
// data to be returned<br />
$result = array();</p>
<p>// multi handle<br />
$mh = curl_multi_init();</p>
<p>// loop through $data and create curl handles<br />
// then add them to the multi-handle<br />
foreach ($data as $id =&gt; $d) {</p>
<p>$curly[$id] = curl_init();</p>
<p>$post = array(<br />
&#8220;filename&#8221;=&gt; $d<br />
);</p>
<p>curl_setopt($curly[$id], CURLOPT_HEADER, 0);<br />
curl_setopt($curly[$id], CURLOPT_VERBOSE, 0);<br />
curl_setopt($curly[$id], CURLOPT_RETURNTRANSFER, true);<br />
curl_setopt($curly[$id], CURLOPT_USERAGENT, &#8220;Mozilla/4.0 (compatible;)&#8221;);<br />
curl_setopt($curly[$id], CURLOPT_URL, $url);<br />
curl_setopt($curly[$id], CURLOPT_POST, true);<br />
curl_setopt($curly[$id], CURLOPT_POSTFIELDS, $post);</p>
<p>curl_multi_add_handle($mh, $curly[$id]);<br />
}</p>
<p>// execute the handles<br />
$running = null;<br />
do {<br />
curl_multi_exec($mh, $running);<br />
} while($running &gt; 0);</p>
<p>// get content and remove handles<br />
foreach($curly as $id =&gt; $c) {<br />
$result[$id] = curl_multi_getcontent($c);<br />
curl_multi_remove_handle($mh, $c);<br />
}</p>
<p>// all done closing the curl<br />
curl_multi_close($mh);</p>
<p>return $result;<br />
}</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/webfunda.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/webfunda.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/webfunda.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/webfunda.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/webfunda.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/webfunda.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/webfunda.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/webfunda.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/webfunda.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/webfunda.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/webfunda.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/webfunda.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/webfunda.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/webfunda.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=webfunda.wordpress.com&amp;blog=11063229&amp;post=3&amp;subd=webfunda&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://webfunda.wordpress.com/2009/12/22/curl-function-to-make-a-multiple-file-upload-at-a-url-php-curl-lamp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f73d42f103ce9495578330ee8fa0a936?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Praveen Srivastava</media:title>
		</media:content>
	</item>
	</channel>
</rss>
