Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 10045

How to create and pass local variables in SP

$
0
0

Hi all,

i need to create local variables called year and testid..both of int datatype.

in sp ..where condition how can i use these local variables

like how the syntax would be?

testid comes from tabel test and testid should be taken per year and testtype

should i take testtype also as local variable..

my syntax  should look as,while declaring loacl var's:

DECLARE @testID int

SET     @testID = (SELECT Id FROM test WHERE Year=@Year andtesttype=@testtype);and how can i use this inwhere clause..


lucky


Viewing all articles
Browse latest Browse all 10045

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>