Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In T-SQL under MS SQL Server 2008, what does '@' mean in front of a parameter *value* that's a string literal?

I have come across the following example code:

EXECUTE msdb.dbo.sysmail_add_profileaccount_sp        
                            @profile_name = @'SQL mail profile',        
                            @account_name = @'account name',        
                            @sequence_number = 1 ;     

What does '@' mean in front of the string literal, as in the example above:

@account_name=@'account name'

I understand that my question may stand true for any executable module's parameters in T-SQL, or maybe for any string literal in T-SQL in general, so the above is just a concrete example of what I'm looking at.

like image 802
dawebber Avatar asked Aug 02 '11 19:08

dawebber


1 Answers

I do not think that this is valid T-SQL. This may be an artifact of replacing variables with values somewhere in a script and not trimming the leading @.

like image 103
hspain Avatar answered Oct 11 '22 15:10

hspain