SQL Server Ansi_null_default | ansi_null_dflt_on

Source: Internet
Author: User
Tags set set

Let's start by saying that these two variables are a meaning, but their scope is different.

ALTER DATABASE dbTest set ANSI_NULL_DEFAULT on; -This is scoped to the entire SQL Server database!

Set set ANSI_NULL_DFLT_ON on; -The scope of this is the current connection!

* * Note that the names of these two variables are not the same!

Example:

1:create database dbTest;

2:alter database dbTest set ansi_null_default_on off;

3:create table t (x int, y int);

4:insert into t (x, Y) VALUES (null,null); --Because the 2nd step sets the option to off so there will be an error here!

     

  

  

SQL Server Ansi_null_default | ansi_null_dflt_on

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.