Question: How can I set resultset value to local variable or output parameter in procedure..

For below.

```
UPDATE TOP (1) certificate WITH (ROWLOCK,READPAST,UPDLOCK) 
SET issued = 1 
OUTPUT INSERTED.certid, INSERTED.certiname
WHERE  issued = 0 AND year = 2011 

```

Answer: 
Since you're just updating a single row, try this:

```
DECLARE @certid INT
DECLARE @certinname VARCHAR(MAX) -- or whatever
UPDATE TOP (1) certificate WITH (ROWLOCK,READPAST) 
SET issued = 1, @certid = certid, @certinname = certinname
WHERE  issued = 0 AND year = 2011
SELECT @certid, @certinname

```
```
DECLARE @certid INT
DECLARE @certinname VARCHAR(MAX) -- or whatever
UPDATE TOP (1) certificate WITH (ROWLOCK,READPAST) 
SET issued = 1, @certid = certid, @certinname = certinname
WHERE  issued = 0 AND year = 2011
SELECT @certid, @certinname

```