Troubleshooting Data Updates
Mar 7, 2006
I don't know if the title for the subject is appropriate here, anyway
here goes:
This process was set up by someone and I have inherited it. I have a
sql2000 database that has about 13 tables that get populated with data
from 3 different databases. I have identified where each of this data
comes from, and the stored procedures that do the updates, inserts, and
deletes, and the jobs that run these stored procedure to do the
updates, except for one table. The updates for all the other tables
are done through scheduled jobs. For the one table I know where the
data comes from and the stored procedure that needs to run to do the
update on the table, however I have not been able to identify the
process that runs the stored procedure.
I am hoping that someone can give me a clue as to how to find out where
a stored procedure is being used - or any other hint as to how I could
go about finding out how this table gets updated.
Thanks
KR
View 2 Replies
ADVERTISEMENT
Dec 19, 2007
I have a project that consists of a SQL db with an Access front end as the user interface. Here is the structure of the table on which this question is based:
Code Block
create table #IncomeAndExpenseData (
recordID nvarchar(5)NOT NULL,
itemID int NOT NULL,
itemvalue decimal(18, 2) NULL,
monthitemvalue decimal(18, 2) NULL
)
The itemvalue field is where the user enters his/her numbers via Access. There is an IncomeAndExpenseCodes table as well which holds item information, including the itemID and entry unit of measure. Some itemIDs have an entry unit of measure of $/mo, while others are entered in terms of $/yr, others in %/yr.
For itemvalues of itemIDs with entry units of measure that are not $/mo a stored procedure performs calculations which converts them into numbers that has a unit of measure of $/mo and updates IncomeAndExpenseData putting these numbers in the monthitemvalue field. This stored procedure is written to only calculate values for monthitemvalue fields which are null in order to avoid recalculating every single row in the table.
If the user edits the itemvalue field there is a trigger on IncomeAndExpenseData which sets the monthitemvalue to null so the stored procedure recalculates the monthitemvalue for the changed rows. However, it appears this trigger is also setting monthitemvalue to null after the stored procedure updates the IncomeAndExpenseData table with the recalculated monthitemvalues, thus wiping out the answers.
How do I write a trigger that sets the monthitemvalue to null only when the user edits the itemvalue field, not when the stored procedure puts the recalculated monthitemvalue into the IncomeAndExpenseData table?
View 4 Replies
View Related
Oct 26, 2007
Guys,
I have 14 databases, the last database - 14th one will have lookup tables only. The other 13 databases will have these lookup tables and data tables. At the end of each day I will make updates for lookup tables on 14th database, I want to be able to push the updates to any or some of the 13 databases. Look up tables will have only upto 100 rows, so I am not concerned about the bandwidth. What is the best way to accomplish this.
Any suggestions and inputs would help
Thanks
View 1 Replies
View Related
Oct 13, 2005
I have been successful with DTS packages and various SQL statements. However, I have a new challenge. I have a table in an SQL Server database. One of the columns is employee number and a column for department number(which is not populated) In a remote AS400 file I have the employees number and department number. I want to create a package to connect to remote table and update SQL Server table with department number where the two tables match on the employee number.
View 3 Replies
View Related
Jul 22, 2007
Hi Guys,
I'm using Visual Basic 2005 Express and SQL Server 2005 Express. I have textboxes on a VB form linked to 2 database tables.
I am wondering if it is possible to use just ONE BindingNavigator to manage data entry and updates to THE database tables. I initially thought I could manage the tables but have I encountered some problems:
i)When I entered a new record, and clicked on the SAVE BUTTON the new record the textboxes for the 1st table saves the record to the database, but the textboxes for 2nd table still retained data in them and are not saving theirs to the database.
ii) The same textboxes for the 2nd table are NOT allowing for updates too! Or, could it simply be that it is not possible to use this method for data entry and updates?
Thanks you.
View 1 Replies
View Related
Aug 6, 2007
I need to make a job that will update up to 8000 rows with the list description of 'berkhold' to 'berknew' in SQL 2000. This is something that I have to do with several projects manually every day by doing the following 2 steps.
SELECT ListDescription, CRRecordID
FROM dbo_BerkleyGroupInventory
WHERE ListDescription ="BerkHold" AND CRCallDateTime<'1/1/2003' AND CRCallResultCode ='CC'
ORDER BY CRRecordID
I then scroll to the 8000th row and copy the CrrecordID and run the following query
UPDATE dbo.berkleygroupinventory
SET listdescription ='berknew'
WHERE ListDescription ='BerkHold' AND CRRecordID <=5968432 AND CRCallDateTime ='1/1/2003' AND CRCallResultCode='CC'
I'm sure there's an easier way to do this, but I'm very new to SQL and haven't figured it out yet
View 11 Replies
View Related
Oct 26, 2007
Guys,
I have 14 databases, the last database - 14th one will have lookup tables only. The other 13 databases will have these lookup tables and data tables. At the end of each day I will make updates for lookup tables on 14th database, I want to be able to push the updates to any or some of the 13 databases. Look up tables will have only upto 100 rows, so I am not concerned about the bandwidth. What is the best way to accomplish this.
Any suggestions and inputs would help
Thanks
View 5 Replies
View Related
Sep 19, 2000
I am running a Access97 front end with a SQL Server 7 backend. On records with an ntext datatype, you are only allowed to update records if the ntext field is null. The tables are linked from access. You get a "cannot update linked table" and "ODBC error #306." Any suggestions??
View 1 Replies
View Related
May 12, 2006
We have a legacy database whose data needs to be included in our yet-to-be-built sql 2005 data warehouse. Some of the tables don€™t have any natural candidates for a primary key. (Of course, we also need to add other data to the mix.)
Suppose we load the empty warehouse initially. In following loads we don€™t want to include those records that haven€™t changed from the first load (€œduplicates€?) but we also don€™t want to delete the contents of the entire warehouse because of the load time. Any ideas/best practices how to handle €œincremental updates€? to a warehouse would be appreciated.
TIA,
Bill
View 7 Replies
View Related
Apr 28, 2008
I got anywhere from a couple hundred to a hundred thousand records that need to be updated or inserted into their SQL Server 2005 end destination. What are some of the best ways to accomplish this? Right now we are doing it manually through line by line updates and inserts. Would I use BC or some other bulk import tool?
View 5 Replies
View Related
Sep 10, 2007
Hello,
I am working on a project that involves one part where a field's value needs to be changed when the user updates the record. Here is the situation in detail:
There is an InputData table where the user enters new records or changes existing records. There is a field called "calculated" in this table which has a default value of 'no'. A stored procedure runs math calculations on all the InputData records where the calculated field = 'no'. At the end of this stored procedure, it sets the calculated field = 'yes'. When new records are added by the user their "calculated" field value is 'no' by default so that the next time the stored procedure is executed, it only runs the math calculations on the new records. The problem is, if a user changes an existing record, the "calculated" field needs to be changed from 'yes' to 'no' so that the stored procedure recalculates the math for the modified record. How do I change the value from 'yes' to 'no' on records that the user modifies?
Thanks.
View 9 Replies
View Related
Jun 22, 2015
I have a table that is increasing quite largely each day. By now, I have average 300 million of records over 2.5 years. Before we received our new interface, the data we received was aggregated and thus not that big.The problem is that the table is so huge that I cannot use the Slowly Changing Component. I was thinking about making a temp table where I load the incremental data before I load it into the final data mart table.Based on this temporary table I use a script to compare the temp data with the already existing data in the data mart. However, this requires a compare of each records (300 mil records).
View 3 Replies
View Related
Sep 10, 2007
Hi all,,
I posted the questions in sql forum and got good sql statement to work with it.. However, I want to see if there is a way to do it in SSIS..
May be this is really basic questions but I am having hard time to do it in sql server 2005 SSIS..
I have a flat file that I want to merge with table in SQL server 2005.
1> I have successfully created a data flow task to import data from flat file to Table X (new table I created for this package).
Now here is my question.
I have a Table A already in the database with the same column structure as of TableX (Both the tables have 20 columns/same Name/Same design).
I want to merge Table A and Table X and stored the data in TableA. However, I just don't want to merge blindly, I need to insert a new row in Table A only if the same row does not exist in Table A (there is no primary key, i am looking certain fields to see if the rows are same)..
Here is an example:
Table A
--------------
1 test test1 test2 test3 test4 test5
2 test test6 test7 test8 test9 test10
Table X
------------
1 test test1 test2 test99 test4 test5
2 test test98 test97 test 96 test95 test94
--------------------------------------------------------
Now, I want to only insert row 2 of Table X since there is match on 4 of the fields in row1..
The new Table A should look like
NEW Table A'
-----------------
test test1 test2 test3 test4 test5
test test6 test7 test8 test9 test10
test test98 test97 test 96 test95 test94
------------------------------------
I think, I could do this using Execute SQL task and write all the code in sql, but that will be cumbersome and time consuming.. Is there a simpler way to achieve this?
Thanks in advance.
View 6 Replies
View Related
Sep 1, 2015
I have been given a request by a business analyst to update the text 'old' to 'new' within the column names / measure names and associated calculations within a PowerPivot model. There are hundred of columns / measures / calculations, etc. which need to be renamed.
Is there any way of updating these changes to the model other than making these changes manually or is there some way of doing the following type of operation in PowerPivot; -
UPDATE tblColumnNames SET Column_name, etc REPLACE ('old','new', all columns),('old','new', all measures),('old','new', all calculations)
FROM
tblColumnNames
View 2 Replies
View Related
Aug 14, 2006
Hi,
I have a table customer wich has the columns phone_number(char type) and ok_to_call(bit type). There are already data in the table and the column ok_to_call only contains the value false for every row.
Now i want to update the latter column. I have a text file with a list of phone numbers and i want that all the rows in the Customer table(phone_number column)that matches the number in the text file to update ok_to_call to true.
This is to be done in SSIS(Integration Services). I'm new at this and i've looked around that tool but is a lot of items, packages and stuff so i dont know where to begin.
Would appreciate help on how to solve this issue in SSIS. What controlflow/Data flows to use,wich items and packages to use, how to configure and how to link together?
Regards
/Tomas
View 3 Replies
View Related
Feb 16, 2008
Hello,
I will be getting data in either Excel or Access form on a daily basis. I would like to automate the process of converting this (excel or access) data to a table in an existing SQL database. Since this conversion needs to performed on a daily basis, note that I need to update the table that contains data from the day before.
Is it possible to do this and if it is possible, can someone tell me how to do it.
Thanks in advance,
Joe green
View 1 Replies
View Related
Jun 8, 2007
Ok, I think this may have a simple answer. Basically I have no problems in setting up QueryString/Control/etc parameters when I use SELECT in the Configure Data Source Wizard as it prompts me for the necessary parameters. But when I try to use the Configure Data Source Wizard with an UPDATE, INSERT or DELETE it does NOT prompt me for the required parameters.Is this a bug or am I just missing something? Do I have to put them in manually or something?Thanks!
View 5 Replies
View Related
May 27, 2014
I need a script that inserts the data of an excel sheet into a table. If something already exists it should leave it, unless it's edited in the excel sheet and so on and so on. This proces has to go through a stored procedure... ...But how?
View 6 Replies
View Related
Oct 11, 2001
Hi list,
I'd be grateful for a little advice. Running into some problems and not sure where to start. I've looked through some books and articles and Online Help but need some insight into the issue from a person.
I'm running a SQL2K server with about 30 databases, none of them over 20M in size. These db's are driving websites on servers in the same server room and also accessed remotely using Enterprise Manager. For 95% of the time these databases are performing well. Then connections on webpages start timing out. This is a problem that 'fixes' itself very quickly but I need to identify what's causing the problems. I have sa access to the server and am trying to find a way, via perfomance monitoring or enterprise manager, to work out which database, if any, is responsible for this behaviour. There are no blocks visible in Current Activity on Enterprise Manager, I'm getting average LockRequest/sec of about 2000 bit with peaks up to 31000. Processor time is averaging out at about 10%, not too scary.
I can find lots of information on optimising individual databases and queries within them but no too much on identifying processes or queries that might be hitting a whole server installation in this fashion.
Any advice most welcome.
Jo
View 1 Replies
View Related
Feb 28, 2008
Hello,
I have tables/columns exist.How to encrypt database or mask columns if I have to send a copy of DB to microsoft to troubleshoot for a problem.
Thanks.
View 3 Replies
View Related
Jul 13, 2007
I need help. I have a SSIS package that connects to a ODBC database, it then does ETL from that database into a SQL 2005 database. I run the package using a Sql Agent job each night. However the package fails randomly with no apparent reason. I have setup logging and after viewing the logs I am no closer to solving the problem. Any Ideas how I can track this down? Thanks.
View 16 Replies
View Related
Sep 24, 2007
This error is triggered by the following code. How do I figure out why?
It works fine on an old server running win2000 but blows up on win2003
Microsoft VBScript runtime error '800a01a8'
Object required: 'Param1.value'
/mmd/_ScriptLibrary/getcons.asp, line 19
set conn = session("conn")
' Response.write(pg);
set cmdStoredProc = Server.CreateObject("ADODB.Command")
set cmdStoredProc.ActiveConnection = conn
cmdStoredProc.CommandText = "sa.mmd.getConsultantList"
cmdStoredProc.CommandType = adCmdStoredProc
set Param1 = cmdStoredProc.CreateParameter("conam",adVarChar,adParamInput,3)
cmdStoredProc.Parameters.Append Param1
Param1.value = request.querystring("q")
Param1.size = Param1.value.length
set rs = cmdStoredProc.Execute
View 3 Replies
View Related
Oct 30, 2007
Hi...
I have data that i am getting through a dbf file. and i am dumping that data to a sql server... and then taking the data from the sql server after scrubing it i put it into the production database.. right my stored procedure handles a single plan only... but now there may be two or more plans together in the same sql server database which i need to scrub and then update that particular plan already exists or inserts if they dont...
this is my sproc...
ALTER PROCEDURE [dbo].[usp_Import_Plan]
@ClientId int,
@UserId int = NULL,
@HistoryId int,
@ShowStatus bit = 0-- Indicates whether status messages should be returned during the import.
AS
SET NOCOUNT ON
DECLARE
@Count int,
@Sproc varchar(50),
@Status varchar(200),
@TotalCount int
SET @Sproc = OBJECT_NAME(@@ProcId)
SET @Status = 'Updating plan information in Plan table.'
UPDATE
Statements..Plan
SET
PlanName = PlanName1,
Description = PlanName2
FROM
Statements..Plan cp
JOIN (
SELECT DISTINCT
PlanId,
PlanName1,
PlanName2
FROM
Census
) c
ON cp.CPlanId = c.PlanId
WHERE
cp.ClientId = @ClientId
AND
(
IsNull(cp.PlanName,'') <> IsNull(c.PlanName1,'')
OR
IsNull(cp.Description,'') <> IsNull(c.PlanName2,'')
)
SET @Count = @@ROWCOUNT
IF @Count > 0
BEGIN
SET @Status = 'Updated ' + Cast(@Count AS varchar(10)) + ' record(s) in ClientPlan.'
END
ELSE
BEGIN
SET @Status = 'No records were updated in Plan.'
END
SET @Status = 'Adding plan information to Plan table.'
INSERT INTO Statements..Plan (
ClientId,
ClientPlanId,
UserId,
PlanName,
Description
)
SELECT DISTINCT
@ClientId,
CPlanId,
@UserId,
PlanName1,
PlanName2
FROM
Census
WHERE
PlanId NOT IN (
SELECT DISTINCT
CPlanId
FROM
Statements..Plan
WHERE
ClientId = @ClientId
AND
ClientPlanId IS NOT NULL
)
SET @Count = @@ROWCOUNT
IF @Count > 0
BEGIN
SET @Status = 'Added ' + Cast(@Count AS varchar(10)) + ' record(s) to Plan.'
END
ELSE
BEGIN
SET @Status = 'No information was added Plan.'
END
SET NOCOUNT OFF
So how do i do multiple inserts and updates using this stored procedure...
Regards
Karen
View 5 Replies
View Related
Oct 19, 2007
Hello guys, i am new to sql so forgive me if dont see something in the code that i should. Anyway the code below comes from the sql script that belongs to "BPBlog asp blogging software" ...its not mine.
Whenever i run this code in query analyzer from sql server 2000 i get an error that says :
Server: Msg 170, Level 15, State 1, Line 16
Line 16: Incorrect syntax near '('.
*line 16 is the below line in the code.
i have been going through books online since last night to try to get an understanding of the syntax of all those keywords that sorround the error but still havent figured it out yet. any advise on the error would be sincerely appreciated.
Thanx,
USE [Blog]
GO
/****** Object: Table [dbo].[tblAuthor] Script Date: 11/07/2006 10:51:16 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblAuthor](
[fldAuthorID] [int] IDENTITY(1,1) NOT NULL,
[fldAuthorUsername] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[fldAuthorRealName] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[fldAuthorEmail] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[fldAuthorWebsite] [nvarchar](100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[fldAuthorBlurb] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[fldAuthorPassword] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Approved] [smallint] NULL DEFAULT ((0)),
[fldAdmin] [smallint] NULL DEFAULT ((0)),
CONSTRAINT [aaaaatblAuthor_PK] PRIMARY KEY NONCLUSTERED
(
[fldAuthorID] ASC
)
WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
View 2 Replies
View Related
Apr 21, 2006
Lock:Deadlock Chain
Exchange
1
16325
2006-04-21 09:20:18.560
Parallel query worker thread was involved in a deadlock
0
Is the process I am running deadlocking with Exchange Server?
The data above is from Profiler.
Thanks
Lystra
View 4 Replies
View Related
Aug 29, 2007
Does anyone have any good places where I can get some practice scenarios for DBA activity? Also any transact sql puzzles to solve for practice purposes. I want to get as much "real world" activity under my belt as possible in a quick time-frame.
Thanks.
View 1 Replies
View Related
Jul 23, 2005
Hi, we just started receiving the following error messages about 3weeks ago. We don't get them all the time, or even on the same pagesnecessarily, but we get them from time to time and our sql serverconnection is slower in the last three weeks also. Our database isremotely hosted, and the programmers are also offsite, so we are tryingto deal with this issue with our database server host, with noknowledge of sql server. They say nothing has changed on the server,but we haven't changed any of our front end files either, so we don'tknow what the problem is. Here's 3 of the most common errors:1. Microsoft Cursor Engine error '80004005'Data provider or other service returned an E_FAIL status..../subview.asp, line 1322. Microsoft OLE DB Provider for SQL Server error '80004005'TDS buffer length too large.../subview.asp, line 283. Microsoft OLE DB Provider for SQL Server error '80004005'Unknown token received from SQL Server.../members.asp, line 182We have *no idea* what the above error messages refer to, or whetherthis is something wrong with the server or the ASP pages mentioned. Anyhelp anyone could provide so we can understand the types of messages weare getting would be nice.Regards,Sage
View 1 Replies
View Related
Jul 23, 2005
Can anyone help me troubleshoot this failed job. The error message in eventviewer is:SQL Server Scheduled Job 'Job1' (0xB1D83B7357CF2B4C808AD1CFA34CE8F9) -Status: Failed - Invoked on: 2005-05-12 09:31:38 - Message: The job failed.The Job was invoked by User sa. The last step to run was step 1 (Job1).The job step is:EXEC proc1I can execute the procedure in QA.Proc1 does the following:INSERT values into a table in the database where the job is running fromSELECT records from a seperate database on seperate serverI'm using four part naming in the select against a linked server. I suspectthat the issue is the security between the different servers/databases but Idon't know where to get more information about the failed job or what to trynext.thanks
View 1 Replies
View Related
Jul 20, 2005
Hi,This is the first time I use SOAP. Dont really know the exact pictureyet. Hope you can shed some lights on me.May I know where should I start troubleshooting if I get the followinerror message when running SOAP on Windows 2003, SQL Server 2000 ?Error Code: 0 Error Source= Microsoft VBScript runtime error ErrorDescription: ActiveX component can't create object:'MSSOAP.SOAPClient' Error on Line 1. The step failed.Thanks.
View 2 Replies
View Related
Mar 16, 2006
We have some transactional replication jobs from oracle to mssql2005. I found an error in the replication monitor as below,
============================================
Incorrect syntax near 'index'. If this is intended as a part of a table hint, A WITH keyword and parenthesis are now required. See SQL Server Books Online for proper syntax. (Source: MSSQLServer, Error number: 1018)
Get help: http://help/1018
Command attempted:
if @@trancount > 0 rollback tran
(Transaction sequence number: 0x00000000000000000D4300000000, Command ID: 26290)
============================================
I found the corresponding table from the command id. Since some of the tables in our env. are created with triggers which cause the replication error occasionally! How can I trace the information of the transaction/record which made the replication pending? Also, there may be 'invalid' input in oracle and replicate to mssql2005 which cause error in trigger and made the replication panding. Any way to solve this kind of problem? Thanks in advance
View 5 Replies
View Related
Mar 26, 2001
SQL Server 7.0 with SP 1
Database maintenance job is failing
with error about being unable to delete old backup file.
I can manually delete the file with no problem.
This occurs randomly, maybe once a week.
Any ideas on what's wrong, and how to fix it?
View 1 Replies
View Related
Mar 1, 2001
Hi all,
This one is a real X FIle, just without Mulder, Scully or the Lone Gunmen!
I have a database, to which access must be restricted via a sole application. So, I have to use an application role. I go in the database and run these statements to add and activate the roles, respectively;
Exec sp_addapprole 'Sirius', 'password'
(The system confirms the role is created.)
Exec sp_setapprole 'Sirius', 'password' 'odbc'
(The system confirms the role is activated.)
Right, now I should not be able to connect using anything but this role, agreed? But here's where things go wrong. I can then successfully connect from another computer by using MS query from Excel, from a login that is not even a member of the Public Role!
I tried again, started and stopped the Server/DTS/Agent services and dropped the old role after each successful login before recreating it. I've checked my syntax exhaustively. I must be doing something wrong, or overlooking something, otherwise MS has a major security problem! (Just hope the Cancer Man doesn't find out!!)
Thanks in advance everyone,
Jaishel.
View 1 Replies
View Related