How to connect to the SQL Server 2012 R2 Database (External Database)

  • 17 February 2015
  • 4 replies
  • 8 views

Badge +1

Hi All,

 

We have a separate virtual machine where we are storing database.


For an application that I'm working on, I need to establish connection to an external database, which resides one of the virtual machine.


Can anyone guide me as to how do I proceed with the same?

 

How can I connect to the other databases which I'm having in my network?

 

Thanks a lot in advance.

 

Regards,

Nish Shah

 


4 replies

Userlevel 1
Badge +8

Hi NishShah

 

You will need to create a "SQL Server Service" Service Instance and connect it to your SQL Server database.  You can do this via the K2 management workspace or the SmartObject tester (my preferred method). Once this is done you can then create SmartObjects to perform actions against this database (i.e. CRUD procedures).

 

The SQL server will need to be on the same network as your K2 server, and you will need to grant the K2 service account appropriate permissions on the database so that it can connect and read the database schema.

 

Have a look at the following

 

http://help.k2.com/onlinehelp/k2blackpearl/userguide/current/webframe.html#SQL106.html

 

http://help.k2.com/onlinehelp/k2blackpearl/userguide/current/webframe.html#how_to_configure_the_service_instance.html

 

For a more detailed look at SmartObjects and Service Instances have a look at the K2 learning modules

 

http://help.k2.com/displaycontent.aspx?id=4515

Badge +1

Hi @Andrew_Blinco,

 

Thanks a lot for your help.

 

I have tried 'n' number of times via SmartObject Tester to add a SQL Service Instance. But I'm getting different different errors.

 

  • Login Failed
  • Connection Timeout
  • Login Failed (Due to Wait)
  • Login Failed (Due to Certification Issues)

Is it necessary to create a K2 Service Account on my other machine?

 

I'm using "Static Aunthentic Mode" to log in into the other machine.

 

Please let me know if I'm on wrong track.

 

Thanks again.

 

Regards,

Nish Shah

 

 


11067i2A7CF7F2FC9B8C2E.jpg
Userlevel 1
Badge +8

Hi NishShah

 

I am assuming the VM running the SQL server is connected to your network (otherwise K2 will not be able to find it)?

 

For the authentication mode I suggest you try either the Service Account or Impersonate. Either way the account that you use will need to have a login to the SQL Server  (using Windows Authentication)  and read access to the database (db_reader ).

Badge +1

Hi Andrew_Blinco,

 

I found a solution to it.

 

  1. Start SmartObject Service Tester.exe (%InstallationFolder%in)
  2. Created a SQL Service Instance
  3. Selected a Static Authentication Mode (SQL Authentication Mode)
  4. Enter your Database name (eg. EmplyoeeDB)
  5. Enter your Server Name (eg. XYZ)
  6. On Different SQL Server = True (if not in the same network, my Database VM is on Azure)
  7. Click Next
  8. Give appropriate name to the service you are willing to create
  9. Click Add

Note: SQL Service Creation Time is directly propotional to Number of tables in the Database. (More number of tables will take more time to create it). After clicking add button, wait for K2 to complete it task. Moreover your add window will be in the Not Responding Stage.

Reply