Forum Replies Created

Viewing 15 posts - 4,921 through 4,935 (of 15,381 total)

  • RE: Since Triggers are a contentious subject, can someone please tell me if mine is written correctly?

    I don't see anything wrong with the code. I would however point out that what you are doing is very brittle. You are storing aggregate data from one table in...

  • RE: Split row into columns

    rhythmk (5/13/2014)


    With the help of Eirikur Eiriksson's code.You acn try this.

    ;WITH test

    AS

    (SELECT POLICY_DETAILS_ID,HISTORY_ID,CODE_ID,

    ROW_NUMBER() OVER(PARTITION BY POLICY_DETAILS_ID,HISTORY_ID ORDER BY code_id) AS rn

    FROM @POLHIST)

    SELECT POLICY_DETAILS_ID,HISTORY_ID,

    MAX(CASE WHEN rn = 1 THEN code_id...

  • RE: Are the posted questions getting worse?

    Ed Wagner (5/12/2014)


    Stefan Krzywicki (5/12/2014)


    TomThomson (5/12/2014)


    Ed Wagner (5/12/2014)


    Sean Lange (5/12/2014)


    Lynn Pettis (5/12/2014)


    Sean Lange (5/12/2014)


    Ed Wagner (5/12/2014)


    It sure is nice to hear that others remember the old "alt codes". I...

  • RE: Join Multiple Tables

    Hi and welcome to the forums. In order to help we will need a few things:

    1. Sample DDL in the form of CREATE TABLE statements

    2. Sample data in the form...

  • RE: error : supquery returned more than 1 value

    We could probably look at reworking this entirely so that it is set based instead inside a while loop. That would increase the performance greatly and would eliminate all the...

  • RE: Moving Queries for access to SQL

    jdasilva (5/12/2014)


    I'm still missing something. What if I need to go back and edit the stored procedure? How do I get back to it?

    I had hit hte execute...

  • RE: Moving Queries for access to SQL

    jdasilva (5/12/2014)


    Sean Lange (5/6/2014)


    jdasilva (5/6/2014)


    How does SQL get the value of the variable from the form in access?

    In the example I am working on, I am polling the data for...

  • RE: If Else or similar in the WHERE clause section

    mattech06 (5/12/2014)


    The performance seems fine, I'll test it with our biggest client tomorrow but I'll note your comments/links anyway for future ref, thanks.

    Make certain you read that article. It is...

  • RE: If Else or similar in the WHERE clause section

    Here is another way.

    where (@userParam = 'No Group' and pg.ProGroup IS NULL)

    OR

    pg.ProGroup = @userParam

    The problem with this approach is the query plan may need to be different depending on the...

  • RE: Can anyone clarify a PATINDEX phrase?

    SQLalchemy (5/12/2014)


    Can someone tell me what this phrase is doing? Found it in some code I'm inheriting:

    WHEN PATINDEX ('%[^0-9-]%', @Num) = 0

    It is a regular expression...or as close as t-sql...

  • RE: Are the posted questions getting worse?

    Lynn Pettis (5/12/2014)


    Sean Lange (5/12/2014)


    Ed Wagner (5/12/2014)


    Sean Lange (5/12/2014)


    paul.knibbs (5/12/2014)


    You can always use good ol' Character Map that ships with Windows to grab the symbol--bit of a pain, but it...

  • RE: Are the posted questions getting worse?

    Ed Wagner (5/12/2014)


    Sean Lange (5/12/2014)


    paul.knibbs (5/12/2014)


    You can always use good ol' Character Map that ships with Windows to grab the symbol--bit of a pain, but it works well enough. Main...

  • RE: Are the posted questions getting worse?

    paul.knibbs (5/12/2014)


    You can always use good ol' Character Map that ships with Windows to grab the symbol--bit of a pain, but it works well enough. Main issue is that you...

  • RE: Split row into columns

    Another way to do this is by using a cross tab. I used Erikur's data as a starting point. This will be better performance wise because it doesn't have to...

  • RE: some UDF FUnction help, please....

    I assume your temp table is a persistent table in your actual system? something like this?

    CREATE FUNCTION dbo.MyInlineTableValueFunction()

    RETURNS TABLE WITH SCHEMABINDING AS

    RETURN

    select Distinct UniqueID, RecordingDate

    --, ROW_NUMBER() over (Partition by...

Viewing 15 posts - 4,921 through 4,935 (of 15,381 total)