Skip to Content

Run native SQL from DBACockPit using a DBCON to external SQL Server

Hi,

I have set up a connection to an external MS SQL Server using to DBCO and tested the connection works fine.

I would like to be able to execute native SQL statements against this external DBCON connection from the SQL Command Editor within DBACockPit for testing purposes. However not sure if this is possible as I am the guessing the DBCON mechanism may need the ABAP stack to work ??

If it is possible I would greatly appreciate help with the syntax. ie select * from MYDBCON.MYTABLE etc

Many thanks for any assistance.

Alex

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on May 06, 2015 at 04:57 PM

    Hello Alex,


    You need an ABAP stack to use DBACockpit.
    Are you able to run transaction DBACockpit?

    Regards,

    Eduardo Rezende
    SAP Support

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Eduardo,

      Great links thks. Yes sorry if my initial description wasn't clear but the challenge was to try and find a method to build native cross database queries quickly and easily from within the DBACockpit for testing data structures before building into a program. In this case I wanted to join SAP transparent tables with legacy data stored in external SQL database on another machine.

      Linked server proved a good solution and easy to set up from DBACockpit! In case it helps anyone :

      Execute the following commands from within SQL Command Prompt of DBACockpit to set up the linked server for external SQL DB (note use dbo schema not the SAP schema) :

      EXEC HCD.dbo.sp_addlinkedserver @server = N'myLinkedServerName', @srvproduct=N'SQLSERVER', @provider=N'SQLNCLI', @datasrc=N'mySQLServer', @catalog=N'myDB'

      Set up the security for linked server :

      EXEC HCD.dbo.sp_addlinkedsrvlogin @rmtsrvname=N'myLinkedServerName',@useself=N'False',@locallogin=NULL,@rmtuser=N'myUserName',@rmtpassword='########'

      Then execute some native SQL to access the linked server :

      SELECT * FROM [myLinkedServerName].myDB.dbo.myTable

      and join against local SAP tables if required ...

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.