Previous Topic

Next Topic

Inhoudsopgave

Book Index

Insert Statements And Column Defaults

If all columns have a default value, the following statement is allowed in ASE.

insert into table_name values ()

In MS SQL Server, it is not allowed to have an empty values list. However, you have the option to use the statement below instead.

insert into table_name default values

Example

create table Test (i int default 1, c char default '?')

-- Use one of the statements below

--insert into Test values () – ASE

--insert into Test default values -- MS SQL Server

select * from Test

drop table Test

Remark

If not all columns have a default value, both dialects of T-SQL have the same syntax.

create table Test (i int, c char default '?')

insert into Test (i) values (1)

select * from Test

drop table Test