Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Accessing MS SQL Database using DBCON

Former Member
0 Likes
1,773

Hi,

We are having a problem when we try to connect to a table on MS SQL Server using DBCON.

We have done the config. We also have the program as per OSS note. It is giving a return code of 4 after 'Connect to'.

I think, our configuration information is incorrect. There is no documentation on what the parameters should be for MS SQL. Can some one help us?

We tried this with the following:

1) <server>

2) tcp:<server>

3) MSSQL_SERVER=<server>

4) MSSQL_SERVER=<server> MSSQL_DBNAME=<databae>

5) MSSQL_SERVER=tcp:<server>

6) MSSQL_SERVER=tcp:<server> MSSQL_DBNAME=<database>

7) np:<server>

Thanks

Venkatesh

9 REPLIES 9
Read only

Former Member
0 Likes
1,285

Friends,

It worked. The parameter should be MSSQL_SERVER=tcp:<server>\<host> MSSQL_DBNAME=<database>

Regards

Venkatesh

Read only

0 Likes
1,285

Has anyone managed to achieve this over a remote (internet) connection ? In other words where the SQL server is not on the same LAN as the apps server

What are the parameters required for MSSQL_SERVER = ??

Read only

0 Likes
1,285

Hello,

I have tried this and it did not work for me. Please advise. Here is a sample of what I tried.

report zdbcon .

data: dbn(128).

EXEC SQL.

CONNECT TO 'DAN1'

ENDEXEC.

EXEC SQL.

SET CONNECTION 'DAN1'

ENDEXEC.

EXEC SQL.

SELECT db_name() INTO :DBN FROM SVERS

ENDEXEC.

write: / 'current database name', dbn.

DAN1 is an entry in DBCON with these enteries

CON NAME DAN1

DBMS MSS

USER NAME iis_log

PASSWORD

CON ENV

MSSQL_SERVER=tcp:###.###.#.### MSSQL_DBNAME=iislog

DB RECO

Read only

0 Likes
1,285

I resolved my own issue. There was a DLL that i was missing for the version of oracle that I am on. I found the message through OSS.

Read only

0 Likes
1,285

Hi,

I'm having the same issue as you had, but can you please specify, what should be servername/hostname like?

In the fact, I don't really get the difference between server and host....I'd be grateful for an example...

Thanx

Peter

Read only

0 Likes
1,285

Peter,

You must first ensure that everything on the basis side is set up correctly. All I was really missing was the DLL.

For Server name. The entry is and IP address.

Ex: MSSQL_SERVER=122.456.3.123 MSSQL_DBNAME=IISLOG

The above should be your entry for con env in the DBCON tablle.

Let me know if that helpd any.

Read only

0 Likes
1,285

Hi Rashid,

I was more pointing at message from Venkatesh, he put syntax <server>/<host> in a place, so I wanted to try it also.

But, actually you were right about the basis. The .DLL was installed already , but its version differed from SAP kernel version. Although it was newer, in a trace I still got error about version difference.

Thanks,

Peter

Read only

0 Likes
1,285

No problem Peter.

Read only

Former Member
0 Likes
1,285

Hi Guys

I am trying to use the same parameters to connect to SQlserver through SAP.

I am unable to connect. What is the hostname to be given in tcp:<server>\<host>

Also when i execute the command CONNECT TO 'ICSQL', it takes atleast 1 minute before it returns an error of sy-subrc = 4.

Please help.

Raj