Skip to content

Instantly share code, notes, and snippets.

@ritasker
Created July 12, 2013 08:46
Show Gist options
  • Save ritasker/5982886 to your computer and use it in GitHub Desktop.
Save ritasker/5982886 to your computer and use it in GitHub Desktop.
How to declare and use a SQL variable
DECLARE @UserId as int
SET @UserId = 8521
DELETE FROM UserAudits WHERE UserFk = @UserId
DELETE FROM Users WHERE Id = @UserId
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment