SQL Server problem with Null values
|
Hi, I'm using SQL Server2000 and in one of my stored procedures I have used dynamic SQL
can someone please help me with updating a table that has null values in some of fields? I've used the following peice of dynamic sql in a stored procedure and this works fine
set @ssql = 'update [TI_Work] set ['+ @sEin +']' + ' = '''+ @sArea +''' where [date1] between ''' + @sDateFrom + ''' and ''' + @sDateTo + ''' '
exec (@ssql)
the problem I have is some of the fields have a null value in them, these I don't want to update, the SQL I've tried below doesn't work, can anyone help?
set @ssql = 'update [TI_Work] set ['+ @sEin +']' + ' = '''+ @sArea +''' where [date1] between ''' + @sDateFrom + ''' and ''' + @sDateTo + ''' and ['+ @sEin +']' + is not isnull'
exec (@ssql)
|
__________________
Bumshanka - May the seed of your loins be fruitful in the belly of your woman - The Young Ones
|