Showing posts with label suppose. Show all posts
Showing posts with label suppose. Show all posts

Friday, March 30, 2012

Problem with locks - Help!

Good morning to everyone, I am writing to ask an advice: I have been
having lots of problems in the last time because of some locks that (I
suppose) a software create in SqlServer. The problem details is:
apparently randomly, when we try to save a record with that software
everything freeze. If I watch at the locks in Enterprise Manager I can
see some locks. If I terminate the locks the software unfreeze and the
record will be saved correctly. If I watch the detail of the processes
locked, I can see that instruction: "sp_unprepared;1". I spoke many
times with the company which produce the software and they say that I am
the only customer with this problem and that surely the problem is on my
sqlserver settings. I am not so sure, for me it is a problem of the
software. Does anybody can help me to find out what is going on? I would
really appreciate any kind of suggestion (except to change the software
;-) ). I am using Microsoft SqlServer 2000 sp.4 in a Windows 2000 server
sp.4. Sorry for my English. Thank you very much for your help, have a
nice day, MefistoCan you run SQL Server Profiler while you try to save a row and see what is
going on.?
"Mefisto" <fastyno@.NOSPAM.freemail.it> wrote in message
news:dnjdau$hg6$1@.newsread.albacom.net...
> Good morning to everyone, I am writing to ask an advice: I have been
> having lots of problems in the last time because of some locks that (I
> suppose) a software create in SqlServer. The problem details is:
> apparently randomly, when we try to save a record with that software
> everything freeze. If I watch at the locks in Enterprise Manager I can see
> some locks. If I terminate the locks the software unfreeze and the record
> will be saved correctly. If I watch the detail of the processes locked, I
> can see that instruction: "sp_unprepared;1". I spoke many times with the
> company which produce the software and they say that I am the only
> customer with this problem and that surely the problem is on my sqlserver
> settings. I am not so sure, for me it is a problem of the software. Does
> anybody can help me to find out what is going on? I would really
> appreciate any kind of suggestion (except to change the software ;-) ). I
> am using Microsoft SqlServer 2000 sp.4 in a Windows 2000 server sp.4.
> Sorry for my English. Thank you very much for your help, have a nice day,
> Mefisto

Wednesday, March 28, 2012

problem with joins

Hi

i have 2 tables called locationcode and emp.

tables are having so many records.

suppose the tables having the sample data like this:

locationcode table:

locationcode(field name)

1

2

3

emp table

empno empname locationcode (field names)

----------------------

2344 aaaa 1

2345 bbbb 1

2567 cccc 2

1234 dddd 3

16789 eeee 4

9890 fffff 4

i have to delete records from emp table the locationcode which is not matching with locationcode in locationcode table.

(in this sample data i have to delete records which are having location code as 4 from emp table)

i used joins,but i am not getting.

please help me.

Thanks.

Hello

Use left outer join

select

t1.empno, t1.empname, t1.locationcodefrom emp t1
leftouterjoin locationcode t2on t2.locationcode= t1.locationcode
where t2.locationcodeisnull

HTH

|||

hi,

i think this query can help you out.

DELETE FROM emp

where locationcode in

(SELECT locationcode from emp e, locationcode lc where e.locationcode <> lc.locationcode)

i've not tried this but i think it will work.

Happy Coding.

regards,

Muppidi.

|||

hi,

i think this query can help you out.

DELETE FROM emp

where locationcode in

(SELECT locationcode from emp e, locationcode lc where e.locationcode <> lc.locationcode)

i've not tried this but i think it will work.

Happy Coding.

regards,

Muppidi.