views:

56

answers:

0

I'm debugging a stored procedure via SSMS 2008. I have a uniqueidentifier variable that gets assigned from a select statement. I want to change its value while I'm debugging to NULL after the assignment.

I can change the value to a different guid, but I cannot change it null. I've tried changing the value to NULL, 'NULL', (NULL), [NULL]...nothing works. I always get: "The value could not be set. Please check your entry.

I've also tried Ctrl+0, which works when editing rows elsewhere in SSMS, but not in the Locals window.

Example:

DECLARE @foo uniqueidentifier;
SELECT @foo = foo FROM bar;

/*Force @foo to NULL here via SSMS debugger. How do I do it in the Locals window?*/

IF @foo IS NULL
BEGIN
    --etc...
    PRINT '@foo is null!'
END

EDIT:

I want to do this in the debugger, not in code. This isn't a show stopping issue. I know I can modify the stored procedure and assign the variable NULL. That's not what I'm asking. I'm asking if there is a way to do so without doing this. Can I use the Locals, Watch, or Command Windows to assign the variable NULL?