Forum Replies Created

Viewing 15 posts - 4,141 through 4,155 (of 5,109 total)

  • RE: Getting data based on group

    The following works:
    WITH Groups AS(
      SELECT GG.groupname,
        GT.guidREP,
        GG.guidID
      FROM GuidGroup GG
       JOIN GuidTable GT ON GG.guidID = GT.guidID)
    SELECT G.groupname,

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • RE: Getting data based on group

    Ok, what would you return if a GROUP had 3 GUID's related to it, of which 1 had a value of NULL?

    Say for example Guid1 had a value...

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • RE: Getting data based on group

    Thanks for providing DDL and sample data. Can you explain why group 1 returns Alex twice, and group 2 John? What is your logic?

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • RE: Performance of Temp table vs Variable Table in a Procedure

    That

    GilaMonster - Friday, March 3, 2017 3:14 AM

    Thom A - Friday, March 3, 2017 3:10 AM

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • RE: Performance of Temp table vs Variable Table in a Procedure

    John Mitchell-245523 - Friday, March 3, 2017 3:00 AM

    Yes, lack of statistics on table variables is likely to lead to inappropriate memory...

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • RE: Performance of Temp table vs Variable Table in a Procedure

    Table variable aren't great. Regardless of how many rows you're going to INSERT into them, the query planner will always estimate the number of rows within the table as 1....

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • RE: TSQL help pl

    I would firstly get your data into something of a usable format. I've used a WITH statement, but I advise actually updating your table structure. I'm also assumed that the...

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • RE: Drop Database bug?

    Testing the following on both SQL Server 2016 Dev (Windows 10), and SQL vNext (Ubuntu 16.04.2) returns what I would expect:
    Msg 208, Level 16, State 1,...

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • RE: Are the posted questions getting worse?

    Hugo Kornelis - Thursday, March 2, 2017 8:45 AM

    Who is General Failure, and why is he reading my hard disk?

    This reminded...

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • RE: Disable and enable foreign key constraints

    chandrika5 - Thursday, March 2, 2017 8:52 AM

    My situation is similar. I have a good number of inactive users that need...

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • RE: CREATING A NEW TABLE FROM AN EXISTING TABLE

    ExhibitA - Thursday, March 2, 2017 8:40 AM

    Hi I used 

    select* 
    into new_table
    from old_table 

    But received this warning :

    Warning: Null value is eliminated by an...

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • RE: CREATING A NEW TABLE FROM AN EXISTING TABLE

    Try:
    USE [WorkLSC];
    GO
    SELECT *
    INTO [DBO.T_NEWTABLE]
    FROM [WorkLSC].[dbo].[vw_OLDTABLE];
    GO

    Note, however, it is terrible practice naming a table with the prefix "DBO.". I would suggest...

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • RE: Evaluating a Text Expression based on Values from another table

    Fixed, but i am no reformatting my code again... SSC can fix the pasting >_<
    CREATE TABLE #Metrics (MetricID VARCHAR(5),
            MetricDate DATE,
            MetricValue...

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • RE: Evaluating a Text Expression based on Values from another table

    Well... I have a solution, it's dirty, it's not pretty,it's probably got an hideous query plan, but for the 2 examples you gave, it works. If you ever have more...

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • RE: Disable and enable foreign key constraints

    I actually wonder why you would want to delete it in the first place anyway. If it's a foreign key, then those other tables are relying on it for referential...

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

Viewing 15 posts - 4,141 through 4,155 (of 5,109 total)