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 does @ mean in sql

Author  Topic 

jatrix32
Starting Member

49 Posts

Posted - 2010-09-22 : 14:32:49
Im trying to figure out what this means in someone's code: @messageBatchKey
I have never seen the @ in sql before, what is it?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-09-22 : 14:41:41
It's a variable.

DECLARE @s varchar(10)

SET @s = 'tkizer'

PRINT @s

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

Subscribe to my blog
Go to Top of Page

jatrix32
Starting Member

49 Posts

Posted - 2010-09-22 : 14:54:30
thank you
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-09-22 : 14:56:55
You're welcome, glad to help.

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 - 2010-09-23 : 12:39:55
If its a SP or UDF it can even represent a parameter

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-09-23 : 12:46:23
Parameters are variables, so no difference there.

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

Subscribe to my blog
Go to Top of Page
   

- Advertisement -