Forum Replies Created

Viewing 15 posts - 2,311 through 2,325 (of 4,085 total)

  • RE: Looping through rows and applying a count

    I found another version. It's slower on this small dataset, but I think it will run faster on a larger dataset, because it contains one fewer sort.

    WITH play_events AS...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: How to add multiple values to a parameter

    If you know it's only ever going to be one letter, you don't need the comma if you go that route. Personally, I'd go with the table variable.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Loop over info from a table

    jcarranza 23978 (10/3/2016)


    I have a text file that will be imported into a table. Name of table is PHOTOPATH.

    The column name is photo and is an nvarchar(50). It will contain...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: DUPLICATING ROW TABLE BY A VALUE IN A COLUMN

    Since someone else recently asked that very same question, it sounds like homework.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: split string by number of characters

    Alan.B (10/3/2016)


    We have a script for exactly this kind of thing; have a look at nsplit2B which you can find here[/url].

    Here's a couple examples:

    DECLARE @myv VARCHAR(MAX) = 'AB,CD,EF,GH,IJ';

    SELECT...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Are the posted questions getting worse?

    Okay, we run our dataloads through a third party software that takes a config file with the processes to run and any parameters required for procedures. One of the...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: query to repeat insert same rows

    You can also improve your function by adding the WITH SCHEMABINDING option. Even though you're not using any physical tables, SQL checks whether the underlying tables have changed if...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Are the posted questions getting worse?

    I don't know which is scarier: that the OP never considered simply adding the columns or that the OP needs to test to determine whether it would work?

    Drew

    http://www.sqlservercentral.com/Forums/Topic1821068-3740-2.aspx

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Looping through rows and applying a count

    I would think that you would want to partition by the game ID. Presumably, the games are treated separately, and partitioning by the game ID would accomplish this.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: while and if condition within a case statement t-sql

    You're overengineering this. Simply ADD the columns

    SET Col10 = Col6 + Col7 + Col8 + Col 9

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Maximum number of CROSS APPLY functions

    I believe it falls under "Limited by available resources."

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Execution Plan Help. Enormous Increase in row count in plan

    As a clarification. ETL stand for "Extract/Transform/Load". It sounds like you are skipping the Transform part of ETL.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Execution Plan Help. Enormous Increase in row count in plan

    thomashohner (9/30/2016)


    It would have to be combination of PatientProfileID and Databaskey in the Source system its PatientProfileID as the PK but we are currently loading multiple source systems into one...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Any way to clean up mutually exclusive OR conditions?

    xr280xr (9/29/2016)


    Here's what I settled on. AllowsDeletionGracePeriod was a new column so I had to update the where clause to include it.

    DELETE FROM tbl_a

    WHERE [some additional criteria]

    AND (DeleteAsap = 1...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Case when then dateadd getdate question

    There are two variants of the CASE expression: the simple CASE expression and the searched CASE expression. You are mixing the two.

    When using the simple CASE expression, the comparison...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

Viewing 15 posts - 2,311 through 2,325 (of 4,085 total)