﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Future Versions / SQL 12  / Adding Global and Scope Variables / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Mon, 20 May 2013 14:51:43 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Adding Global and Scope Variables</title><link>http://www.sqlservercentral.com/Forums/Topic1180614-2800-1.aspx</link><description>I can see many uses for it.  I can also see the two at sign notation carring on the "tradition" of temp tables.Conversly would name spaces be better for this?@session.myusername = 'Buford H. Pusser'@server.panicphone = '202-456-1414'Who gets to set server variables?  Who gets to change them?  When they get changed when do I see the effect of the change?</description><pubDate>Thu, 27 Sep 2012 06:53:43 GMT</pubDate><dc:creator>Charles Kincaid</dc:creator></item><item><title>Adding Global and Scope Variables</title><link>http://www.sqlservercentral.com/Forums/Topic1180614-2800-1.aspx</link><description>There must be an life saving global variables to use per connection like:DECLARE @@MYVAR1 BIGINTDECLARE @@MYVAR2 VARCHAR(30)SET @@MYVAR1 = 123456SET @@MYVAR2 = 'Username'So we can use it to pass or use them anywhere on the sql server.For eg: When a user opens my application, I'll pass @@MYVAR1 and @@MYVAR2.Then I'll assign fields default value to @@MYVAR1 and @@MYVAR2 so I never ever need to pass extra params from application to stored procedures or queries to save them in tables. Also this is very useful if you want to do table or record security works.</description><pubDate>Sun, 25 Sep 2011 04:36:46 GMT</pubDate><dc:creator>wshmstr</dc:creator></item></channel></rss>