Showing posts with label trouble. Show all posts
Showing posts with label trouble. Show all posts

Monday, March 26, 2012

Duplicate key error

I'm having trouble when trying to apply a snapshot to the subsciber. The
distibution agent reports error "unexpected EOF found in BCP data file error"
in addition it reports " duplicate key error". I have filtered the data
being sent and choosen to delete the rows at the subscriber table that match
the filter. I've checked the subscriber table and all looks ok. The
snapshot application has deleted the rows that are in the filter but when it
inserts the filtered rows it's showing a "duplicate key error". How can this
be? Can any one explain this?
I found that dropping and recreating the table does work however, I don't
want to drop and re-create the table as there is existing data in the
subscriber table that needs to be preserved.
Thanks,
Reana
Can you have a look at the snpashot files to confirm what is happening. There
should be a delete statement with a where clause and the bcp data file should
only have rows that correspond tot he where clause. Also check for any
duplicates in the bcp data files.
Cheers,
Paul Ibison

Wednesday, March 21, 2012

Dundas Web Chart Control

I'm having trouble understanding how to build my bar chart. I have a column of info called Issue and then I'm coutning the record.

I bascially need to alter my query into time periods. I need a series for quarter 1 (1/1/2006 - 3/1/2006), one for quarter 2, 3, 4 and the entire year as a whole.

Can this data all be organized in a single select query?

Here is my current query getting the year as a whole data only:

SELECT

Issue,COUNT(*)AS NumRecordsFROM CSP_Item CI

INNER

JOIN CSP_ProblemNotification CPON CP.ID= CI.CSPNum

WHERE

CP.PNDateBETWEEN'01/01/2007'AND'01/31/2007'

GROUP

BY IssueORDERBY NumRecordsASC

Maybe...

SelectDatePart(quarter, theDate) as Quarter.

group byDatePart(quarter, theDate)

Friday, February 24, 2012

DTS: Data from Excel to Table

I'm having some trouble with import data from an excel document to a table. The scenario is as follows:
The excel document has two columns A and B. Col A has to be copied into the table (table has 3 columns Col 1 - Primay key with autoincrement feature, Col 2 - is Col A from the Excel document, Col 3 - irrelevant)

Depending on Col B from excel doc the corresponding Col A data should be copied to the table. I tired using a DTS pacakage to do this but it complains becuase Col 1 (table) gets a valus of NULL for every value in Col A. I mapped only Col A to Col 2 in the Transformaton tab.

Any ideas? Seems like a simple job?!?

Thanks for any inputWhy not just DTS it in to a work table, the use sql to do what you want to do?

It'll be easier and more powerful.|||Originally posted by vmlal
I'm having some trouble with import data from an excel document to a table. The scenario is as follows:
The excel document has two columns A and B. Col A has to be copied into the table (table has 3 columns Col 1 - Primay key with autoincrement feature, Col 2 - is Col A from the Excel document, Col 3 - irrelevant)

Depending on Col B from excel doc the corresponding Col A data should be copied to the table. I tired using a DTS pacakage to do this but it complains becuase Col 1 (table) gets a valus of NULL for every value in Col A. I mapped only Col A to Col 2 in the Transformaton tab.

Any ideas? Seems like a simple job?!?

Thanks for any input

I had that idea, I was just looking for another idea involving some ActiveX script while Transformation columns.

Thanks newayz|||Originally posted by vmlal
I had that idea, I was just looking for another idea involving some ActiveX script while Transformation columns.

Thanks newayz

It just slows down the transfer in my experience, because it has to handle a row at a time...

If you use sql, you can perform set operation, which will be faster in the long run.

Wednesday, February 15, 2012

DTS Transaction Trouble

Hi Guys,

I have a DTS Routine which archives a large amount of data into archive tables in the same database(Personally I would rather archive into a separate db but the paperwork for the customer involved in doing this is ridiculous).

The routine seems to archive all tables except for one (the largest one) However if I split the routine and run the rest of it first then the problem table then the table archives ok. To me it smells of transaction size or something but does anyone have any other ideas.. If it is transaction size, is there a way that I can break the routine down into multiple transactions?

Any help is as always greatly appreciated.

Cheers,

Chris
--------------------
If we were meant to count in Hex, why do we only have X fingers?
--------------------if it is the same database, I have to ask why DTS and why not just a INSERT INTO? How big is the table?|||My reason for using DTS is that I needed to do some transformation of the data along the way which I did using vbscript, I had originally intended to implement the routine as an SQL script.

Chris|||do you have an error message? have you checked the log? there is not enough in your post. I am having a hard time grasping what could have been so hard as to nmot have done it in SQL. Read Brett's sticky up top.|||There is no error message, the routine simply hangs when it gets to the transform for one of the tables.

If i disable this step then the routine runs through without problem.

I originally created the routine using DTS because whilst currently the archive tables are in the same schema this won't be the case once the routine goes live. The live routine will most likely be archiving to a mirror database on a different server. Also I will want to run the routine as a job.

I will post the log results here however does anyone have an answer to my original question asking if there was a way to break a DTS routine into multiple transactions?

Thanks,

Chris|||you have a solution in mind without having truly diagnosed the problem. DTS is a toy I avoid because it is full of issues. Even when it goes to another server you could still write it in sql and run it as a job over linked servers.|||You are putting the cart before the horse a little here.

Apart from this issue I have already built the DTS routine so I am not in a position to easily start again so I am looking for the solution to the problem rather than settling on a solution of starting again.

I understand your thoughts on DTS having developed solutions using the tool and other solutions using pure SQL scripts. However I have a number of customers that run similar routines on a nightly basis without issue.

So before I resort to starting again I want to investigate resolving the immediate problem.

Regards,

Chris