<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Database Name in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/database-name/qaa-p/7652675#M2743119</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Of course you can make the 2 commands independent. Don't link them... I can't imagine what you'd be linking them on to begin with.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As Sharon pointed out, a simple command written like...&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT @@SERVERNAME AS ServerName, DB_NAME() AS DatabaseName
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;will only return a single row, so now need to worry about creating a Cartesian product with 2 unlinked commands.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not aware of any special fields that will nativity pull in the db or server names.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jason&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Feb 2011 21:09:33 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-02-23T21:09:33Z</dc:date>
    <item>
      <title>Database Name</title>
      <link>https://community.sap.com/t5/technology-q-a/database-name/qaq-p/7652673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm designing a series of reports that are to run against a number of databases (not all at once, just one at a time). Each database has the exact same structure, so it's just a matter of changing the datasource location. The issue that I'm having is that we need to have the name of the database included on the report itself. I don't want to add it as a parameter, as that would open it up to human error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are two possible solutions that I can see, but I'm having trouble getting them working...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first possible solution is to get the database via an sql query. The report already had 1 command to query the data for the report... I've added a second command that queries the name of the database from the MS SQL server. This works fine, unless the main report command returns 0 rows. When that happens, the second command that gets the db name also returns 0 rows, leaving the field blank.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, is there some way to make commands independant, to ensure that one command always returns results, depite the second command returning zero rows? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second potential solution is the one that I'm hoping will be possible. I know that there are a number of special fields for each report. (recordcount, etc. ) Is there some way to natively display the name of the database used?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd appreciate any help that anyone could offer. Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Scott&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Feb 2011 20:08:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/database-name/qaq-p/7652673</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-23T20:08:55Z</dc:date>
    </item>
    <item>
      <title>Re: Database Name</title>
      <link>https://community.sap.com/t5/technology-q-a/database-name/qaa-p/7652674#M2743118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i know i sql in sp you can put &lt;/P&gt;&lt;P&gt;DB_NAME()   as a field and it will display the database it is connected to&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;see if in the comand file it works the same.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Feb 2011 20:31:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/database-name/qaa-p/7652674#M2743118</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-23T20:31:18Z</dc:date>
    </item>
    <item>
      <title>Re: Database Name</title>
      <link>https://community.sap.com/t5/technology-q-a/database-name/qaa-p/7652675#M2743119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Of course you can make the 2 commands independent. Don't link them... I can't imagine what you'd be linking them on to begin with.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As Sharon pointed out, a simple command written like...&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT @@SERVERNAME AS ServerName, DB_NAME() AS DatabaseName
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;will only return a single row, so now need to worry about creating a Cartesian product with 2 unlinked commands.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not aware of any special fields that will nativity pull in the db or server names.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jason&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Feb 2011 21:09:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/database-name/qaa-p/7652675#M2743119</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-23T21:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: Database Name</title>
      <link>https://community.sap.com/t5/technology-q-a/database-name/qaa-p/7652676#M2743120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Scott,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Add a SQL Expression, please note, you can NOT use SQL Expressions if you have more than one data source, and type in:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DB_NAME() &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then drop that expression in the report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;Don&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Feb 2011 23:57:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/database-name/qaa-p/7652676#M2743120</guid>
      <dc:creator>former_member11696</dc:creator>
      <dc:date>2011-02-23T23:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: Database Name</title>
      <link>https://community.sap.com/t5/technology-q-a/database-name/qaa-p/7652677#M2743121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's an even better idea Don!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Feb 2011 15:23:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/database-name/qaa-p/7652677#M2743121</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-24T15:23:46Z</dc:date>
    </item>
    <item>
      <title>Re: Database Name</title>
      <link>https://community.sap.com/t5/technology-q-a/database-name/qaa-p/7652678#M2743122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thianks for all your help, everyone. Don's solution worked amazingly. Thanks again!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Scott&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Feb 2011 15:49:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/database-name/qaa-p/7652678#M2743122</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-24T15:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: Database Name</title>
      <link>https://community.sap.com/t5/technology-q-a/database-name/qaa-p/7652679#M2743123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I learn something new every day!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Feb 2011 17:36:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/database-name/qaa-p/7652679#M2743123</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-24T17:36:41Z</dc:date>
    </item>
  </channel>
</rss>

