<?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; Get Current Database Name</title>
	<atom:link href="http://blog.sqlauthority.com/2008/02/12/sql-server-get-current-database-name/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2008/02/12/sql-server-get-current-database-name/</link>
	<description>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Fri, 17 May 2013 15:26:57 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Riddhi</title>
		<link>http://blog.sqlauthority.com/2008/02/12/sql-server-get-current-database-name/#comment-462185</link>
		<dc:creator><![CDATA[Riddhi]]></dc:creator>
		<pubDate>Tue, 23 Apr 2013 13:48:42 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=503#comment-462185</guid>
		<description><![CDATA[very useful thanks]]></description>
		<content:encoded><![CDATA[<p>very useful thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rajeev</title>
		<link>http://blog.sqlauthority.com/2008/02/12/sql-server-get-current-database-name/#comment-461951</link>
		<dc:creator><![CDATA[rajeev]]></dc:creator>
		<pubDate>Tue, 23 Apr 2013 06:24:07 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=503#comment-461951</guid>
		<description><![CDATA[Dear Sir,

Can please advise &quot;How to find database name using table name in sql&quot;]]></description>
		<content:encoded><![CDATA[<p>Dear Sir,</p>
<p>Can please advise &#8220;How to find database name using table name in sql&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rahul Dewada</title>
		<link>http://blog.sqlauthority.com/2008/02/12/sql-server-get-current-database-name/#comment-422400</link>
		<dc:creator><![CDATA[Rahul Dewada]]></dc:creator>
		<pubDate>Sat, 16 Feb 2013 06:27:52 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=503#comment-422400</guid>
		<description><![CDATA[Thank you very much Pinal.]]></description>
		<content:encoded><![CDATA[<p>Thank you very much Pinal.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER &#8211; Weekly Series &#8211; Memory Lane &#8211; #016 &#171; SQL Server Journey with SQL Authority</title>
		<link>http://blog.sqlauthority.com/2008/02/12/sql-server-get-current-database-name/#comment-422294</link>
		<dc:creator><![CDATA[SQL SERVER &#8211; Weekly Series &#8211; Memory Lane &#8211; #016 &#171; SQL Server Journey with SQL Authority]]></dc:creator>
		<pubDate>Sat, 16 Feb 2013 01:31:12 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=503#comment-422294</guid>
		<description><![CDATA[[...] SQL SERVER – Get Current Database Name A quick script which will give user current database name. [...]]]></description>
		<content:encoded><![CDATA[<p>[...] SQL SERVER – Get Current Database Name A quick script which will give user current database name. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ralph Owens</title>
		<link>http://blog.sqlauthority.com/2008/02/12/sql-server-get-current-database-name/#comment-361198</link>
		<dc:creator><![CDATA[Ralph Owens]]></dc:creator>
		<pubDate>Wed, 17 Oct 2012 16:40:25 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=503#comment-361198</guid>
		<description><![CDATA[Hi Dave, similar question:  I have multiple DBs with similar Schemas (for different levels of development).  I need a way to dynamically specify which of these schemas is the one I want.

Kind of like a:  &quot;USE [Ask me for which DB and insert it here]&quot; statement at the top of the script.

Any ideas?

-Ralph]]></description>
		<content:encoded><![CDATA[<p>Hi Dave, similar question:  I have multiple DBs with similar Schemas (for different levels of development).  I need a way to dynamically specify which of these schemas is the one I want.</p>
<p>Kind of like a:  &#8220;USE [Ask me for which DB and insert it here]&#8221; statement at the top of the script.</p>
<p>Any ideas?</p>
<p>-Ralph</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lingaraj</title>
		<link>http://blog.sqlauthority.com/2008/02/12/sql-server-get-current-database-name/#comment-358984</link>
		<dc:creator><![CDATA[Lingaraj]]></dc:creator>
		<pubDate>Fri, 12 Oct 2012 02:44:09 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=503#comment-358984</guid>
		<description><![CDATA[1) I have 2 db one is parent db and another one is child db.

2) suppose while using child db i need parent table information normall we are using parent..tablename.

3) statically we declare @db=parent at that time we use exec() the query.

for ex:

declare @DB varchar(20)
set @db= parent


exec
(
                &#039;select * from child inner join 
                (
                                SELECT distinct  ia_grn_num FROM &#039;+@DB+&#039;..invtb_adjust where ia_stock_num = &#039;&#039;TYREI&#039;&#039;
                ) b on ir_grn_num = b.ia_grn_num&#039;
)


4) I want to use set @db= parent but i dont want to use exec() the query. Is it posible to sql server?]]></description>
		<content:encoded><![CDATA[<p>1) I have 2 db one is parent db and another one is child db.</p>
<p>2) suppose while using child db i need parent table information normall we are using parent..tablename.</p>
<p>3) statically we declare @db=parent at that time we use exec() the query.</p>
<p>for ex:</p>
<p>declare @DB varchar(20)<br />
set @db= parent</p>
<p>exec<br />
(<br />
                &#8216;select * from child inner join<br />
                (<br />
                                SELECT distinct  ia_grn_num FROM &#8216;+@DB+&#8217;..invtb_adjust where ia_stock_num = &#8221;TYREI&#8221;<br />
                ) b on ir_grn_num = b.ia_grn_num&#8217;<br />
)</p>
<p>4) I want to use set @db= parent but i dont want to use exec() the query. Is it posible to sql server?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ram</title>
		<link>http://blog.sqlauthority.com/2008/02/12/sql-server-get-current-database-name/#comment-340211</link>
		<dc:creator><![CDATA[Ram]]></dc:creator>
		<pubDate>Sun, 02 Sep 2012 17:17:31 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=503#comment-340211</guid>
		<description><![CDATA[Thank u sir....]]></description>
		<content:encoded><![CDATA[<p>Thank u sir&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: abhijit</title>
		<link>http://blog.sqlauthority.com/2008/02/12/sql-server-get-current-database-name/#comment-310205</link>
		<dc:creator><![CDATA[abhijit]]></dc:creator>
		<pubDate>Fri, 06 Jul 2012 14:33:15 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=503#comment-310205</guid>
		<description><![CDATA[thanks.........................]]></description>
		<content:encoded><![CDATA[<p>thanks&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aliasger Bhanpurawala</title>
		<link>http://blog.sqlauthority.com/2008/02/12/sql-server-get-current-database-name/#comment-288429</link>
		<dc:creator><![CDATA[Aliasger Bhanpurawala]]></dc:creator>
		<pubDate>Fri, 25 May 2012 07:54:46 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=503#comment-288429</guid>
		<description><![CDATA[THANKS SIR,,,]]></description>
		<content:encoded><![CDATA[<p>THANKS SIR,,,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hans Lindgren</title>
		<link>http://blog.sqlauthority.com/2008/02/12/sql-server-get-current-database-name/#comment-281413</link>
		<dc:creator><![CDATA[Hans Lindgren]]></dc:creator>
		<pubDate>Wed, 02 May 2012 15:04:25 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=503#comment-281413</guid>
		<description><![CDATA[True.. But if you just want to do a quick query in all database and this SP is still working, I&#039;d say, Go For It...]]></description>
		<content:encoded><![CDATA[<p>True.. But if you just want to do a quick query in all database and this SP is still working, I&#8217;d say, Go For It&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nilesh Mehta</title>
		<link>http://blog.sqlauthority.com/2008/02/12/sql-server-get-current-database-name/#comment-271081</link>
		<dc:creator><![CDATA[Nilesh Mehta]]></dc:creator>
		<pubDate>Tue, 03 Apr 2012 05:31:03 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=503#comment-271081</guid>
		<description><![CDATA[Thanks a lot. You have been a great help .]]></description>
		<content:encoded><![CDATA[<p>Thanks a lot. You have been a great help .</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pia</title>
		<link>http://blog.sqlauthority.com/2008/02/12/sql-server-get-current-database-name/#comment-270891</link>
		<dc:creator><![CDATA[Pia]]></dc:creator>
		<pubDate>Mon, 02 Apr 2012 15:56:35 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=503#comment-270891</guid>
		<description><![CDATA[Hi, I have my database on a shared database server. I have been not using that database for quite some time now and now I need to retreive some old data. All I remember are few table names in the database. Is there a way, to find my database name on a shared database server using the table names?]]></description>
		<content:encoded><![CDATA[<p>Hi, I have my database on a shared database server. I have been not using that database for quite some time now and now I need to retreive some old data. All I remember are few table names in the database. Is there a way, to find my database name on a shared database server using the table names?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sudhakar</title>
		<link>http://blog.sqlauthority.com/2008/02/12/sql-server-get-current-database-name/#comment-257521</link>
		<dc:creator><![CDATA[sudhakar]]></dc:creator>
		<pubDate>Tue, 28 Feb 2012 06:56:50 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=503#comment-257521</guid>
		<description><![CDATA[please help me...

In my form -button1 -name: conn
button2: name: orders
Insert data into the table with the help of dataset, datagridview and command builder class
* command builder class is used to create DML syntaxes
* command builder class works with the help of data adapter class

i am write code in below way but cannot execute this code and after build my program error msg is displayed:

error msg like this: Error	1	Non-invocable member &#039;System.Data.DataSet.Tables&#039; cannot be used like a method.	D:\sudhakar\webapp\database\database\Form1.cs	51	43	database


  private void conn_Click(object sender, EventArgs e)
        {
            //SqlConnection con = new SqlConnection();
            con = new SqlConnection(&quot;server=COMPUTER-9C3215; uid=sa; pwd=btp@123; databse=sudha&quot;);
            con.Open();
            MessageBox.Show(&quot;connection is opend&quot;);
            // string q=&quot;&quot;;
            SqlDataAdapter da = new SqlDataAdapter(&quot;select * from test&quot;, con);
           da.Fill(ds, &quot;test&quot;);
            //DataSet1 ds = new DataSet1();
            DataSet ds = new DataSet();
            MessageBox.Show(&quot;data is filled:&quot; + con.State.ToString());
        }

        private void button4_Click(object sender, EventArgs e)
        {
          
            dataGridView1.DataSource = ds.Tables(&quot;t&quot;);
        }


Note: My error is :Error	1	Non-invocable member &#039;System.Data.DataSet.Tables&#039; cannot be used like a method.	D:\sudhakar\webapp\database\database\Form1.cs	51	43	database


after build: keyword is not supported]]></description>
		<content:encoded><![CDATA[<p>please help me&#8230;</p>
<p>In my form -button1 -name: conn<br />
button2: name: orders<br />
Insert data into the table with the help of dataset, datagridview and command builder class<br />
* command builder class is used to create DML syntaxes<br />
* command builder class works with the help of data adapter class</p>
<p>i am write code in below way but cannot execute this code and after build my program error msg is displayed:</p>
<p>error msg like this: Error	1	Non-invocable member &#8216;System.Data.DataSet.Tables&#8217; cannot be used like a method.	D:\sudhakar\webapp\database\database\Form1.cs	51	43	database</p>
<p>  private void conn_Click(object sender, EventArgs e)<br />
        {<br />
            //SqlConnection con = new SqlConnection();<br />
            con = new SqlConnection(&#8220;server=COMPUTER-9C3215; uid=sa; pwd=btp@123; databse=sudha&#8221;);<br />
            con.Open();<br />
            MessageBox.Show(&#8220;connection is opend&#8221;);<br />
            // string q=&#8221;";<br />
            SqlDataAdapter da = new SqlDataAdapter(&#8220;select * from test&#8221;, con);<br />
           da.Fill(ds, &#8220;test&#8221;);<br />
            //DataSet1 ds = new DataSet1();<br />
            DataSet ds = new DataSet();<br />
            MessageBox.Show(&#8220;data is filled:&#8221; + con.State.ToString());<br />
        }</p>
<p>        private void button4_Click(object sender, EventArgs e)<br />
        {</p>
<p>            dataGridView1.DataSource = ds.Tables(&#8220;t&#8221;);<br />
        }</p>
<p>Note: My error is :Error	1	Non-invocable member &#8216;System.Data.DataSet.Tables&#8217; cannot be used like a method.	D:\sudhakar\webapp\database\database\Form1.cs	51	43	database</p>
<p>after build: keyword is not supported</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sudhakar</title>
		<link>http://blog.sqlauthority.com/2008/02/12/sql-server-get-current-database-name/#comment-257513</link>
		<dc:creator><![CDATA[sudhakar]]></dc:creator>
		<pubDate>Tue, 28 Feb 2012 06:38:11 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=503#comment-257513</guid>
		<description><![CDATA[yes its very useful to find data base name
__thanks a lot]]></description>
		<content:encoded><![CDATA[<p>yes its very useful to find data base name<br />
__thanks a lot</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ala'a</title>
		<link>http://blog.sqlauthority.com/2008/02/12/sql-server-get-current-database-name/#comment-242655</link>
		<dc:creator><![CDATA[Ala'a]]></dc:creator>
		<pubDate>Mon, 23 Jan 2012 14:19:59 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=503#comment-242655</guid>
		<description><![CDATA[Hi ...
how can i copy databases from sql server 2005 to CD or flash memory.. 

THx ..]]></description>
		<content:encoded><![CDATA[<p>Hi &#8230;<br />
how can i copy databases from sql server 2005 to CD or flash memory.. </p>
<p>THx ..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jullie</title>
		<link>http://blog.sqlauthority.com/2008/02/12/sql-server-get-current-database-name/#comment-230879</link>
		<dc:creator><![CDATA[Jullie]]></dc:creator>
		<pubDate>Tue, 03 Jan 2012 23:50:47 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=503#comment-230879</guid>
		<description><![CDATA[Thanks 
Help me.....................]]></description>
		<content:encoded><![CDATA[<p>Thanks<br />
Help me&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sss</title>
		<link>http://blog.sqlauthority.com/2008/02/12/sql-server-get-current-database-name/#comment-211961</link>
		<dc:creator><![CDATA[sss]]></dc:creator>
		<pubDate>Tue, 06 Dec 2011 09:21:18 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=503#comment-211961</guid>
		<description><![CDATA[hi...

how can i get the database name of a particular column.

thanks in advance.]]></description>
		<content:encoded><![CDATA[<p>hi&#8230;</p>
<p>how can i get the database name of a particular column.</p>
<p>thanks in advance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhivanan</title>
		<link>http://blog.sqlauthority.com/2008/02/12/sql-server-get-current-database-name/#comment-191520</link>
		<dc:creator><![CDATA[madhivanan]]></dc:creator>
		<pubDate>Wed, 09 Nov 2011 11:02:17 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=503#comment-191520</guid>
		<description><![CDATA[Usage of undocumented procedures are not reliabel. They can be removed at any point of time]]></description>
		<content:encoded><![CDATA[<p>Usage of undocumented procedures are not reliabel. They can be removed at any point of time</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hans Lindgren</title>
		<link>http://blog.sqlauthority.com/2008/02/12/sql-server-get-current-database-name/#comment-190081</link>
		<dc:creator><![CDATA[Hans Lindgren]]></dc:creator>
		<pubDate>Mon, 07 Nov 2011 11:46:45 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=503#comment-190081</guid>
		<description><![CDATA[Instead of writing your own cursor, use the undocumented SP called: sp_MSforeachdb

Example use: EXEC sp_MSforeachdb &#039;PRINT &#039;&#039;?&#039;&#039;&#039;
Which will print the names of all your databases]]></description>
		<content:encoded><![CDATA[<p>Instead of writing your own cursor, use the undocumented SP called: sp_MSforeachdb</p>
<p>Example use: EXEC sp_MSforeachdb &#8216;PRINT &#8221;?&#8221;&#8217;<br />
Which will print the names of all your databases</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Digger jones</title>
		<link>http://blog.sqlauthority.com/2008/02/12/sql-server-get-current-database-name/#comment-180427</link>
		<dc:creator><![CDATA[Digger jones]]></dc:creator>
		<pubDate>Tue, 18 Oct 2011 18:48:37 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=503#comment-180427</guid>
		<description><![CDATA[Amazing!!!!  I could have read this exact same thing in the SQL Help but this is so much better!]]></description>
		<content:encoded><![CDATA[<p>Amazing!!!!  I could have read this exact same thing in the SQL Help but this is so much better!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DDwarf</title>
		<link>http://blog.sqlauthority.com/2008/02/12/sql-server-get-current-database-name/#comment-180257</link>
		<dc:creator><![CDATA[DDwarf]]></dc:creator>
		<pubDate>Tue, 18 Oct 2011 08:02:07 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=503#comment-180257</guid>
		<description><![CDATA[Thank you.]]></description>
		<content:encoded><![CDATA[<p>Thank you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Saeed Neamati</title>
		<link>http://blog.sqlauthority.com/2008/02/12/sql-server-get-current-database-name/#comment-179751</link>
		<dc:creator><![CDATA[Saeed Neamati]]></dc:creator>
		<pubDate>Mon, 17 Oct 2011 03:12:09 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=503#comment-179751</guid>
		<description><![CDATA[Great post. While this script was really simple, but it saved me from hours of trial and error operations to get the name of the current database.

I was planning to use sys.databases catalog view for that.

Thanks.]]></description>
		<content:encoded><![CDATA[<p>Great post. While this script was really simple, but it saved me from hours of trial and error operations to get the name of the current database.</p>
<p>I was planning to use sys.databases catalog view for that.</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chandra</title>
		<link>http://blog.sqlauthority.com/2008/02/12/sql-server-get-current-database-name/#comment-168285</link>
		<dc:creator><![CDATA[chandra]]></dc:creator>
		<pubDate>Thu, 15 Sep 2011 07:21:31 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=503#comment-168285</guid>
		<description><![CDATA[hi,

it&#039;s good one.

but, i want to know &quot;how many databases in that particular server&quot;?
how to know?
please post it to    [email removed]]]></description>
		<content:encoded><![CDATA[<p>hi,</p>
<p>it&#8217;s good one.</p>
<p>but, i want to know &#8220;how many databases in that particular server&#8221;?<br />
how to know?<br />
please post it to    [email removed]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Balakrishnan</title>
		<link>http://blog.sqlauthority.com/2008/02/12/sql-server-get-current-database-name/#comment-161882</link>
		<dc:creator><![CDATA[Balakrishnan]]></dc:creator>
		<pubDate>Thu, 25 Aug 2011 17:01:09 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=503#comment-161882</guid>
		<description><![CDATA[thank thank thank u]]></description>
		<content:encoded><![CDATA[<p>thank thank thank u</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mgifil</title>
		<link>http://blog.sqlauthority.com/2008/02/12/sql-server-get-current-database-name/#comment-152854</link>
		<dc:creator><![CDATA[mgifil]]></dc:creator>
		<pubDate>Tue, 02 Aug 2011 18:17:21 +0000</pubDate>
		<guid isPermaLink="false">http://sqlauthority.wordpress.com/?p=503#comment-152854</guid>
		<description><![CDATA[Grasias man me a cido util...! XD]]></description>
		<content:encoded><![CDATA[<p>Grasias man me a cido util&#8230;! XD</p>
]]></content:encoded>
	</item>
</channel>
</rss>
