show-notice
hide-notice

Wednesday, 17 July 2013

hoe to use default operator in sql server


Introduction

To specify the default value in a SQL statement, when creating the column, before the semi-colon or the closing parenthesis of the last column, assign the desired value to the DEFAULT keyword.

Example
CREATE TABLE Employees
(
    FullName VARCHAR(50),
    Address VARCHAR(80),
    City VARCHAR(40),
    State VARCHAR(40) >DEFAULT = 'NSW',
    PostalCode VARCHAR(4) DEFAULT = '2000',
    Country VARCHAR(20) DEFAULT = 'Australia'
);
GO
 

SHARE THIS POST   

0 comments :

Post a Comment

Design by Gohilinfotech | www.gohilinfotech.blogspot.com