Variable with Declare

Avatar
  • updated
  • Completed
Hello,
how is it possible to declare variables?
I tried this one, but there was no result:

DECLARE @BLZ As varchar(5) = '35024' ;
Select
Konto.Bankleitzahl,
Konto.Kontonummer
From
Konto
Where
Konto.Bankleitzahl = @BLZ
Avatar
Anonymous
Hello,
You can try to run this query by pressing the Ctrl button when clicking the Execute button, or simply by pressing the Ctrl+F5 keys.

Also there's another way to define parameters. Remove the DECLARE statement and replace the "@" symbol with ":" like this:

Where Konto.Banklezahl = :blz

You will be propmted for parameter value on executing the query.
Avatar
Christian Meier
Works perfekt, many thanks :)