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?
精彩评论