Forum Replies Created

Viewing 15 posts - 1 through 15 (of 623 total)

  • Reply To: process records in loop

    I don't have access into the app ...  The deletes and inserts all have same formats I showed Inserts above and the deletes

    DELETE FROM cstSums WHERE PartNbr='132883D01' AND PlantCd='CORP' AND...

  • Reply To: process records in loop

    There is an app that was sending DML requests from a SQL2016 to SQL2008, and we saw lots of issues and it could have been driver related where record locks...

  • Reply To: process records in loop

    I can easily make it a csv file for Bulk Insert and YES there will be data on the Insert statements that have:

    VALUES('967120411','864A90D40','CORP','Standard'

    Can you show me the frame work of...

  • Reply To: process records in loop

    Jeff,

    How would data being in csv be handled differently?

    Thanks.

  • Reply To: process records in loop

    thanks

    The sqltoexec are passed in sql statements like:

    INSERT INTO cstDetails (CompPartNbr,PartNbr,PlantCd,CostKey,usgQty,scrQty,totQty,UnitCost,usgCost,scrCost,totCost,StrJCost,StrMCost,SetUpQty,SetUpCost,CurrentOPRSetup) VALUES('967120411','864A90D40','CORP','Standard',0.2697,0.0043152,0.2740152,6.5,1.75305,0.0280488,1.7810988,0,0,0,0,0)

    The CrtInsert table has a PK field called ID(int)

    In the example how do I loop thru thousands of records

  • Reply To: Insert using table unput

    Thanks Brian for all of your replies. and suggestions can you look at this code and tell me if this would handle processing the table with a batchsize of 50,000...

  • Reply To: Insert using table unput

    The table will be cleared out before this new process runs, but I do need to process by ID..

    Could it multi process the table?

    Thanks

  • Reply To: Insert using table unput

    Thanks for replies and alarms of this type of approach -- defiantly something that has been discussed.

    With the approach above how it will scale when removing the where ID =1...

  • Reply To: Insert using table unput

    DECLARE @Counter INT = 1;
    DECLARE @MaxCount INT = 1; -- Set this to the number of times you want to run the insert
    DECLARE @SQLString NVARCHAR(MAX);
    DECLARE @ParmDefinition NVARCHAR(MAX);

    WHILE...
  • Reply To: Insert using table unput

    I must have something wrong as it's error'ing

    This is what a single sqlToExec where ID=1  looks like

    delete from cstSums WHERE PartNbr='81K000000' AND PlantCd='CORP' AND CostKey='Standard'

     

    Thanks for reply.

  • Reply To: Insert using table unput

    I tried this but it didn't delete record

    DECLARE @Counter INT = 1;
    DECLARE @MaxCount INT = 1; -- Set this to the number of times you want to...
  • Reply To: Insert using table unput

    The query that feeds this table is very specific (Only Insert) in what gets added to the sqltoexec can it be done without using a cursor?

    Thanks for your reply.

  • Reply To: row changes per hour by TagID

    Perfect.. Thanks.

  • Reply To: row changes per hour by TagID

    I came up with this, but not sure how to get 1 hour time frames from the data. I want to see how many times in an hour for a...

  • Reply To: row changes per hour by TagID

    Looks like if I add this in my query logic I'm getting the datetime desired

    DATEADD(s,t_stamp/1000,'1969-12-31 20:00:00')

    2024-02-01 01:00:00.000

    2024-02-01 01:00:01.000

    Struggle with doing the count of records per TagID within the hour that...

Viewing 15 posts - 1 through 15 (of 623 total)