Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
に似た機能を@@servername作りたい。そのため、new@@mycustomnameは設定したものを返し@@mycustomname、デプロイされた T-SQL スクリプトで使用できます。
@@servername
@@mycustomname
それを行う方法はありますか?
いいえ、できません。これらは予約済みのキーワードです。
残念ながら存在しないグローバル変数とある程度同等にしたいもの。
あなたができる最善のことは、関数を宣言することです。