Click here to Skip to main content
15,886,077 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I want to insert null value in fourth column into table. my sql query is
SQL
select @loccode=LocCode from MstLocation where LocName=@location
                insert into InOutRegister values(@loccode,getdate(),convert(varchar, getdate(), 8),'',@remark)
Posted
Updated 28-May-12 23:47pm
v2
Comments
Prasad_Kulkarni 29-May-12 5:54am    
So what's the prob??

1 solution

And where is a NULL value?
Replace:
SQL
insert into InOutRegister values(@loccode,getdate(),convert(varchar, getdate(), 8),'',@remark)

with:
SQL
insert into InOutRegister (Field1, Field2, Field3, Field4, Field5) values(@loccode,getdate(),convert(varchar, getdate(), 8),NULL,@remark)
 
Share this answer
 
Comments
Sandeep Mewara 29-May-12 7:45am    
5!
Maciej Los 29-May-12 8:24am    
Thank you ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900