WarcraftPlayer
MIS
I am not sure going about doing this. In my proc I need to update a table the only thing is sometimes its a single update and other times it is a multiple update so basically I need to merge these 2 togther and am not quite sure how to do it.
Both of these queries work seperate but when I try to merge them with a where clause or When I get an error
I want something like this, I know this doesnt work at least not the way I have it.
The variable @Customerid gets passed in and if does not get passed in it means there are mulitple people to update.
Thanks in advance.
Code:
update tableA Set CustomerInfo = Getdate() Where customerid = @CustomerID
update tabelA Set CustomerInfo = Getdate() From tableB where LotsOfCustomers = 'Multiple'
I want something like this, I know this doesnt work at least not the way I have it.
Code:
UPDATE TableA SET CustomerInfo = GetDate()
FROM TableB
WHERE CASE WHEN @CustomerID IS NOT NULL THEN Customerid = @Customerid
ELSE
LotsOfCustomers = 'Multiple'
END
The variable @Customerid gets passed in and if does not get passed in it means there are mulitple people to update.
Thanks in advance.