Skip to content

Instantly share code, notes, and snippets.

@vincent178
Created April 29, 2014 05:19
Show Gist options
  • Save vincent178/11391181 to your computer and use it in GitHub Desktop.
Save vincent178/11391181 to your computer and use it in GitHub Desktop.
declare a variable in sql server
declare @rr varchar(1000)
set @rr ='variable content'
select * from A
where A.SchoolDID = @rr
select top (1000)* from B
where B = @rr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment