Naughty SP Ruining My Day!?!

Feb 5, 2004

Hi!

Running a SQL2K-server on a Win2K(adv) I have sort of an enigma (to me atleast!):

One of my SPs sometimes seems to hang. Arrgh. This is of course not the total extent of my problem - naah, I've had/created my share of faulty SPs which hang on a regular basis - no, the enigma is that the code inside my SP *never* hangs when executed from the Analyser? The test is done using ctrl-a/copy&paste - remove 'Create...' and putting a 'Declare in front of the only parm, then inserting a select parm='value_of_parm'. As far as my knowledge goes this 'running code from SP in Query Analyser' should introduce no extra room for slack (which in turn could help me explain why the code works in Query Analyser)?

Btw, when I say 'hang' it's not the whole truth - using the debugger I can see the code (mostly a bunch of updates on one table) being executed - but extremely slow. The code takes approx. 1 min in Query Analyser but hasn't finished after 60 mins when executing the SP.

A little info on the SP:
The user runs another SP which gathers some data from an Oracle DB and inserts these data into a SQL2000 table. Then the user activates the above flamed SP in vain hope of marking the newly fetched data with a statusid.
The problem allways arises when the user tries to let the SP engage newly fetched data - and rarely when engaging old (already marked, hence 'remarking') data. I suspect this could be a clue for anyone with some insight?

I'm looking for 1) a solution, 2) a finger pointing out the bug(s) 3) any suggestions on how to do further research into this evil SP!

Thanx in advance!
Ult

View 6 Replies


ADVERTISEMENT

There's Just No Escaping It... Data Containing Quotes Ruining CSV Files

Jul 11, 2006

Much to my surprise and dismay, after burning hours and hours developing various SSIS packages to extract data from my SQL 2005 DB to CSV flat files, I found out the hard way that SSIS doesn't properly escape quotes (") in the data (my output file is required to have quotes as text qualifiers).

It seems like I'm pretty much forced to create derived columns to test for the existence of quotes in my data, then either escape them or replace them with another character.

This is really NOT COOL. Not only will this significantly hinder performance, it makes my packages a heck of a lot more complicated (especially when I'm exporting lots of text columns).

Am I doing something wrong, or does SSIS really not escape the text qualifier in a delimited flat file? If so, someone PLEASE tell me this will be fixed in the very near future.

View 21 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved