Я плохо разбираюсь в t-sql, поэтому мне нужна помощь.
У меня есть этот код, который я написал сам, но как написать, что я хочу, я не знаю (и извините за английский)
declare @questionid int
set @questionid = 22
declare @providerid int
set @providerid = 189
select [closed] into #question from [Data].[dbo].[Question] where [questionid] = @questionid
-- and here, if [closed] is null I must write in the question table current date GETDATE()
UPDATE [Data].[dbo].[Question] SET [closed] = GETDATE() WHERE [questionid] = @questionid and [providerid] = @providerid
-- or, if [closed] is not null I must write there null
UPDATE [Data].[dbo].[Question] SET [closed] = null WHERE [questionid] = @questionid and [providerid] = @providerid
drop table #question
Как я могу это сделать?