﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Administering / SQL Server 2005  / database query / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Sun, 26 May 2013 03:10:13 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: database query</title><link>http://www.sqlservercentral.com/Forums/Topic686821-146-1.aspx</link><description>Hi Grant,thanks for the remark. just like Adi suggested worked for me.bryan</description><pubDate>Tue, 31 Mar 2009 05:46:30 GMT</pubDate><dc:creator>bryan van ritter</dc:creator></item><item><title>RE: database query</title><link>http://www.sqlservercentral.com/Forums/Topic686821-146-1.aspx</link><description>Hi Adi,thanks for your reply, just what i was looking for. thanks again.bryan</description><pubDate>Tue, 31 Mar 2009 05:45:46 GMT</pubDate><dc:creator>bryan van ritter</dc:creator></item><item><title>RE: database query</title><link>http://www.sqlservercentral.com/Forums/Topic686821-146-1.aspx</link><description>As the last post showed, @@ServerName gets you the name of the server, DB_NAME() gets you the current database. If you pass it a database ID, it will get any other database name.</description><pubDate>Tue, 31 Mar 2009 04:59:04 GMT</pubDate><dc:creator>Grant Fritchey</dc:creator></item><item><title>RE: database query</title><link>http://www.sqlservercentral.com/Forums/Topic686821-146-1.aspx</link><description>It isn’t very clear what you want to do.  Do you want to get a list of databases in the instance?  If this is what you want you can use this query:[code]select @@servername, name from master.sys.databases[/code] If you want something else, pleas specify.Adi</description><pubDate>Tue, 31 Mar 2009 04:08:41 GMT</pubDate><dc:creator>Adi Cohn-120898</dc:creator></item><item><title>database query</title><link>http://www.sqlservercentral.com/Forums/Topic686821-146-1.aspx</link><description>hello,i'am trying to create a query which gives me back the database name and the instancename of that particular database and put all of this in a table. can someone help me with this issue.kind regard,bryan</description><pubDate>Tue, 31 Mar 2009 03:52:36 GMT</pubDate><dc:creator>bryan van ritter</dc:creator></item></channel></rss>