April 8, 2015 at 1:28 am
Hi I ned to do some operations on a table when any user dont work with it.
How do i do it?
Do i lock the table? and is it possible?
April 8, 2015 at 1:34 am
MotivateMan1394 (4/8/2015)
Hi I ned to do some operations on a table when any user dont work with it.How do i do it?
Do i lock the table? and is it possible?
Quick suggestion, DENY Object Permissions
😎
April 8, 2015 at 1:44 am
Yes It's a solution
but our web site is a busy web site . is this possible for it? If user select to a table that dosnt have permission , create error and this is not good solution.
in the other hand.
we have only one user on site
and we like to do this with the same user.
thank you
April 8, 2015 at 1:53 am
MotivateMan1394 (4/8/2015)
Hi I ned to do some operations on a table when any user dont work with it.How do i do it?
Do i lock the table? and is it possible?
What do you mean by 'operations'?
The absence of evidence is not evidence of absence.
Martin Rees
You can lead a horse to water, but a pencil must be lead.
Stan Laurel
April 8, 2015 at 1:54 am
some updates on some fields thats important for us
we need to re arange these fields once or twice a day . (when any one dont any change on the table and if cant select is better)
April 8, 2015 at 2:05 am
(I'm sorry to write this problem in 2 groups. I'll keep track Solutions from this page)
Can i use transaction for this problem?
I'm waiting
:doze:
April 8, 2015 at 4:15 am
While executing your transaction you can use hint "TABLOCKX" refer following MS link for further details.
https://technet.microsoft.com/en-us/library/aa213026(v=sql.80).aspx
HTH
---------------------------------------------------
"Thare are only 10 types of people in the world:
Those who understand binary, and those who don't."
April 8, 2015 at 4:29 am
The TABLOCK is probably the way to go, but understand, you're likely to be blocked by processes that are reading from the table. You can't take that kind of lock until they're clear. And, while you're "rearranging columns," what ever that means, you will be blocking access to the table which could lead to timeouts.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
April 8, 2015 at 4:38 am
MotivateMan1394 (4/8/2015)
some updates on some fields thats important for uswe need to re arange these fields once or twice a day . (when any one dont any change on the table and if cant select is better)
Perhaps you can make a physical copy of the table and do your 'operations' on the copy, before switching synonyms or renaming to make the copy table the live table.
The absence of evidence is not evidence of absence.
Martin Rees
You can lead a horse to water, but a pencil must be lead.
Stan Laurel
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply