开发者

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

开发者 https://www.devze.com 2023-03-25 07:39 出处:网络
I have come across the following example code: EXECUTE msdb.dbo.sysmail_add_profileaccount_sp @profile_name = @\'SQL mail profile\',

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 tha开发者_开发技巧t 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.


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 @.


I get a syntax error with that, so I don't think it means anything except that it's not valid syntax. Did you pull that from valid T-SQL that is being called using just T-SQL, or perhaps this is parameterized stuff coming from some other language or program?

0

精彩评论

暂无评论...
验证码 换一张
取 消