Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 What the @!

Author  Topic 

Lionheart
Starting Member

41 Posts

Posted - 2009-01-23 : 15:53:51
I am trying to decifer some code, and I have the following statements in there: -

if @Flv


and

Declare @NonUse


What do the @'s mean?

Thx

revdnrdy
Posting Yak Master

220 Posts

Posted - 2009-01-23 : 16:01:15
The @ symbols mean that those are variables.

@Flv
@NonUse

DECLARE @NonUse varchar(20) --Declare the variable NonUse
SET @NonUse = 'Hello' --Set the variable @NonUse to 'Hello'

PRINT @NonUse --Will print hello to the screen.

Really though this is something you could have easily looked up.

r&r
Go to Top of Page

rohitkumar
Constraint Violating Yak Guru

472 Posts

Posted - 2009-01-23 : 16:01:42
thats how you define local variabes in T-SQL

http://msdn.microsoft.com/en-us/library/ms187953.aspx
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-01-23 : 16:01:51
It signifies a variable. @var1 is a local variable and @@var1 is a global variable.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-01-23 : 16:02:09
Wow, sniped twice!

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-24 : 08:50:44
@ also can be used to denote parameters in procedures and user defined functions. Also if in context of xml xpath queries, @ is used to represent attributes inside xml
Go to Top of Page
   

- Advertisement -