473,385 Members | 1,893 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

problem with MS sql server 2000 database table

109 100+
Hi you all experts,

Here, I am running into strenge situation. I have ms sql server 2000 database and one of the table is acting strenge. I have trigger placed on this table to move data to the other table witin same database after validating the data.

data goes to the first table through my smart phone using sync process.

well at some point of time that table look likes locking up and no data can make it the table. after i delete data from the first table it starts working again.

Can any one help me firgure it our why it is happening or what should I do to prevent this?

Please it is very urgent and I am having no luck on solving this.

so, please please help.

Thank You,
Jul 16 '08 #1
4 1570
ck9663
2,878 Expert 2GB
Check your trigger. It might be recursing. Also, you don't want to execute a full table update or full table scan command on your trigger.

What's the size of your table?

-- CK
Jul 16 '08 #2
arial
109 100+
Thank CK. I will check on my triggers. well at the moment my table has about 85 datafields.
and data i have is my test data about 2000 but it will grow once i solved this problem and launch this app.
Thank you,
Jul 18 '08 #3
arial
109 100+
i can't figured it out so, here i am providing my trigger as well store procedure.

this is my trigger which is on table dbo.wrk
Expand|Select|Wrap|Line Numbers
  1. create trigger trigger_qcheck
  2. on [dbo].[Q_CHECK_WORK]
  3. for insert
  4. as
  5. exec [dbo].[SDFD_CheckAndLoad]
  6.  
once records gets into dbo.wrk this trigger fires up and moves data to dbo.glass by executing store procedure and here is the store procedure:

Expand|Select|Wrap|Line Numbers
  1. CREATE PROCEDURE SDFD_CheckAndLoad
  2.  
  3. AS
  4.  
  5. BEGIN
  6.  
  7.             DECLARE @Id varchar(19)
  8.  
  9.             DECLARE @CBComplete varchar(1)
  10.  
  11.             DECLARE @PalmName varchar(20)
  12.  
  13.             DECLARE c5 CURSOR FOR
  14.  
  15.               SELECT [ID], CB_COMPLET, PALMNAME FROM dbo.Q_CHECK_WORK
  16.  
  17.               WHERE [ID] NOT IN (SELECT [ID] FROM dbo.Q_CHECK_GLASS)
  18.  
  19.             OPEN c5
  20.  
  21.             FETCH c5 INTO @Id, @CBComplete, @PalmName
  22.  
  23.  
  24.  
  25. print @id
  26.  
  27. print @CBComplete
  28.  
  29. print @PalmName
  30.  
  31.             WHILE @@FETCH_STATUS = 0
  32.  
  33.                BEGIN
  34.  
  35.               PRINT 'INSIDE WHILE'
  36.  
  37.                         IF @CBComplete='T'
  38.  
  39.                          BEGIN
  40.  
  41.                                     PRINT 'COMPARE'
  42.  
  43.                                     INSERT dbo.Q_CHECK_GLASS SELECT * FROM dbo.Q_CHECK_WORK WHERE [ID]=@Id
  44.  
  45.                                     /*delete from dbo.Q_CHECK_WORK WHERE [ID]=@Id*/
  46.  
  47.                                     PRINT 'AFTER INSERT'
  48.  
  49.                          END
  50.  
  51.                         ELSE
  52.  
  53.                                     INSERT dbo.Q_CHECK_FILTER values(@Id, @PalmName)
  54.  
  55.  
  56.  
  57.  
  58.  
  59.             FETCH NEXT FROM c5 INTO  @Id, @CBComplete, @PalmName
  60.  
  61.             END
  62.  
  63.             CLOSE c5
  64.  
  65.             DEALLOCATE c5
  66.  
  67. END
  68.  
  69. GO
  70.  
  71.  
Please help on solving this problem.

Thank You,
Jul 18 '08 #4
ck9663
2,878 Expert 2GB
First, consider not using a cursor.

Second, the query

Expand|Select|Wrap|Line Numbers
  1. SELECT [ID], CB_COMPLET, PALMNAME FROM dbo.Q_CHECK_WORK
  2. WHERE [ID] NOT IN (SELECT [ID] FROM dbo.Q_CHECK_GLASS)
is still a full table scan. Consider using the logical inserted tables.

Read here for more info.

Happy coding!

-- CK
Jul 18 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Richard Muller | last post by:
Hi All, I've got the ASP script shown below that complains as follows: Microsoft OLE DB Provider for ODBC Drivers (0x80004005) Data source name not found and no default driver specified...
6
by: Vance Kessler | last post by:
I am sure this is a configuration or permissions problem, but I cannot figure out what it might be. I have 2 SQL 2000 database servers: one is a linked Windows 2003 based server using a...
6
by: Murtix Van Basten | last post by:
HI all, I am trying to migrate a database from mysql to mssql2k. I use myODBC to connect to mysql server to pull the database from DTS and insert in to sql server. But in mysql server, there is...
3
by: RAD | last post by:
I am working with an evaluation copy of SQL Server 2000 for the first time; my DB experience lies with MS Access. I have a simple table in SQL Server (tblCompany) that has a field called...
0
by: JHB | last post by:
Hi. Sorry for cross posting! After I've installed MS-SQL Server 2000, I've got a problem each time I open a table, view or diagram in design, in a MS-Access project.
1
by: Tim | last post by:
Hi all, Here is a brief description of a problem I encountered, and how I found a work around after 3 long days. I have a VB6 app that uses ADO and ODBC to get communicate with SQL server 2000...
5
by: dananrg | last post by:
I've created a small company database where the tables reside in a SQL Server database. I'm using Access 2000 forms for a front end. I've got a System DSN set-up to SQL Server and am using links...
1
by: Terry | last post by:
Hello, Has anyone experienced the following problem following an Upsize from Access 97 to SQL 2000 using the MS Upsize Wizard? Or can anyone see what the problem might be. Before Upsize...
1
by: msmith | last post by:
MSSQL Server 2000 SP3 in both houston and memphis I have a database in houston, lets call it RED. Specific tables from database RED are copied to database BLUE. Database BLUE is then backed...
9
by: HC | last post by:
Hello, all, I started out thinking my problems were elsewhere but as I have worked through this I have isolated my problem, currently, as a difference between MSDE and SQL Express 2005 (I'll just...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.