Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

...

This chapter describes considerations when converting OBJECTs from MS SQL Server to ALTIBASE.

...

 

SQL Server

ALTIBASE

REMARK

Aggregate

AVG

AVG

 

CHECKSUM_AGG

N/A

 

 

COUNT

COUNT

 

 

COUNT_BIG

COUNT

 

 

GROUPING

N/A

 

 

GROUPING_ID

N/A

 

 

MAX

MAX

 

 

MIN

MIN

 

 

STDEV

Use STDDEV

 

 

STDEVP

N/A

 

 

SUM

SUM

 

 

VAR

VARIANCE

 

 

Ranking

DENSE_RANK

DENSE_RANK

 

NTILE

N/A

 

 

RANK

RANK

 

 

ROW_NUMBER

ROW_NUMBER

 

 

Conversion

CAST, CONVERT

Use CAST

CONVERT of ALTIBASE function provides other functions

 

PARSE

Use CAST

Character set can be converted by using the CONVERT function

 

TRY_CAST

Use CAST

Error returns when casting fails

 

TRY_CONVERT

N/A

 

 

TRY_PARSE

N/A

 

 

Date

CURRENT_TIMESTAMP

Use SYSDATE

 

DATENAME

DATENAME

 

 

DATEPART

DATEPART

 

 

DAY

Use DATEPART

 

 

DATEADD

DATEADD

Statement change
DATEADD (date, number, date_field_name)

Date

DATEDIFF

DATEDIFF

Statement change
DATEDIFF (startdate, enddate, date_field_name)

DATEFROMPARTS

Use TO_DATE

 

 

DATETIME2FROMPARTS

Use TO_DATE

 

 

DATETIMEFROMPARTS

Use TO_DATE

 

 

DATETIMEOFFSETFROMPARTS

Use TO_DATE

 

 

EOMONTH

Use LAST_DAY

 

 

GETDATE

Use SYSDATE

 

 

GETUTCDATE

N/A

 

 

ISDATE

N/A

 

 

SMALLDATETIMEFROMPARTS

Use TO_DATE

 

 

SWITCHOFFSET

N/A

 

 

SYSDATETIME

Use SYSDATE

 

 

SYSDATETIMEOFFSET

N/A

 

 

SYSUTCDATETIME

N/A

 

 

TIMEFROMPARTS

Use TO_DATE

 

 

TODATETIMEOFFSET

N/A

 

 

YEAR

Use TO_CHAR

 

 

Logical

CHOOSE

N/A

 

IIF

Use NVL2

 

 

Mathematical

ABS

ABS

 

ACOS

ACOS

 

 

ASIN

ASIN

 

 

ATAN

ATAN

 

 

ATN2

ATN2

 

 

CEILING

Use CEIL

 

 

Mathematical

COS

COS

 

COT

N/A

 

 

DEGREES

N/A

 

 

EXP

EXP

 

 

FLOOR

FLOOR

 

 

LOG

Use LN

LOG of Altibase provides other functions

 

LOG10

N/A

 

 

PI

N/A

 

 

POWER

POWER

 

 

RADIANS

N/A

 

 

RAND

Use RANDOM

ALTIBASE returns in integer format

 

ROUND

ROUND

 

 

SIGN

SIGN

 

 

SIN

SIN

 

 

SQRT

SQRT

 

 

SQUARE

N/A

 

 

TAN

TAN

 

 

TAN

TAN

 

 

String

ASCII

ASCII

 

CHAR

CHAR

 

 

CHARINDEX

Use INSTR, POSITION

 

 

CONCAT

CONCAT

 

 

DIFFERENCE

N/A

 

 

FORMAT

N/A

 

 

LEFT

Use SUBSTR, SUBSTRING

SUBSTR (expr, start [DOCKI:, length])
Assign a positive number to Start

 

LEN

Use LENGTH

 

 

LOWER

LOWER

 

 

LTRIM

LTRIM

LTRIM (expr1 [DOCKI:,expr2]) in ALTIBASE

 

NCHAR

NCHAR

 

 

String

PATINDEX

Use INSTR, POSITION

 

QUOTENAME

N/A

 

 

REPLACE

Use REPLACE2

 

 

REPLICATE

REPLICATE

 

 

REVERSE

Use REVERSE_STR

 

 

RIGHT

Use SUBSTR, SUBSTRING

SUBSTR (expr, start [DOCKI:, length])
Assign a negative number to Start

 

RTRIM

RTRIM

RTRIM (expr1 [DOCKI:,expr2]) in ALTIBASE

 

PATINDEX

Use INSTR, POSITION

 

 

QUOTENAME

 

 

 

REPLACE

Use REPLACE2

 

 

REPLICATE

REPLICATE

 

 

REVERSE

Use REVERSE_STR

 

 

RIGHT

Use SUBSTR, SUBSTRING

SUBSTR (expr, start [DOCKI:, length])
Assign a negative number to Start

 

RTRIM

RTRIM

RTRIM (expr1 [DOCKI:,expr2]) in ALTIBASE

 

SOUNDEX

N/A

 

 

SPACE

Use LPAD, RPAD

 

 

STR

Use TO_CHAR

 

 

STUFF

STUFF

 

 

SUBSTRING

SUBSTRING

 

 

UNICODE

N/A

 

 

UPPER

UPPER

 

 

...

The SQL Server manages the database as a data storage, but ALTIBASE HDB manages the tablespace. Tablespaces in ALTIBASE HDB are classified into memory tablespaces and disk tablespaces according to the storage space. Depending on the creator, it is classified into system tablespaces, user-defined tablespaces, dictionary tablespaces, undo tablespaces, temporary tablespaces, data tablespaces, etc.

...

ALTIBASE does not create database login and user separately but creates and manages them as a single user.

SQL Server

Code Block
languagesql
CREATE LOGIN <login_name> WITH PASSWORD = '<password>';
 
Users based on logins in master
CREATE USER user_name
    [
        { FOR | FROM } LOGIN login_name
    ]
    [ WITH DEFAULT_SCHEMA = schema_name ]
[ ; ]

ALTIBASE

Code Block
languagesql
CREATE USER <user_name> IDENTIFIED BY ‘<password>’
DEFAULT TABLESPACE = tablespace_name

...


ALTIBASE provides only BTREE and RTREE INDEX, but does not provide BITMAP, CLUSTER, Function-based, REVERSE, and Global partitioned INDEX.

The following is a conversion method for the options used in the CREATE INDEX statement when converting to ALTIBASE.

SQL Server

ALTIBASE

REMARK

UNIQUE

UNIQUE

 

CLUSTERED | NONCLUSTERED

N/A

 

ASC | DESC

ASC | DESC

 

INCLUDE

N/A

 

filter_predicate

N/A

 

partition_scheme_name

PARTITION  ON

Only Local Index is supported

ON filegroup_name

N/A

 

table_or_view_name

Table_name

View is not supported

PAD_INDEX

N/A

 

FILLFACTOR

N/A

 

SORT_IN_TEMPDB

N/A

 

IGNORE_DUP_KEY

N/A

ALTIBASE is ON

 

STATISTICS_NORECOMPUTE

N/A

ALTIBASE is OFF

DROP_EXISTING

N/A

 

ONLINE

 

ALTIBASE is OFF

ALLOW_ROW_LOCKS

N/A

Define according to Durability Level setting

ALLOW_PAGE_LOCKS

N/A

Define according to Durability Level setting

MAXDOP

PARALLEL

Apply only when creating

DATA_COMPRESSION

N/A