Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 sql server global variables

Author  Topic 

TajKazi
Posting Yak Master

101 Posts

Posted - 2014-10-21 : 05:25:27
can we declare global table variables in sql server .that we can use in different procedures....

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2014-10-21 : 08:44:35
Short answer: No.

Now, tell us what you really want to do and let's see if we can find a way. e.g. how about a table holding the variable values that each proc uses?
Go to Top of Page

TajKazi
Posting Yak Master

101 Posts

Posted - 2014-10-21 : 23:38:53
I have one problem .... suppose there are two procedures A and B. in A I calling B. while in B I am committing transaction, but in A ..I am rollbacking transaction.
problem is when A gets rollbacks B also rollbacks...
that should happen

is it possible
Go to Top of Page

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2014-10-22 : 09:23:13
that's correct. B happens in the context of the transaction started (and subsequently rolled back) in A
Go to Top of Page

TajKazi
Posting Yak Master

101 Posts

Posted - 2014-10-27 : 02:02:22
is there any other solution for B does not get rollbacked
is there then hows it?
Go to Top of Page

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2014-10-27 : 08:42:51
A and B would need to be independent.
Go to Top of Page

TajKazi
Posting Yak Master

101 Posts

Posted - 2014-10-28 : 00:17:44
okay...... thanks for reply
Go to Top of Page
   

- Advertisement -