<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<title>SQL Server Planet ASK! - Recent questions and answers</title>
<link>http://sqlserverplanet.com/qa/qa</link>
<description>Powered by Question2Answer</description>
<item>
<title>how do i rename the column name of existing table in ms sql server</title>
<link>http://sqlserverplanet.com/qa/16/how-rename-the-column-name-of-existing-table-in-ms-sql-server</link>
<description>&lt;script type=&quot;text/javascript&quot; src=&quot;../qa-plugin/syntax-highlighter/scripts/shCore.js&quot;&gt;&lt;/script&gt;&lt;script type=&quot;text/javascript&quot; src=&quot;../qa-plugin/syntax-highlighter/scripts/shAutoloader.js&quot;&gt;&lt;/script&gt;&lt;link type=&quot;text/css&quot; rel=&quot;stylesheet&quot; href=&quot;../qa-plugin/syntax-highlighter/styles/shCoreDefault.css&quot;/&gt;&lt;script type=&quot;text/javascript&quot;&gt;
				var hl_oldOnLoad = window.onload; 
				window.onload = function(){
					if (typeof hl_oldOnLoad == 'function')  
						hl_oldOnLoad(); 
					SyntaxHighlighter.autoloader(
						'applescript            ../qa-plugin/syntax-highlighter/scripts/shBrushAppleScript.js',
						'actionscript3 as3      ../qa-plugin/syntax-highlighter/scripts/shBrushAS3.js',
						'bash shell             ../qa-plugin/syntax-highlighter/scripts/shBrushBash.js',
						'coldfusion cf          ../qa-plugin/syntax-highlighter/scripts/shBrushColdFusion.js',
						'cpp c                  ../qa-plugin/syntax-highlighter/scripts/shBrushCpp.js',
						'c# c-sharp csharp      ../qa-plugin/syntax-highlighter/scripts/shBrushCSharp.js',
						'css                    ../qa-plugin/syntax-highlighter/scripts/shBrushCss.js',
						'delphi pascal          ../qa-plugin/syntax-highlighter/scripts/shBrushDelphi.js',
						'diff patch pas         ../qa-plugin/syntax-highlighter/scripts/shBrushDiff.js',
						'erl erlang             ../qa-plugin/syntax-highlighter/scripts/shBrushErlang.js',
						'groovy                 ../qa-plugin/syntax-highlighter/scripts/shBrushGroovy.js',
						'java                   ../qa-plugin/syntax-highlighter/scripts/shBrushJava.js',
						'jfx javafx             ../qa-plugin/syntax-highlighter/scripts/shBrushJavaFX.js',
						'js jscript javascript  ../qa-plugin/syntax-highlighter/scripts/shBrushJScript.js',
						'perl pl                ../qa-plugin/syntax-highlighter/scripts/shBrushPerl.js',
						'php                    ../qa-plugin/syntax-highlighter/scripts/shBrushPhp.js',
						'text plain             ../qa-plugin/syntax-highlighter/scripts/shBrushPlain.js',
						'py python              ../qa-plugin/syntax-highlighter/scripts/shBrushPython.js',
						'ruby rails ror rb      ../qa-plugin/syntax-highlighter/scripts/shBrushRuby.js',
						'sass scss              ../qa-plugin/syntax-highlighter/scripts/shBrushSass.js',
						'scala                  ../qa-plugin/syntax-highlighter/scripts/shBrushScala.js',
						'sql                    ../qa-plugin/syntax-highlighter/scripts/shBrushSql.js',
						'vb vbnet               ../qa-plugin/syntax-highlighter/scripts/shBrushVb.js',
						'xml xhtml xslt html    ../qa-plugin/syntax-highlighter/scripts/shBrushXml.js'
					);
					SyntaxHighlighter.config.stripBrs = true;
					SyntaxHighlighter.all()
				}
	
				&lt;/script&gt;</description>
