Showing posts with label hii. Show all posts
Showing posts with label hii. Show all posts

Friday, March 23, 2012

Lock 'Childreen' Table

Hi!

I'm new in SQL and I′ve been the problem bellow:

I lock a record in one foreign table and automaticaly SQL lock the record that matches on primary table.

But this occours just in some primaries tables and not in all. I need that just the table that are of SELECT are lock. How can I do this?

Example:

** At open of the invoice:

SET ISOLATION LEVEL READ UNCOMMITTED

BEGIN TRANSACTION

SELECT * FROM INVOICE WITH (ROWLOCK UPLOCK) WHERE ( ID = 15 )

******* at the end of invoice:

INSERT INTO INVOICE ........

COMMIT TRANSACTION

END

******* The relationship are:

INVOICE <>> ITENS_INVOICE

ITENS_INVOICE <>> PRODUCTS

CUSTOMER <>> INVOICE

VENDORS <>> INVOICE

Just the INVOICE and PRODUCTS record′s involved in Transaction are lock. ( The CUSTOMER and VENDORS are not locked for example )

But I need that just INVOICE record be locked.

Thank′s for all and sorry my English.

Igor Sane

S?o Paulo - Brazil

PS: This doesn′t occours in SQL Express, just in SQL Server 2005....

Friday, March 9, 2012

Local variables in stored procedures

Hi!
I'm using SQL Server 7.0 and it is a multiuser application.
My problem is that sometimes during parallel calls to a stored procedure it
produces wrong results. It takes between 5 to 20 sec to execute the stored
procedure.
To be able to know why the result sometimes is wrong I will log some values
from local variables.
My guess is that my part-result from some lookups are overwritten.
But until I get enough log-results to analyse I have a couple of questions:
- Are local variables overwritten by another call to the same procedure?
- Can I save part-result in a more secure way? I still want to have the
possibilty to call the procedure in a parallel way.
- As a last option. Is there a simple way to forbid parallel calls to a
procedure? (I have read some about "set transaction isolation level
serializable" but I'm afraid it has too large impact on other calls that
questions the same tables that are in use in the stored procedure)
Hope someone has a godd answer to give.
Best regards
SvenneSvenne
Can you show us your SP's call and how do you handle local variables within
SP?
If you have SELECT/UPDATE/DELETE/INSERT operations within a SP try to wrap
it into BEGIN TRAN ...COMMIT commands
"Svenne" <sasodergren@.hotmail.com> wrote in message
news:%23Y0MMBp7FHA.2384@.TK2MSFTNGP12.phx.gbl...
> Hi!
> I'm using SQL Server 7.0 and it is a multiuser application.
> My problem is that sometimes during parallel calls to a stored procedure
> it produces wrong results. It takes between 5 to 20 sec to execute the
> stored procedure.
> To be able to know why the result sometimes is wrong I will log some
> values from local variables.
> My guess is that my part-result from some lookups are overwritten.
> But until I get enough log-results to analyse I have a couple of
> questions:
> - Are local variables overwritten by another call to the same procedure?
> - Can I save part-result in a more secure way? I still want to have the
> possibilty to call the procedure in a parallel way.
> - As a last option. Is there a simple way to forbid parallel calls to a
> procedure? (I have read some about "set transaction isolation level
> serializable" but I'm afraid it has too large impact on other calls that
> questions the same tables that are in use in the stored procedure)
> Hope someone has a godd answer to give.
> Best regards
> Svenne
>

Monday, February 20, 2012

local administrator access for DBA's - is this required?

Hi
I need to manage a SQL cluster, monitor database and O.S performance and
apply database patches. Do I require local admin rights for this? If not
what is the workaround please?
Problem is, my organisation is very reluctant to grant local admin rights.
Is there a Microsoft article on this type of issue (I couldn't find one).
Thanks!
MilesHI
Use the SQL server account if you need local admin privilege on server.
Andras Jakus MCDBA
"Miles" wrote:

> Hi
> I need to manage a SQL cluster, monitor database and O.S performance and
> apply database patches. Do I require local admin rights for this? If not
> what is the workaround please?
> Problem is, my organisation is very reluctant to grant local admin rights.
> Is there a Microsoft article on this type of issue (I couldn't find one).
> Thanks!
> Miles
>

local administrator access for DBA's - is this required?

Hi
I need to manage a SQL cluster, monitor database and O.S performance and
apply database patches. Do I require local admin rights for this? If not
what is the workaround please?
Problem is, my organisation is very reluctant to grant local admin rights.
Is there a Microsoft article on this type of issue (I couldn't find one).
Thanks!
Miles
HI
Use the SQL server account if you need local admin privilege on server.
Andras Jakus MCDBA
"Miles" wrote:

> Hi
> I need to manage a SQL cluster, monitor database and O.S performance and
> apply database patches. Do I require local admin rights for this? If not
> what is the workaround please?
> Problem is, my organisation is very reluctant to grant local admin rights.
> Is there a Microsoft article on this type of issue (I couldn't find one).
> Thanks!
> Miles
>