<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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: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>Comments on: SQL SERVER &#8211; A Quick Note on DB_ID() and DB_NAME() &#8211; Get Current Database ID &#8211; Get Current Database Name</title>
	<atom:link href="http://blog.sqlauthority.com/2011/01/13/sql-server-a-quick-note-on-db_id-and-db_name-get-current-database-id-get-current-database-name/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2011/01/13/sql-server-a-quick-note-on-db_id-and-db_name-get-current-database-id-get-current-database-name/</link>
	<description>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Sat, 25 May 2013 01:31:40 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Nick</title>
		<link>http://blog.sqlauthority.com/2011/01/13/sql-server-a-quick-note-on-db_id-and-db_name-get-current-database-id-get-current-database-name/#comment-479805</link>
		<dc:creator><![CDATA[Nick]]></dc:creator>
		<pubDate>Tue, 21 May 2013 12:21:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=11617#comment-479805</guid>
		<description><![CDATA[HI Pinal Dave, 

Thanks for your helpful articles.

I have a question for you.

I have an SP on DB_1

I call DB_1..SP from DB_2

Is it possible to get the DB_Name(DB_2)  in DB_1 when the SP is called (obviously without entering it by hand )?

Many thanks

Nick]]></description>
		<content:encoded><![CDATA[<p>HI Pinal Dave, </p>
<p>Thanks for your helpful articles.</p>
<p>I have a question for you.</p>
<p>I have an SP on DB_1</p>
<p>I call DB_1..SP from DB_2</p>
<p>Is it possible to get the DB_Name(DB_2)  in DB_1 when the SP is called (obviously without entering it by hand )?</p>
<p>Many thanks</p>
<p>Nick</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER &#8211; Weekly Series &#8211; Memory Lane &#8211; #012 &#171; SQL Server Journey with SQL Authority</title>
		<link>http://blog.sqlauthority.com/2011/01/13/sql-server-a-quick-note-on-db_id-and-db_name-get-current-database-id-get-current-database-name/#comment-409576</link>
		<dc:creator><![CDATA[SQL SERVER &#8211; Weekly Series &#8211; Memory Lane &#8211; #012 &#171; SQL Server Journey with SQL Authority]]></dc:creator>
		<pubDate>Sat, 19 Jan 2013 01:31:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=11617#comment-409576</guid>
		<description><![CDATA[[...] A Quick Note on DB_ID() and DB_NAME() – Get Current Database ID – Get Current Database Name Quite often a simple thing makes experienced DBA to look for a simple thing. Here are few things which I used to get confused couple of years ago. Now I know it well and have no issue but recently I see one of the DBA getting confused when looking at the DBID from one of the DMV and not able to relate that directly to Database Name. [...]]]></description>
		<content:encoded><![CDATA[<p>[...] A Quick Note on DB_ID() and DB_NAME() – Get Current Database ID – Get Current Database Name Quite often a simple thing makes experienced DBA to look for a simple thing. Here are few things which I used to get confused couple of years ago. Now I know it well and have no issue but recently I see one of the DBA getting confused when looking at the DBID from one of the DMV and not able to relate that directly to Database Name. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ken</title>
		<link>http://blog.sqlauthority.com/2011/01/13/sql-server-a-quick-note-on-db_id-and-db_name-get-current-database-id-get-current-database-name/#comment-383023</link>
		<dc:creator><![CDATA[Ken]]></dc:creator>
		<pubDate>Thu, 29 Nov 2012 04:20:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=11617#comment-383023</guid>
		<description><![CDATA[Hi.  Just a followup to my previous question.  Across a linked server, the results look like this:
DB_Name	Size
NULL	 452076.81 MB
NULL	  90974.75 MB
tempdb	  32799.88 MB
NULL	  26025.88 MB
NULL	  10729.69 MB
ReportServerTempDB	   5990.94 MB
NULL	   5900.94 MB
NULL	   1395.06 MB
NULL	   1214.88 MB
NULL	   1210.00 MB
NULL	   1122.94 MB
NULL	    860.00 MB
NULL	    359.07 MB
msdb	     86.31 MB
NULL	     61.06 MB
model	     27.44 MB
ReportServer	     17.00 MB
DataCollection	     16.00 MB
master	      6.50 MB]]></description>
		<content:encoded><![CDATA[<p>Hi.  Just a followup to my previous question.  Across a linked server, the results look like this:<br />
DB_Name	Size<br />
NULL	 452076.81 MB<br />
NULL	  90974.75 MB<br />
tempdb	  32799.88 MB<br />
NULL	  26025.88 MB<br />
NULL	  10729.69 MB<br />
ReportServerTempDB	   5990.94 MB<br />
NULL	   5900.94 MB<br />
NULL	   1395.06 MB<br />
NULL	   1214.88 MB<br />
NULL	   1210.00 MB<br />
NULL	   1122.94 MB<br />
NULL	    860.00 MB<br />
NULL	    359.07 MB<br />
msdb	     86.31 MB<br />
NULL	     61.06 MB<br />
model	     27.44 MB<br />
ReportServer	     17.00 MB<br />
DataCollection	     16.00 MB<br />
master	      6.50 MB</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ken</title>
		<link>http://blog.sqlauthority.com/2011/01/13/sql-server-a-quick-note-on-db_id-and-db_name-get-current-database-id-get-current-database-name/#comment-382160</link>
		<dc:creator><![CDATA[Ken]]></dc:creator>
		<pubDate>Tue, 27 Nov 2012 19:41:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=11617#comment-382160</guid>
		<description><![CDATA[This is a great tip, but I notice this does not work across a linked server.  It instead returns a NULL value for the DB_name.  EX.
select db_name(dbid) As DB_Name, 
str(convert(dec(15),sum(size))* 8192/ 1048576,10,2)+ N&#039; MB&#039; as Size 
from [LinkedServerName].[DBName].[sys].[sysaltfiles]
group by dbid 
order by 2 desc
GO]]></description>
		<content:encoded><![CDATA[<p>This is a great tip, but I notice this does not work across a linked server.  It instead returns a NULL value for the DB_name.  EX.<br />
select db_name(dbid) As DB_Name,<br />
str(convert(dec(15),sum(size))* 8192/ 1048576,10,2)+ N&#8217; MB&#8217; as Size<br />
from [LinkedServerName].[DBName].[sys].[sysaltfiles]<br />
group by dbid<br />
order by 2 desc<br />
GO</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vicky</title>
		<link>http://blog.sqlauthority.com/2011/01/13/sql-server-a-quick-note-on-db_id-and-db_name-get-current-database-id-get-current-database-name/#comment-360434</link>
		<dc:creator><![CDATA[Vicky]]></dc:creator>
		<pubDate>Mon, 15 Oct 2012 19:48:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=11617#comment-360434</guid>
		<description><![CDATA[Hello sir., I wanna know how to take the entire structure (tables,functions,stored procedures) of the database by using query like taking db script., can u help me..?]]></description>
		<content:encoded><![CDATA[<p>Hello sir., I wanna know how to take the entire structure (tables,functions,stored procedures) of the database by using query like taking db script., can u help me..?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kumar</title>
		<link>http://blog.sqlauthority.com/2011/01/13/sql-server-a-quick-note-on-db_id-and-db_name-get-current-database-id-get-current-database-name/#comment-337973</link>
		<dc:creator><![CDATA[kumar]]></dc:creator>
		<pubDate>Mon, 27 Aug 2012 14:24:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=11617#comment-337973</guid>
		<description><![CDATA[yes... Parasurama  always it will return same output]]></description>
		<content:encoded><![CDATA[<p>yes&#8230; Parasurama  always it will return same output</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Parasurama Eswarappa</title>
		<link>http://blog.sqlauthority.com/2011/01/13/sql-server-a-quick-note-on-db_id-and-db_name-get-current-database-id-get-current-database-name/#comment-287981</link>
		<dc:creator><![CDATA[Parasurama Eswarappa]]></dc:creator>
		<pubDate>Thu, 24 May 2012 12:00:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=11617#comment-287981</guid>
		<description><![CDATA[select * from sys.databases where database_id in(1,2,3,4)

does this query always returns  below databases?
master
tempdb
model
msdb]]></description>
		<content:encoded><![CDATA[<p>select * from sys.databases where database_id in(1,2,3,4)</p>
<p>does this query always returns  below databases?<br />
master<br />
tempdb<br />
model<br />
msdb</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bala TCS</title>
		<link>http://blog.sqlauthority.com/2011/01/13/sql-server-a-quick-note-on-db_id-and-db_name-get-current-database-id-get-current-database-name/#comment-150383</link>
		<dc:creator><![CDATA[Bala TCS]]></dc:creator>
		<pubDate>Sun, 24 Jul 2011 13:02:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=11617#comment-150383</guid>
		<description><![CDATA[Me too use to get  confuse on db_name and db_id function , realy it&#039;s use full]]></description>
		<content:encoded><![CDATA[<p>Me too use to get  confuse on db_name and db_id function , realy it&#8217;s use full</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ankur</title>
		<link>http://blog.sqlauthority.com/2011/01/13/sql-server-a-quick-note-on-db_id-and-db_name-get-current-database-id-get-current-database-name/#comment-114733</link>
		<dc:creator><![CDATA[Ankur]]></dc:creator>
		<pubDate>Thu, 27 Jan 2011 18:18:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=11617#comment-114733</guid>
		<description><![CDATA[Hi All,

I am new to Database Field and i am thinking to start my career as SQL Developer and DBA. Can anyone help me out about the syllabus for the certifications for MCDBA so that i can prepare. I shall be highly grateful for any kind of help. Please mail the syllabus on]]></description>
		<content:encoded><![CDATA[<p>Hi All,</p>
<p>I am new to Database Field and i am thinking to start my career as SQL Developer and DBA. Can anyone help me out about the syllabus for the certifications for MCDBA so that i can prepare. I shall be highly grateful for any kind of help. Please mail the syllabus on</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shivaji</title>
		<link>http://blog.sqlauthority.com/2011/01/13/sql-server-a-quick-note-on-db_id-and-db_name-get-current-database-id-get-current-database-name/#comment-114081</link>
		<dc:creator><![CDATA[shivaji]]></dc:creator>
		<pubDate>Tue, 25 Jan 2011 10:45:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=11617#comment-114081</guid>
		<description><![CDATA[Dear dave,

Thanks for simple style you have used to explain sql stuffs.
It&#039; s cool and nice]]></description>
		<content:encoded><![CDATA[<p>Dear dave,</p>
<p>Thanks for simple style you have used to explain sql stuffs.<br />
It&#8217; s cool and nice</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Srikanth Nallamothu</title>
		<link>http://blog.sqlauthority.com/2011/01/13/sql-server-a-quick-note-on-db_id-and-db_name-get-current-database-id-get-current-database-name/#comment-112790</link>
		<dc:creator><![CDATA[Srikanth Nallamothu]]></dc:creator>
		<pubDate>Sat, 22 Jan 2011 10:06:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=11617#comment-112790</guid>
		<description><![CDATA[hello pinal

 This website is very helpful to me,thans for sharing.

 i declared local variable with VARCHAR(MAX).
But it stores only 8000 characters.what to do to store large amount of text into a varable.

ex:
DECLARE @VAR VARCHAR(MAX)
SET @X = &#039;give more than 8000 chars&#039;
PRINT @X]]></description>
		<content:encoded><![CDATA[<p>hello pinal</p>
<p> This website is very helpful to me,thans for sharing.</p>
<p> i declared local variable with VARCHAR(MAX).<br />
But it stores only 8000 characters.what to do to store large amount of text into a varable.</p>
<p>ex:<br />
DECLARE @VAR VARCHAR(MAX)<br />
SET @X = &#8216;give more than 8000 chars&#8217;<br />
PRINT @X</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: khaled khelawy</title>
		<link>http://blog.sqlauthority.com/2011/01/13/sql-server-a-quick-note-on-db_id-and-db_name-get-current-database-id-get-current-database-name/#comment-112468</link>
		<dc:creator><![CDATA[khaled khelawy]]></dc:creator>
		<pubDate>Fri, 21 Jan 2011 11:57:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=11617#comment-112468</guid>
		<description><![CDATA[Nice !]]></description>
		<content:encoded><![CDATA[<p>Nice !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JSREDDY</title>
		<link>http://blog.sqlauthority.com/2011/01/13/sql-server-a-quick-note-on-db_id-and-db_name-get-current-database-id-get-current-database-name/#comment-112184</link>
		<dc:creator><![CDATA[JSREDDY]]></dc:creator>
		<pubDate>Thu, 20 Jan 2011 06:06:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=11617#comment-112184</guid>
		<description><![CDATA[Nice One.]]></description>
		<content:encoded><![CDATA[<p>Nice One.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roger Mathews</title>
		<link>http://blog.sqlauthority.com/2011/01/13/sql-server-a-quick-note-on-db_id-and-db_name-get-current-database-id-get-current-database-name/#comment-110940</link>
		<dc:creator><![CDATA[Roger Mathews]]></dc:creator>
		<pubDate>Fri, 14 Jan 2011 06:41:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=11617#comment-110940</guid>
		<description><![CDATA[Ashish,

This is very useful script. Things like this we wonder all the time. No other blogger has to courage to write what we all want to read.

If you find it simple, you can read other stuff on blog.

We all are different level and our needs are different. 

Roger.]]></description>
		<content:encoded><![CDATA[<p>Ashish,</p>
<p>This is very useful script. Things like this we wonder all the time. No other blogger has to courage to write what we all want to read.</p>
<p>If you find it simple, you can read other stuff on blog.</p>
<p>We all are different level and our needs are different. </p>
<p>Roger.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ashish</title>
		<link>http://blog.sqlauthority.com/2011/01/13/sql-server-a-quick-note-on-db_id-and-db_name-get-current-database-id-get-current-database-name/#comment-110938</link>
		<dc:creator><![CDATA[ashish]]></dc:creator>
		<pubDate>Fri, 14 Jan 2011 06:13:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=11617#comment-110938</guid>
		<description><![CDATA[is this really a post OR just a fomrality that you have to post something perday?]]></description>
		<content:encoded><![CDATA[<p>is this really a post OR just a fomrality that you have to post something perday?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ramdas</title>
		<link>http://blog.sqlauthority.com/2011/01/13/sql-server-a-quick-note-on-db_id-and-db_name-get-current-database-id-get-current-database-name/#comment-110867</link>
		<dc:creator><![CDATA[Ramdas]]></dc:creator>
		<pubDate>Thu, 13 Jan 2011 18:01:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=11617#comment-110867</guid>
		<description><![CDATA[Thanks for the simple script.]]></description>
		<content:encoded><![CDATA[<p>Thanks for the simple script.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Edwin</title>
		<link>http://blog.sqlauthority.com/2011/01/13/sql-server-a-quick-note-on-db_id-and-db_name-get-current-database-id-get-current-database-name/#comment-110843</link>
		<dc:creator><![CDATA[Edwin]]></dc:creator>
		<pubDate>Thu, 13 Jan 2011 14:27:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=11617#comment-110843</guid>
		<description><![CDATA[Dear Sir,

I love your articles and database scripts.

SIMPLE gets the job done :)

Thanks,
Edwin]]></description>
		<content:encoded><![CDATA[<p>Dear Sir,</p>
<p>I love your articles and database scripts.</p>
<p>SIMPLE gets the job done :)</p>
<p>Thanks,<br />
Edwin</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DP</title>
		<link>http://blog.sqlauthority.com/2011/01/13/sql-server-a-quick-note-on-db_id-and-db_name-get-current-database-id-get-current-database-name/#comment-110836</link>
		<dc:creator><![CDATA[DP]]></dc:creator>
		<pubDate>Thu, 13 Jan 2011 13:27:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=11617#comment-110836</guid>
		<description><![CDATA[Hi Pinal,
I am an ardent fan of you for your commitment to SQL Server knowledge sharing forums.
Its a very interesting tip.
Regards,
DP.]]></description>
		<content:encoded><![CDATA[<p>Hi Pinal,<br />
I am an ardent fan of you for your commitment to SQL Server knowledge sharing forums.<br />
Its a very interesting tip.<br />
Regards,<br />
DP.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
