sql - How to insert a null value to the database? -
my query doesn't work. says there syntax error near null keyword. dont know how fix it. want insert empty string or null database. how can it?
query
insert [remarks] values((select top 1 ref_no a_master order ref_no desc ), (select top 1 current_dept a_master order ref_no desc ),'630590', getdate()), null
inner queries work without error.
you miss placed close brackets,it should this..
insert [remarks] values((select top 1 ref_no a_master order ref_no desc ), (select top 1 current_dept a_master order ref_no desc ),'630590', getdate(), null)
in query u referred same table twice 2 column.
you can write like..
insert [remarks] select top 1 ref_no,curent_dept '630590',getdate(),null a_master order ref_no desc
since both columns same table..
Comments
Post a Comment