Showing posts with label dear. Show all posts
Showing posts with label dear. Show all posts

Thursday, March 29, 2012

Database concurrent access issue

Dear All,

I have this .NET application that inserts lucky draw entries into SQL server. Each entry may have a range of values that the winning number will be drawn from. For example,

Entry 1: [1, 2]
Entry 2: [3, 8]
Entry 3: [9, 10]
Entry 4: [11, 11]
Entry 5: [12, 20]

The winning number will be picked from [1, 20]. Given this scenario, what is the best design that can handle the concurrency issue? If two entries are input at the same time, how to make sure it won't have the same starting value? Anyway to lock a table when one is accessing, disallowing other to run select query?

Thanks.You'll have to explain that better.|||For example, Entry 3: [9, 10] means Entry 3 has the number range starting from 9 and ending at 10.

The winning number will be drawn from the number range.

You'll have to explain that better.|||Clear as mud.

If you want to ensure two entries do not share the same starting value, then make the starting value the primary key or a unique index.|||blindman: qxz wants to validate new entries to ensure that it does not conflict with any existing entry and wants to enforce this validation in case of multiple users updating the Db same time...

qxz: a table lock is needed to ensure proper insert. remember explicit locks can have negative effect on performance

create procedure CheckIt (@.StVal int, @.EndVal int)
as

BEGIN TRANSACTION
declare @.CheckFailed char(1)
set @.CheckFailed = 'N'
if exists (select * from MyTable with (tablockx) where @.StVal between StartVal and EndVal)
set @.CheckFailed = 'Y'
if exists (select * from MyTable where @.EndVal between StartVal and EndVal)
set @.CheckFailed = 'Y'

if @.CheckFailed = 'Y'
begin
ROLLBACK TRANSACTION
return 0
end
else
begin
insert into MyTable .....
COMMIT TRANSACTION
return 1
end

Tuesday, March 27, 2012

Database Clustering

Dear Guys.
Can you guys help me regarding Database Server Clustering and Database
server federation
Thanks
NOOR
Sure. What is the problem? You might want to post any clustering related
problems to .clustering group. sql-server-performance.com has clustering
related content. Books Online and KB have a lot of information on clustering
too.
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
"Noor" <noor@.ngsol.com> wrote in message
news:OxgLR7phEHA.3148@.TK2MSFTNGP10.phx.gbl...
Dear Guys.
Can you guys help me regarding Database Server Clustering and Database
server federation
Thanks
NOOR
|||Thanks Narayana but can you give me some real world example like where we
have to use Database Server Clustering and Database server federation
Thanks
NOOR
"Narayana Vyas Kondreddi" <answer_me@.hotmail.com> wrote in message
news:ekcbvEqhEHA.712@.tk2msftngp13.phx.gbl...
> Sure. What is the problem? You might want to post any clustering related
> problems to .clustering group. sql-server-performance.com has clustering
> related content. Books Online and KB have a lot of information on
clustering
> too.
> --
> HTH,
> Vyas, MVP (SQL Server)
> http://vyaskn.tripod.com/
>
> "Noor" <noor@.ngsol.com> wrote in message
> news:OxgLR7phEHA.3148@.TK2MSFTNGP10.phx.gbl...
> Dear Guys.
> Can you guys help me regarding Database Server Clustering and Database
> server federation
> Thanks
> NOOR
>
>
|||Clustering is used for ensuring high availability of SQL Server, while
fererations are meant for distributed processing, to improve performance.
See "Failover Clustering" in SQL Server 2000 Books Online. Also see
"Designing Federated Database Servers" in Books Online.
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
"Noor" <noor@.ngsol.com> wrote in message
news:eF6Q0uqhEHA.2764@.TK2MSFTNGP11.phx.gbl...
Thanks Narayana but can you give me some real world example like where we
have to use Database Server Clustering and Database server federation
Thanks
NOOR
"Narayana Vyas Kondreddi" <answer_me@.hotmail.com> wrote in message
news:ekcbvEqhEHA.712@.tk2msftngp13.phx.gbl...
> Sure. What is the problem? You might want to post any clustering related
> problems to .clustering group. sql-server-performance.com has clustering
> related content. Books Online and KB have a lot of information on
clustering
> too.
> --
> HTH,
> Vyas, MVP (SQL Server)
> http://vyaskn.tripod.com/
>
> "Noor" <noor@.ngsol.com> wrote in message
> news:OxgLR7phEHA.3148@.TK2MSFTNGP10.phx.gbl...
> Dear Guys.
> Can you guys help me regarding Database Server Clustering and Database
> server federation
> Thanks
> NOOR
>
>

Thursday, March 8, 2012

Database Access

Dear All,

I Have two SQL Server ABC and XYZ and i have changed the SA password of both the servers.

I have added link server on the both the servers.

When i execute a link server query in a SQL Query Analyser on either server it works, but when i use the same query in a job, then it fails.

So anyone can help in the above problem.

Regards,
VinayakThe sql server service accout needs to be granted authority|||Hello,

Can u help me in the same.......

Friday, February 24, 2012

Data Update Problem

Dear All,
I am facing a problem from last one month. I have around 100 of client user of my database. I am using VB application for the client users. When they submit the information most of the time the information submits properly. But twice or thrice a day no one can submit the information properly. It remains for more then 15 mins and it will sort out automatically.
What might be the problem. Please suggestDatabase locking?

Without more information, we can't really help you.

When this happens again, check to see if any blocking is occuring.|||I am trying to trace from the Profiler. All the Insert statement to that particular table is taking a lot of time. At that point of time the cpu usases, memory everything is ok.|||did you sp_who2 or sp_lock?