Forum Replies Created

Viewing 15 posts - 106 through 120 (of 268 total)

  • RE: delta processing: alternative to cursor

    Jay,

    This is the code for the set based update statement:

    declare @row int, @increment int, @start datetime, @update_count int

    set @start = getdate()

    set @row = 1

    set @increment = 5000

    set @update_count = 0

    set...

  • RE: delta processing: alternative to cursor

    I've been doing exactly the same over the last couple of days - trying to replace a cursor based update process with a set based process.

    So far I am not...

  • RE: Importing data from txt file and updating Table

    If it is a simple replace all the content of the row with the new content, then you might consider deleting the row and then inserting the row. Performance...

  • RE: How to remove leading zeros?

    How about using the length of the second column a the integer value in a right expression?

    select a.col1...

    from table_a left join table_b

    on right(table_a.col1,length(table_a.col1)) = table_b.col1

    ....

    If you have any trailing...

  • RE: Importing data from txt file and updating Table

    Something like this (Check it out in BOL):

    update <master_Table>

    set col1 = <temporary_table>.col1, col2 = <temporary_table>.col2 ....

    from <master_table>, <temporary_table>

    where <master_table>.<primary_key> = <temporary_table>.<primary_key>

    I don't think you acutally...

  • RE: Importing data from txt file and updating Table

    A couple of extra points.

    1. Do the updates before the inserts otherwise you end up updating the rows you have just inserted.

    2. If you have 500K rows to...

  • RE: Importing data from txt file and updating Table

    One way is to import the file into a temporary table and then process that temporary table to insert or update records in the master table.

    Depending on how complex the...

  • RE: CMDEXEC job PRIORITY

    You can execute the file directly from a job (with the type set to Operating System Command):

    start /normal <file_name> <parameters>

  • RE: need a group by that concatenates data

    You might try seomthing like this:

    /* User Defined Function to concatentate data */

    create function [dbo].[fn_ListOfConditions] (@patientid varchar(25) )

    returns varchar(255) as

    begin

    declare @string varchar(255)

    set @string = ''

    select @string = @string + vchrDesc...

  • RE: view instead of cursor

    If you want a single row at a time you can do this:

    declare @string varchar(255), @col1_value varchar(25)

    set @string = ''

    set @col1_value = 'A'

    select @string = @string + col2 + '...

  • RE: need a big help-how to send an eamil from mail lis

    Ilan,

    I think what you want to do it to create a single variable with a list of users and then set that as @recipients.

    Try this:

    declare @recipient varchar(1000)

    set @recipient = ''

    select...

  • RE: Output from dynamic sql

    Thanks a lot.

    Jeremy

  • RE: Returning parameters and variables in SPs

    You can use @@rowcount to determine the number of rows affected by update statement.

    You might want to put the value of @@rowcount into another variable as it may change with...

  • RE: Find second highest

    Greg,

    What's the best way of making your code dynamic? I tried declaring a variable so that the query became:

    declare @n int

    set @n = 76

    select top 1 salary from

    (select...

  • RE: something similar to forking a separate process

    One way to do this is to use a job. The user would initiate the job which would complete the user's transaction but the job would continue until it...

Viewing 15 posts - 106 through 120 (of 268 total)