| Author |
Topic  |
|
|
mmkrishna1919
Yak Posting Veteran
India
54 Posts |
Posted - 08/27/2012 : 05:57:13
|
Hi All, I created an temporary table
create table #t_inner( customer_id INT NOT NULL primary key ,name varchar(10) )
Now i am going to insert a row into that table with the below query. insert into #t_inner values(2,'ms sql server')
i get the EStimated execution plan for the above insert query i got below text in the argument section.
Argument:
|--Clustered Index Insert(OBJECT:([tempdb].[dbo].[#t_inner______000000035851].[PK__#t_inner__1C5B9100]), SET:([#t_inner].[customer_id]=RaiseIfNull(2),[#t_inner].[name]=RaiseIfNull('ms sql server'))
what is the functionality of "RaiseIfNull()" function in the above argument,And how this query paln check the uniqueness and null value check for the primary key column (customer_id)?
Thanks...
M.MURALI kRISHNA |
|
|
chadmat
The Chadinator
USA
1958 Posts |
Posted - 08/28/2012 : 02:22:24
|
This is not really documented anywhere, but I am pretty sure it is the function called that checks if the value is null, and raises an error if it is null and the column is not nullable.
-Chad |
 |
|
|
mmkrishna1919
Yak Posting Veteran
India
54 Posts |
Posted - 08/28/2012 : 06:08:30
|
Hi Chadmat,
Thanks alot for your reply, From ur words let us assume that Raiseifnull() function is used to test nullabulity of an data going to insert into key column.
Then how can our query plan(from argument section of execution plan) check whether we are entering Duplicate data values or unique values into key column?
Regards
M.MURALI kRISHNA |
 |
|
|
chadmat
The Chadinator
USA
1958 Posts |
Posted - 08/28/2012 : 13:16:10
|
[PK__#t_inner__1C5B9100] is the PK (Unique) constraint I believe.
-Chad |
 |
|
| |
Topic  |
|