The FAQ list usually answers the most common questions. However, if it doesn't help write us an eMail.

Please note that FAQs on leanmail will be available soon.

 
What about sql.ini?
Empty password?
Is there a difference in the SQL Syntax?
What about different functions for Centura SQLBase and MSSQL?
Any differences concerning to Date in SQLBase or MSSQL?
Are there any things to remember when connecting to MSSQL Server inside SQLWindows/32?


What about sql.ini?

To get connected to the MS-SQLServer the sql.ini must contain the following entries:

[win32client.dll]
comdll=sqlodb32

So you activate the ODBC-router which is the native gateway to the MS-SQLServer. The database name is the DSN of the ODBC settings

Other interesting sections:

[odbcrtr]
ongbuffer=64000
remotedbname=pilo,DSN=pilodata




Empty password?

Please notice that the password for any user that connects to MS-SQLServer can not be an empty string. This is the default of the "sa"-user. So if you want to connect as "sa" change the password. But it's better to create a new user and grant him access to the desired databases instead.



Is there a difference in the SQL Syntax?

The MS-SQLServer SQL-Syntax is called Transact-SQL, which is close to ANSI standard. It is well documented and it's really worth reading the online-books. They are automatically installed with the server component.

Outer Joins
The syntax for outer joins are different in Centura SQLBase and MS-SQLServer.

Case sensitive
The names in SQLBase and SQLServer are not case sensitive.



What about different functions for Centura SQLBase and MSSQL?

Here you find a short summary of how to replace most of the used functions from the Centura SQLBase.

Connecting Strings
The string operator is different. Use "+" instead of "||".

SqlBase: select 'the name is ' || name from customers
MSSQL:   select 'the name is ' + name from customers

@Decode
The decode function is not available in Transact-SQL. Use the very powerful "case"-operator instead. It's a multi purpose converting operator.

SqlBase: select @decode(status, 1,'One', 2,'Two', 3,'Three', 'expired') from all_stati
MSSQL:   select case status when 1 then 'One' when 2 then 'Two' when 3 then 'Three' else 'expired' end from all_stati

@Nullvalue
Convert the @nullvalue function to isnull.

SqlBase: select @nullvalue(status, 'expired') from all_stati
MSSQL:   select isnull(status,'expired') from all_stati

@upper and @lower
se the upper and lower functions instead.

@Left
Use the substring function instead.

SqlBase: select @left(name,3) from customer
MSSQL:   select substring(name, 1, 3) from customer



Any differences concerning to Date in SQLBase or MSSQL?

@month and @yearno
There is a very powerful datepart function.

SqlBase: select @month(date), @yearno(date) from order
MSSQL:   select datepart(month, date), datepart(year, date), from order

What about dates < 01-01-1753?
MS SQLServer can not handle the "middleage" before 01-01-1753. When DBTrans finds a date < 1753 then it will be automatically converted to 01-01-1753. If you don't want this to be done, update your source row with the desired date.



Are there any things to remember when connecting to MSSQL Server inside SQLWindows/32

General
Read the book "Connecting Centura Objects to databases" carefully. All important things are discussed there, but not easy to find.

Autocommit
When you connect to SQLServer then autocommit is turned on by default. For normal Centura applications autocommit off should be the better alternative.

Call SqlSetParameter(hSqlWork, DBP_AUTOCOMMIT, FALSE, '')

Cursor Context Preservation
CCP is turned off by default. If you want to use this feature (normally you will)

Call SqlSetParameter(hSqlWork, DBP_PRESERVE, TRUE, '')

Isolation Level
Centura isolation levels are mapped to MS ones. Read "Connecting Centura Objects to databases" for further information. This is usual:

Call SqlSetIsolationLevel(hSqlWork, 'RL')

Result Set Mode (server side)
Result set mode is turned off by default. But server side result sets are essential to many browsing applications to scroll forward and backward. To activate this feature: Set the global variable SqlResultSet=TRUE before connecting the first cursor and for all succeding connects the resultset mode is turned on. Or

call SqlSetResultSet(hSql, TRUE) to turn it on manually.

ROWID
The virtual column rowid does not exist in MS-SQLServer. But this is often used in Centura Applications for updating smaller tables without primary key or to resolve concurred data access. For this purpose DBTrans creates a column named rowid with the datatype "timestamp". This datatype has nearly the desired behaviour as the original SQLBase rowid. In most of the cases it's not necessary to change applications!