Re: Execution Plan Hinting



Not sure if this will reproduce it, but it's all I've got. It may give
someone a hint at what is going wrong. Thanks in advance.

I couldn't recreate your problem running this script from Query Analyzer.
Create a script that demonstrates the problem in your environment and then
post it here. If the error only occurs from your application, try Erland's
suggestion to use Profiler.

truncate table field_values
bulk insert field_values from 'c:\274.dat' with (FORMATFILE='c:\fa.txt');
begin tran
delete from field_values;-- where dealer_data_id = 274;
bulk insert field_values from 'c:\274.dat' with
(FORMATFILE='c:\fa.txt');
commit


--
Hope this helps.

Dan Guzman
SQL Server MVP

"Ryan" <ryanofford@xxxxxxxxxxx> wrote in message
news:1142258815.563405.76180@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
{ ADO.BEGINTRANS }
delete from field_values where dealer_data_id = 274;
bulk insert field_values from '274.dat' with ('fa.txt');
{ ADO.COMMIT }
// Note there is no rollback on failure.

10-13:20:33.781xxx0863 Tdm.BulkInsert field_values from
C:\WINNT\TEMP\HZSSTWZG1204493500.dat with
(C:\WINNT\TEMP\XMROGIKB1204493500.dat)
10-13:20:33.781 ExecSQL.Exception caught by TSafeADOQuery Violation of
PRIMARY KEY constraint 'PK_FIELD_VALUES'. Cannot insert duplicate key
in object 'FIELD_VALUES'
10-13:20:33.781 xxx863 Tdm.BulkInsert Exception EAccessViolation
(Access violation at address 004BE971 in module
'xxxxxxxxServer_Srvs_12.exe'

fa.txt
-------
8.0
4
1 SQLCHAR 0 0 "|" 1 dealer_data_id ""
2 SQLCHAR 0 0 "|" 2 field_code ""
3 SQLCHAR 0 0 "|" 3 field_value ""
4 SQLCHAR 0 0 "\r\n" 4 changed_type ""


sample data from 274.dat
-------------------------------------

274|S01|1.00000|0
274|S02|0.00000|0
274|S03|0.00000|0
274|S04|0.00000|0
274|S05|0.00000|0
274|S06|1.00000|0
274|S07|0.00000|0
274|S08|0.00000|0
274|S09|0.00000|0
274|S10|0.00000|0
274|S11|0.00000|0
274|S12|0.00000|0
274|S13|0.00000|0
274|S14|0.00000|0
274|S15|0.00000|0
274|S16|0.00000|0
274|S17|0.00000|0
274|S18|0.00000|0
274|S19|0.00000|0
274|S20|0.00000|0
274|S21|0.00000|0
274|S22|0.00000|0
274|S23|0.00000|0
274|S24|0.00000|0


DDL
---------

if exists (select * from dbo.sysobjects where id =
object_id(N'[dbo].[FIELD_VALUES]') and OBJECTPROPERTY(id,
N'IsUserTable') = 1)
drop table [dbo].[FIELD_VALUES]
GO

CREATE TABLE [dbo].[FIELD_VALUES] (
[DEALER_DATA_ID] [int] NOT NULL ,
[FIELD_CODE] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT
NULL ,
[FIELD_VALUE] [numeric](15, 5) NULL ,
[CHANGED_TYPE] [int] NULL
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[FIELD_VALUES] WITH NOCHECK ADD
CONSTRAINT [PK_FIELD_VALUES] PRIMARY KEY CLUSTERED
(
[DEALER_DATA_ID],
[FIELD_CODE]
) WITH FILLFACTOR = 90 ON [PRIMARY]
GO


Not sure if this will reproduce it, but it's all I've got. It may give
someone a hint at what is going wrong. Thanks in advance.

Ryan



.



Relevant Pages

  • Re: This code do not work in IE?
    ... But with Firfox and Opera there is no problem running the code. ... Any hint why? ... IE allows you to create most elements with createElement but is a bit picky about other actions like appendChild or setting innerHTML when it comes to script or style elements. ... You should be able to set the text property of script elements in IE, Opera, Mozilla e.g. ...
    (comp.lang.javascript)
  • Quest for HEX Strings
    ... maybe somebody can give me a hint how to solve this Problem. ... write a script that can recover files from malformed Mails. ... Now I want to create a script wre I can automate this task. ... will place all the Header to an Array and than I want to grep for them ...
    (de.comp.lang.perl.misc)
  • Re: Debian MySQL Perl DBI - connection terminates unexpectedly after 100 secs.
    ... I rather guess it was a gentle hint that your problem description ... to catch e.g. script that run in an endless loop. ... If you are using Apache it might be a RLimitCPU ... files of the web server will give you some more hints. ...
    (comp.lang.perl.misc)
  • Re: Debian MySQL Perl DBI - connection terminates unexpectedly after 100 secs.
    ... Or am I running out of memory. ... I rather guess it was a gentle hint that your problem description ... to catch e.g. script that run in an endless loop. ... If you are using Apache it might be a RLimitCPU ...
    (comp.lang.perl.misc)
  • Re: Debian MySQL Perl DBI - connection terminates unexpectedly after 100 secs.
    ... Or am I running out of memory. ... I rather guess it was a gentle hint that your problem description ... to catch e.g. script that run in an endless loop. ... If you are using Apache it might be a RLimitCPU ...
    (comp.lang.perl.misc)