<category>SQL Server Database Engine</category>
<guid isPermaLink="true">http://sqlserverplanet.com/qa/16/how-rename-the-column-name-of-existing-table-in-ms-sql-server</guid>
<pubDate>Tue, 03 Apr 2012 11:17:38 +0000</pubDate>
</item>
<item>
<title>how handle multiple transcation per rollback in mssql ?</title>
<link>http://sqlserverplanet.com/qa/15/how-handle-multiple-transcation-per-rollback-in-mssql</link>
<description></description>
<category>DBA</category>
<guid isPermaLink="true">http://sqlserverplanet.com/qa/15/how-handle-multiple-transcation-per-rollback-in-mssql</guid>
<pubDate>Mon, 02 Apr 2012 08:51:03 +0000</pubDate>
</item>
<item>
<title>2 select query in stored procedure</title>
<link>http://sqlserverplanet.com/qa/14/2-select-query-in-stored-procedure</link>
<description>&lt;p&gt;
	&lt;span style=&quot;color: rgb(80, 80, 80); font-family: 'Segoe UI'; font-size: 13px;&quot;&gt;hi,i want to select two queries from 1 stored procedure....my following is correct? and how to call this in 2 gridview&lt;/span&gt;&lt;br style=&quot;color: rgb(80, 80, 80); font-family: 'Segoe UI'; font-size: 13px;&quot;&gt;
	&lt;span style=&quot;color: rgb(80, 80, 80); font-family: 'Segoe UI'; font-size: 13px;&quot;&gt;create procedure travelamount1&lt;/span&gt;&lt;br style=&quot;color: rgb(80, 80, 80); font-family: 'Segoe UI'; font-size: 13px;&quot;&gt;
	&lt;span style=&quot;color: rgb(80, 80, 80); font-family: 'Segoe UI'; font-size: 13px;&quot;&gt;@categeoryid varchar(50)&lt;/span&gt;&lt;br style=&quot;color: rgb(80, 80, 80); font-family: 'Segoe UI'; font-size: 13px;&quot;&gt;
	&lt;span style=&quot;color: rgb(80, 80, 80); font-family: 'Segoe UI'; font-size: 13px;&quot;&gt;as&lt;/span&gt;&lt;br style=&quot;color: rgb(80, 80, 80); font-family: 'Segoe UI'; font-size: 13px;&quot;&gt;
	&lt;span style=&quot;color: rgb(80, 80, 80); font-family: 'Segoe UI'; font-size: 13px;&quot;&gt;select a.categeoryid,&lt;/span&gt;&lt;br style=&quot;color: rgb(80, 80, 80); font-family: 'Segoe UI'; font-size: 13px;&quot;&gt;
	&lt;span style=&quot;color: rgb(80, 80, 80); font-family: 'Segoe UI'; font-size: 13px;&quot;&gt;&amp;nbsp;isnull(a.advance,0) as advance,&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: rgb(80, 80, 80); font-family: 'Segoe UI'; font-size: 13px;&quot;&gt;
	&lt;span style=&quot;color: rgb(80, 80, 80); font-family: 'Segoe UI'; font-size: 13px;&quot;&gt;&amp;nbsp;isnull(b.submitted_amt,0) as submitted &amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: rgb(80, 80, 80); font-family: 'Segoe UI'; font-size: 13px;&quot;&gt;
	&lt;span style=&quot;color: rgb(80, 80, 80); font-family: 'Segoe UI'; font-size: 13px;&quot;&gt;&amp;nbsp;into #temp1&lt;/span&gt;&lt;br style=&quot;color: rgb(80, 80, 80); font-family: 'Segoe UI'; font-size: 13px;&quot;&gt;
	&lt;span style=&quot;color: rgb(80, 80, 80); font-family: 'Segoe UI'; font-size: 13px;&quot;&gt;&amp;nbsp;from&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: rgb(80, 80, 80); font-family: 'Segoe UI'; font-size: 13px;&quot;&gt;
	&lt;span style=&quot;color: rgb(80, 80, 80); font-family: 'Segoe UI'; font-size: 13px;&quot;&gt;&amp;nbsp;(select categeoryid,SUM(Amount)as advance&lt;/span&gt;&lt;br style=&quot;color: rgb(80, 80, 80); font-family: 'Segoe UI'; font-size: 13px;&quot;&gt;
	&lt;span style=&quot;color: rgb(80, 80, 80); font-family: 'Segoe UI'; font-size: 13px;&quot;&gt;&amp;nbsp;from ExpenditureDetails where Expenditurefor='Travel' group by categeoryid) a&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: rgb(80, 80, 80); font-family: 'Segoe UI'; font-size: 13px;&quot;&gt;
	&lt;span style=&quot;color: rgb(80, 80, 80); font-family: 'Segoe UI'; font-size: 13px;&quot;&gt;&amp;nbsp;full join&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: rgb(80, 80, 80); font-family: 'Segoe UI'; font-size: 13px;&quot;&gt;
	&lt;span style=&quot;color: rgb(80, 80, 80); font-family: 'Segoe UI'; font-size: 13px;&quot;&gt;&amp;nbsp;(select categeoryid,SUM(Amount)as submitted_amt&lt;/span&gt;&lt;br style=&quot;color: rgb(80, 80, 80); font-family: 'Segoe UI'; font-size: 13px;&quot;&gt;
	&lt;span style=&quot;color: rgb(80, 80, 80); font-family: 'Segoe UI'; font-size: 13px;&quot;&gt;&amp;nbsp;from ExpenditureTravelling group by categeoryid) b&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: rgb(80, 80, 80); font-family: 'Segoe UI'; font-size: 13px;&quot;&gt;
	&lt;span style=&quot;color: rgb(80, 80, 80); font-family: 'Segoe UI'; font-size: 13px;&quot;&gt;&amp;nbsp;on a.categeoryid=b.categeoryid&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: rgb(80, 80, 80); font-family: 'Segoe UI'; font-size: 13px;&quot;&gt;
	&lt;span style=&quot;color: rgb(80, 80, 80); font-family: 'Segoe UI'; font-size: 13px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: rgb(80, 80, 80); font-family: 'Segoe UI'; font-size: 13px;&quot;&gt;
	&lt;span style=&quot;color: rgb(80, 80, 80); font-family: 'Segoe UI'; font-size: 13px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong style=&quot;color: rgb(80, 80, 80); font-family: 'Segoe UI'; font-size: 13px;&quot;&gt;select categeoryid,&lt;br&gt;
	&amp;nbsp;advance,&lt;br&gt;
	&amp;nbsp;submitted,&lt;br&gt;
	&amp;nbsp;advance-submitted as balance_return&lt;br&gt;
	&amp;nbsp;from #temp1&lt;/strong&gt;&lt;br style=&quot;color: rgb(80, 80, 80); font-family: 'Segoe UI'; font-size: 13px;&quot;&gt;
	&lt;span style=&quot;color: rgb(80, 80, 80); font-family: 'Segoe UI'; font-size: 13px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong style=&quot;color: rgb(80, 80, 80); font-family: 'Segoe UI'; font-size: 13px;&quot;&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;select categeoryid,advance,submitted,advance-submitted as balance_return from #temp1 where categeoryid=@categeoryid&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;</description>
<category>Getting started with SQL Server</category>
<guid isPermaLink="true">http://sqlserverplanet.com/qa/14/2-select-query-in-stored-procedure</guid>
<pubDate>Thu, 22 Mar 2012 11:55:11 +0000</pubDate>
</item>
<item>
<title>What is the right way to process table (1000000 rows) row-by-row</title>
<link>http://sqlserverplanet.com/qa/13/what-is-the-right-way-to-process-table-1000000-rows-row-by-row</link>
<description>Hi all,&lt;br /&gt;
Please suggest me what will be best way to processing 1000000 records &amp;nbsp;in following logic..&lt;br /&gt;
&lt;br /&gt;
Begin Loop on Master Table&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;Posting on Transaction File&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;Begin Loop on Detail Table&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Posting on Transaction File &amp;nbsp;&amp;nbsp;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;Loop&lt;br /&gt;
Loop&lt;br /&gt;
---------------------------------------------------&lt;br /&gt;
Posting Procedure on Transaction File&lt;br /&gt;
If record not exits in Transaction File&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;Begin&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Insert New Record&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;End&lt;br /&gt;
Else&lt;br /&gt;
&amp;nbsp;&amp;nbsp;Begin&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Update Same records&lt;br /&gt;
&amp;nbsp;&amp;nbsp;End&lt;br /&gt;
&lt;br /&gt;
- Regrds&lt;br /&gt;
A Roy Chowdhury</description>
<category>Transact SQL</category>
<guid isPermaLink="true">http://sqlserverplanet.com/qa/13/what-is-the-right-way-to-process-table-1000000-rows-row-by-row</guid>
<pubDate>Fri, 03 Feb 2012 13:28:03 +0000</pubDate>
</item>
<item>
<title>Answered: How do you like the new Ask! Community?</title>
<link>http://sqlserverplanet.com/qa/6/how-do-you-like-the-new-ask-community?show=12#a12</link>
<description>its really awesome</description>
<category>Not SQL Related</category>
<guid isPermaLink="true">http://sqlserverplanet.com/qa/6/how-do-you-like-the-new-ask-community?show=12#a12</guid>
<pubDate>Wed, 25 Jan 2012 16:16:13 +0000</pubDate>
</item>
<item>
<title>Answered: I need some kind of book that will provide examples of querying linked data tables.</title>
<link>http://sqlserverplanet.com/qa/10/need-some-will-provide-examples-querying-linked-data-tables?show=11#a11</link>
<description>Hi Debra,&lt;br /&gt;
&lt;br /&gt;
From the sound of it, you're fine just keeping the data on the remote server. &amp;nbsp;The only time you might need to load the data into your local server is if you need to join tables on the linked server with tables on your local server. &amp;nbsp;When you need to do that it creates a lot of network traffic and is not efficient.&lt;br /&gt;
&lt;br /&gt;
As for the actual queries you need, it sounds like you just need a basic select statement like: &lt;br /&gt;
&lt;br /&gt;
SELECT member_name&lt;br /&gt;
&lt;br /&gt;
FROM members&lt;br /&gt;
&lt;br /&gt;
WHERE memberid = 1234&lt;br /&gt;
&lt;br /&gt;
however since it's on a linked server you need to use the fully qualified name which includes the lined server name:&lt;br /&gt;
&lt;br /&gt;
SELECT member_name&lt;br /&gt;
&lt;br /&gt;
FROM [linkedservername].[databasename].[dbo].members&lt;br /&gt;
&lt;br /&gt;
WHERE memberid = 1234&lt;br /&gt;
&lt;br /&gt;
That should perform the query. &amp;nbsp;Just replace the names above with your linked server name, and it's database name and it should work.&lt;br /&gt;
&lt;br /&gt;
Derek</description>
<category>Transact SQL</category>
<guid isPermaLink="true">http://sqlserverplanet.com/qa/10/need-some-will-provide-examples-querying-linked-data-tables?show=11#a11</guid>
<pubDate>Tue, 24 Jan 2012 21:41:36 +0000</pubDate>
</item>
<item>
<title>Answered: what is view in sql server 2005</title>
<link>http://sqlserverplanet.com/qa/8/what-is-view-in-sql-server-2005?show=9#a9</link>
<description>Hi,&lt;br /&gt;
&lt;br /&gt;
A view is simply a saved select statement. &amp;nbsp;&amp;nbsp;It does not contain data. &amp;nbsp;When you call a view, it executes that select statement.&lt;br /&gt;
&lt;br /&gt;
let's use this sample view as an example:&lt;br /&gt;
&lt;br /&gt;
CREATE VIEW vw_customer&lt;br /&gt;
&lt;br /&gt;
AS&lt;br /&gt;
&lt;br /&gt;
BEGIN&lt;br /&gt;
&lt;br /&gt;
SELECT * FROM customer&lt;br /&gt;
&lt;br /&gt;
END&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
If you make a call to the view like this:&lt;br /&gt;
&lt;br /&gt;
SELECT * FROM vw_customer&lt;br /&gt;
&lt;br /&gt;
it's the same as if you are executing the following:&lt;br /&gt;
&lt;br /&gt;
SELECT * FROM (SELECT * FROM CUSTOMER)&lt;br /&gt;
&lt;br /&gt;
Another reason to create a view is to provide a layer of abstraction for the underlying table. &amp;nbsp;This could be for security reasons, or to alias the columns, or to provide additional columns.&lt;br /&gt;
&lt;br /&gt;
Derek</description>
<category>Getting started with SQL Server</category>
<guid isPermaLink="true">http://sqlserverplanet.com/qa/8/what-is-view-in-sql-server-2005?show=9#a9</guid>
<pubDate>Tue, 24 Jan 2012 17:35:36 +0000</pubDate>
</item>
</channel>
</rss>
