Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

query on empty data and null dat

$
0
0

i have two tables dept (parent table){<DEPTNO (PK),DNAME,LOC>}; emp table (child table){EMPNO (PK),ENAME......MGR_ID(REFERENCE KEY WITH EMPNO).....DEPTNO}; in child table it has <MGR_id> with self referential intigrity with <empno>(PK); when i am inserting data into mgr_id column it accepts NULL values but it doesn't accept EMPTY values ; WHY AND WHAT IS THE REASON ?

insert into emp(...........,mgr_id) values (.....,null)                --it accpts 

insert into emp (...........,mgr_id) values (.....,'')                  --here doen't accept 

and also i want know what is the difference between null and empty valu in sql server 


Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>