<?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>Nivedita's Weblog &#187; SQL</title>
	<atom:link href="http://niveditaswaminathan.wordpress.com/category/sql/feed/" rel="self" type="application/rss+xml" />
	<link>http://niveditaswaminathan.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Wed, 17 Jun 2009 06:44:54 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='niveditaswaminathan.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/e70038a72bcde8b7e320475e0e0d9dcd?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Nivedita's Weblog &#187; SQL</title>
		<link>http://niveditaswaminathan.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://niveditaswaminathan.wordpress.com/osd.xml" title="Nivedita&#8217;s Weblog" />
		<item>
		<title>Gettin Table Name using SP name</title>
		<link>http://niveditaswaminathan.wordpress.com/2009/06/17/gettin-table-name-using-sp-name/</link>
		<comments>http://niveditaswaminathan.wordpress.com/2009/06/17/gettin-table-name-using-sp-name/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 06:44:54 +0000</pubDate>
		<dc:creator>niveditaswaminathan</dc:creator>
				<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://niveditaswaminathan.wordpress.com/?p=71</guid>
		<description><![CDATA[Hi all its really fun working on queries.. I have been updating my blog with queries as i learn them.. Today i was in need of a query to find the tables from the sp name. Atlast i got it. Here it is&#8230; The first one list the tables and stored procedures linked withthe sp [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=niveditaswaminathan.wordpress.com&blog=1644492&post=71&subd=niveditaswaminathan&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Hi all its really fun working on queries.. I have been updating my blog with queries as i learn them.. Today i was in need of a query to find the tables from the sp name. Atlast i got it. Here it is&#8230; The first one list the tables and stored procedures linked withthe sp name we give. The later one lists the table name alone.</p>
<p><span style="text-decoration:underline;"><span style="color:#800000;">Query 1:</span></span></p>
<p><span style="color:#0000ff;">select name from</span> sysobjects</p>
<p><span style="color:#0000ff;">where</span> id in (<span style="color:#0000ff;">select</span> sd.depid <span style="color:#0000ff;">from</span> sysobjects so, sysdepends sd</p>
<p><span style="color:#0000ff;">where</span> so.<span style="color:#0000ff;">name</span> = <span style="color:#ff0000;">&#8216;InsertWorkflowCompany&#8217;</span> and</p>
<p>sd.id = so.id )</p>
<p><span style="text-decoration:underline;"><span style="color:#800000;">Query 2:</span></span></p>
<p><span style="color:#0000ff;">select name from</span> sysobjects</p>
<p><span style="color:#0000ff;">where</span> id in (<span style="color:#0000ff;">select</span> sd.depid from sysobjects so, sysdepends sd</p>
<p><span style="color:#0000ff;">where</span> so.<span style="color:#0000ff;">name</span> = <span style="color:#ff0000;">&#8216;InsertWorkflowCompany&#8217;</span> and</p>
<p>sd.id = so.id) and <span style="color:#0000ff;">type </span>=&#8217;<span style="color:#ff0000;">U</span>&#8216;</p>
<p>In the second query  type = &#8216;p&#8217;  can be used to list the stored procedures linked.</p>
<p>Happy Querying !!</p>
<p>Cheers !!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/niveditaswaminathan.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/niveditaswaminathan.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/niveditaswaminathan.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/niveditaswaminathan.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/niveditaswaminathan.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/niveditaswaminathan.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/niveditaswaminathan.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/niveditaswaminathan.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/niveditaswaminathan.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/niveditaswaminathan.wordpress.com/71/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=niveditaswaminathan.wordpress.com&blog=1644492&post=71&subd=niveditaswaminathan&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://niveditaswaminathan.wordpress.com/2009/06/17/gettin-table-name-using-sp-name/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/12af00fc9825566cb609ae0c562e302b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">niveditaswaminathan</media:title>
		</media:content>
	</item>
		<item>
		<title>To Get SP Details</title>
		<link>http://niveditaswaminathan.wordpress.com/2009/05/22/to-get-sp-details/</link>
		<comments>http://niveditaswaminathan.wordpress.com/2009/05/22/to-get-sp-details/#comments</comments>
		<pubDate>Fri, 22 May 2009 10:00:02 +0000</pubDate>
		<dc:creator>niveditaswaminathan</dc:creator>
				<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://niveditaswaminathan.wordpress.com/?p=67</guid>
		<description><![CDATA[Hi
These are the 2 queries to get the Sored Procedure details related to a Particular Database and Particular Table.
use db name
Select * From sys.sysobjects where type=&#8217;p&#8217;
SELECT * from sys.sysobjects so
inner join sys.syscomments sc
on so.id=sc.id
where type=&#8217;p&#8217; and sc.text like &#8216;%TableName%&#8217;
where p stands for the sproc.
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=niveditaswaminathan.wordpress.com&blog=1644492&post=67&subd=niveditaswaminathan&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Hi</p>
<p>These are the 2 queries to get the Sored Procedure details related to a Particular Database and Particular Table.</p>
<p>use db name</p>
<p>Select * From sys.sysobjects where type=&#8217;p&#8217;</p>
<p>SELECT * from sys.sysobjects so<br />
inner join sys.syscomments sc<br />
on so.id=sc.id<br />
where type=&#8217;p&#8217; and sc.text like &#8216;%TableName%&#8217;</p>
<p>where p stands for the sproc.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/niveditaswaminathan.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/niveditaswaminathan.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/niveditaswaminathan.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/niveditaswaminathan.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/niveditaswaminathan.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/niveditaswaminathan.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/niveditaswaminathan.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/niveditaswaminathan.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/niveditaswaminathan.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/niveditaswaminathan.wordpress.com/67/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=niveditaswaminathan.wordpress.com&blog=1644492&post=67&subd=niveditaswaminathan&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://niveditaswaminathan.wordpress.com/2009/05/22/to-get-sp-details/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/12af00fc9825566cb609ae0c562e302b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">niveditaswaminathan</media:title>
		</media:content>
	</item>
		<item>
		<title>Inserting Multiple Rows using single SQL statement !!!</title>
		<link>http://niveditaswaminathan.wordpress.com/2008/02/25/inserting-multiple-rows-using-single-sql-statement/</link>
		<comments>http://niveditaswaminathan.wordpress.com/2008/02/25/inserting-multiple-rows-using-single-sql-statement/#comments</comments>
		<pubDate>Mon, 25 Feb 2008 11:42:34 +0000</pubDate>
		<dc:creator>niveditaswaminathan</dc:creator>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[Single Insert Statement]]></category>
		<category><![CDATA[SQL Insert Query]]></category>

		<guid isPermaLink="false">http://niveditaswaminathan.wordpress.com/?p=38</guid>
		<description><![CDATA[I was surprised when i came to know that there is single SQL statement available to insert more than one row at a time. So i decided to write a post on this , inorder to share it with others.
How we generally do :
INSERT INTO TableName(Id,Name)
VALUES (1,'Name1')

INSERT INTO TableName(Id,Name)
VALUES (2,'Name2')
The other way is

INSERT INTO TableName(Id,Name)
SELECT [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=niveditaswaminathan.wordpress.com&blog=1644492&post=38&subd=niveditaswaminathan&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I was surprised when i came to know that there is single SQL statement available to insert more than one row at a time. So i decided to write a post on this , inorder to share it with others.</p>
<p>How we generally do :</p>
<p><code>INSERT INTO TableName(Id,Name)<br />
VALUES (1,'Name1')</code><br />
<code><br />
INSERT INTO TableName(Id,Name)<br />
VALUES (2,'Name2')</code></p>
<p>The other way is<br />
<code><br />
INSERT INTO TableName(Id,Name)<br />
SELECT 1,'Name1'<br />
UNION ALL<br />
SELECT 2,'Name2'<br />
UNION ALL<br />
SELECT 3,'Name3'<br />
</code></p>
<p>Cool!!!!   Isnt It?????</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/niveditaswaminathan.wordpress.com/38/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/niveditaswaminathan.wordpress.com/38/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/niveditaswaminathan.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/niveditaswaminathan.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/niveditaswaminathan.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/niveditaswaminathan.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/niveditaswaminathan.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/niveditaswaminathan.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/niveditaswaminathan.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/niveditaswaminathan.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/niveditaswaminathan.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/niveditaswaminathan.wordpress.com/38/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=niveditaswaminathan.wordpress.com&blog=1644492&post=38&subd=niveditaswaminathan&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://niveditaswaminathan.wordpress.com/2008/02/25/inserting-multiple-rows-using-single-sql-statement/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/12af00fc9825566cb609ae0c562e302b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">niveditaswaminathan</media:title>
		</media:content>
	</item>
		<item>
		<title>sql reseed</title>
		<link>http://niveditaswaminathan.wordpress.com/2007/12/21/sql-reseed/</link>
		<comments>http://niveditaswaminathan.wordpress.com/2007/12/21/sql-reseed/#comments</comments>
		<pubDate>Fri, 21 Dec 2007 07:34:29 +0000</pubDate>
		<dc:creator>niveditaswaminathan</dc:creator>
				<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://niveditaswaminathan.wordpress.com/2007/12/21/sql-reseed/</guid>
		<description><![CDATA[I used to get irritated with my identity column when it increases to somewhere in 300s in my sample applications. I used to drop my table and create it again.Today i saw an article for resetting the identity column.
use databasename
go
dbcc checkident(tablename, reseed,seed value)
This will search the table for the highest ID field, and reset the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=niveditaswaminathan.wordpress.com&blog=1644492&post=32&subd=niveditaswaminathan&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I used to get irritated with my identity column when it increases to somewhere in 300s in my sample applications. I used to drop my table and create it again.Today i saw an article for resetting the identity column.</p>
<p>use databasename</p>
<p>go<br />
dbcc checkident(tablename, reseed,seed value)</p>
<p>This will search the table for the highest ID field, and reset the seed to the seed value specified.</p>
<p>While we are at it, here are some other useful DBCC commands:</p>
<p>To check the integrity of a table:</p>
<p>dbcc checktable(tablename)</p>
<p>To force a table to rebuild its indexes:</p>
<p>dbcc dbreindex(tablename)</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/niveditaswaminathan.wordpress.com/32/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/niveditaswaminathan.wordpress.com/32/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/niveditaswaminathan.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/niveditaswaminathan.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/niveditaswaminathan.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/niveditaswaminathan.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/niveditaswaminathan.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/niveditaswaminathan.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/niveditaswaminathan.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/niveditaswaminathan.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/niveditaswaminathan.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/niveditaswaminathan.wordpress.com/32/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=niveditaswaminathan.wordpress.com&blog=1644492&post=32&subd=niveditaswaminathan&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://niveditaswaminathan.wordpress.com/2007/12/21/sql-reseed/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/12af00fc9825566cb609ae0c562e302b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">niveditaswaminathan</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL Prompt</title>
		<link>http://niveditaswaminathan.wordpress.com/2007/12/19/sql-prompt/</link>
		<comments>http://niveditaswaminathan.wordpress.com/2007/12/19/sql-prompt/#comments</comments>
		<pubDate>Wed, 19 Dec 2007 06:55:00 +0000</pubDate>
		<dc:creator>niveditaswaminathan</dc:creator>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[Red Gate]]></category>
		<category><![CDATA[Sql Prompt]]></category>

		<guid isPermaLink="false">http://niveditaswaminathan.wordpress.com/2007/12/19/sql-prompt/</guid>
		<description><![CDATA[Red Gate is a software that provides intellisense in SQL. The !4 day trial of this software can be downloaded here.
A snap shot of it is shown below.

       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=niveditaswaminathan.wordpress.com&blog=1644492&post=28&subd=niveditaswaminathan&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Red Gate is a software that provides intellisense in SQL. The !4 day trial of this software can be downloaded <a href="http://www.red-gate.com/products/sql_tools_overview.htm">here</a>.</p>
<p>A snap shot of it is shown below.<br />
<a href="http://niveditaswaminathan.files.wordpress.com/2007/12/redgate.jpg" title="redgate.jpg"><img src="http://niveditaswaminathan.files.wordpress.com/2007/12/redgate.thumbnail.jpg" alt="redgate.jpg" /></a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/niveditaswaminathan.wordpress.com/28/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/niveditaswaminathan.wordpress.com/28/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/niveditaswaminathan.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/niveditaswaminathan.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/niveditaswaminathan.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/niveditaswaminathan.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/niveditaswaminathan.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/niveditaswaminathan.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/niveditaswaminathan.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/niveditaswaminathan.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/niveditaswaminathan.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/niveditaswaminathan.wordpress.com/28/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=niveditaswaminathan.wordpress.com&blog=1644492&post=28&subd=niveditaswaminathan&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://niveditaswaminathan.wordpress.com/2007/12/19/sql-prompt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/12af00fc9825566cb609ae0c562e302b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">niveditaswaminathan</media:title>
		</media:content>

		<media:content url="http://niveditaswaminathan.files.wordpress.com/2007/12/redgate.thumbnail.jpg" medium="image">
			<media:title type="html">redgate.jpg</media:title>
		</media:content>
	</item>
	</channel>
</rss>