<?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>topic How to run oSQL queries in Server Management - Systems Insight Manager</title>
    <link>https://community.hpe.com/t5/server-management-systems/how-to-run-osql-queries/m-p/3362484#M5402</link>
    <description>Can someone help me figure out what basic tsql commands I should be using to transpose "Show SQL Queries" sample output from SIM console, to execute properly from CLI osql.exe MSDE tool?&lt;BR /&gt;&lt;BR /&gt;I figure this is what is required:&lt;BR /&gt;1-"USE databasename"&lt;BR /&gt;2-cut'n'pasted query command&lt;BR /&gt;3-"GO" command&lt;BR /&gt;&lt;BR /&gt;How can we figure out what database name to use, and am I missing anything in the above recipe?&lt;BR /&gt;&lt;BR /&gt;Thanks!</description>
    <pubDate>Sat, 21 Aug 2004 10:42:58 GMT</pubDate>
    <dc:creator>Daniel Caron_3</dc:creator>
    <dc:date>2004-08-21T10:42:58Z</dc:date>
    <item>
      <title>How to run oSQL queries</title>
      <link>https://community.hpe.com/t5/server-management-systems/how-to-run-osql-queries/m-p/3362484#M5402</link>
      <description>Can someone help me figure out what basic tsql commands I should be using to transpose "Show SQL Queries" sample output from SIM console, to execute properly from CLI osql.exe MSDE tool?&lt;BR /&gt;&lt;BR /&gt;I figure this is what is required:&lt;BR /&gt;1-"USE databasename"&lt;BR /&gt;2-cut'n'pasted query command&lt;BR /&gt;3-"GO" command&lt;BR /&gt;&lt;BR /&gt;How can we figure out what database name to use, and am I missing anything in the above recipe?&lt;BR /&gt;&lt;BR /&gt;Thanks!</description>
      <pubDate>Sat, 21 Aug 2004 10:42:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/server-management-systems/how-to-run-osql-queries/m-p/3362484#M5402</guid>
      <dc:creator>Daniel Caron_3</dc:creator>
      <dc:date>2004-08-21T10:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to run oSQL queries</title>
      <link>https://community.hpe.com/t5/server-management-systems/how-to-run-osql-queries/m-p/3362485#M5403</link>
      <description>I use OSQL as it's a bit better.&lt;BR /&gt;I also put the Select Query into a separate file.&lt;BR /&gt;&lt;BR /&gt;Typically you need the following:&lt;BR /&gt;&lt;BR /&gt;osql -S YourSQLServer -U UserAccount -P Password &lt;BR /&gt;-d INSIGHT_v1_0_15758423 -w 132 -n -h-1 &lt;BR /&gt;-i d:\Server_Description.osql &lt;BR /&gt;-o d:\Server_Description.txt&lt;BR /&gt;&lt;BR /&gt;You can often replace the -U and -P construct with -E (no paramaeters) if it is being triggered from a suitable privileged account.&lt;BR /&gt;&lt;BR /&gt;My Input file would look something like:&lt;BR /&gt;&lt;BR /&gt;SET NOCOUNT ON&lt;BR /&gt;go&lt;BR /&gt;select etc. etc.&lt;BR /&gt;go&lt;BR /&gt;quit</description>
      <pubDate>Sun, 22 Aug 2004 15:39:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/server-management-systems/how-to-run-osql-queries/m-p/3362485#M5403</guid>
      <dc:creator>Rob Buxton</dc:creator>
      <dc:date>2004-08-22T15:39:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to run oSQL queries</title>
      <link>https://community.hpe.com/t5/server-management-systems/how-to-run-osql-queries/m-p/3362486#M5404</link>
      <description>#1- After a bit of research, I found out that we can first locate the Insight Manager database name by issueing the following:  osql -E -dmaster -Q"select * from sysdatabases"&lt;BR /&gt;&lt;BR /&gt;#2- Then, use that variable database name in an osql command with -U -P options, or -E if currently admin priveleges, and -Q option with cut'n'pasted SQL query withint double-quotes, such as in :&lt;BR /&gt;&lt;BR /&gt;osql -E -dInsight_v1_0_222955644 -Q "select R_Inventory.DeviceName, R_Inventory.ProductType, R_Inventory.ProductName, R_Inventory.SerialNumber, R_Inventory.OSName from R_Inventory WHERE ((R_Inventory.SnapShotID=-1) OR (R_Inventory.SnapShotID is NULL)) AND DeviceKey in (select devices.deviceKey from devices JOIN notices ON devices.deviceKey = notices.deviceKey and notices.NoticeType = 1 JOIN consolidatedNodeAuths ON devices.mxGuid = consolidatedNodeAuths.NodeId and consolidatedNodeAuths.userID = '00000000864162de0000000400000006' WHERE ( ( devices.productType = 1) ) ) order by R_Inventory.DeviceName ASC"&lt;BR /&gt;</description>
      <pubDate>Mon, 23 Aug 2004 08:57:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/server-management-systems/how-to-run-osql-queries/m-p/3362486#M5404</guid>
      <dc:creator>Daniel Caron_3</dc:creator>
      <dc:date>2004-08-23T08:57:09Z</dc:date>
    </item>
  </channel>
</rss>

