Forum Replies Created

Viewing 15 posts - 121 through 135 (of 268 total)

  • RE: Best practice when to use an index

    Frank,

    I agree about avoiding hard coding but David's idea of recreating a stored procedure using a trigger 'gets around' hard coding the proc - not that I am suggesting you...

  • RE: Best practice when to use an index

    Just thinking off the wall for a moment, would a stored procedure with a case statment containing the values be quicker?

    If the procedure is called often, it would be cached...

  • RE: Best practice when to use an index

    If I understand things correctly, using an index is at least 2 reads - one (or more) for the index and one for the page containing the data.

    If this is...

  • RE: UpDate using T-SQL

    With ADO, I guess that you are building the update statement on the client.

    There is similar facility within SQL Server called dynamic sql. This is where you create an...

  • RE: Capturing stored procedure output into a table

    Is this what you mean?

    create proc proca as

    select column1, column2

    from table_a

    go

    create proc procb as as

    create table #temp

    (column1 varchar(50), column2 varchar(50))

    insert #temp

    exec proca

    go

    Just be aware that you cannot...

  • RE: cursor in stored procedure

    Yes although it may not be the most efficient may of processing the query. Just stick something like this in your procedure:

    declare @variable varchar(50)

    declare cursor_name cursor for

    select column

    from table

    where....

    open...

  • RE: How to match sets of records

    I've got this working:

    
    
    SELECT groupid FROM
    (SELECT groupid FROM #GROUP
    WHERE userid='id2'
    ...
  • RE: How to match sets of records

    Thanks for spending the time to explain the SQL - I really apprecicate it. However, I am still getting a syntax error.

    This is what I have in QA:

     
  • RE: How to match sets of records

    Thanks but I am really struggling to understand the SQL. There are unmatched brackets and I cannot work out what is wrong.

    I think I understand each small bit of...

  • RE: Index left(MyField,10)

    I don't think you can create an index on part of field.

    My only suggestion, without duplicating the first 10 characters, is to split the field into two columns...

  • RE: How to match sets of records

    Thanks for the SQL - it took me a little while to work out what was going on and that a zero meant a match and a non zero indicated...

  • RE: Job restart on condition

    Within the actual job, if you open up the step and select the Advanced tab, there is facility for the step to retry. You can set the number of...

  • RE: Assign a variable value based on conditions

    As a check to see whether you are in the if statements you could put in print statements in the different if conditions to see whether the code actually enters...

  • RE: How to match sets of records

    Steve,

    I agree that it is cumbersome. When I first started looking at this I thought it would be easy and I could use something like EXISTS to check for an...

  • RE: fetching a single column from cursor to a variable

    When you declare a cursor, you must fetch all the columns into variables - you cannot fetch some of the variables.

    There are a couple of other ways of doing what...

Viewing 15 posts - 121 through 135 (of 268 total)