Forum Replies Created

Viewing 15 posts - 4,231 through 4,245 (of 7,597 total)

  • RE: Split AlphaNumeric

    Assuming you want to split first by a space, but if there's no space then by dash:

    SELECT value, LEFT(value, ISNULL(NULLIF(CHARINDEX(' ', value), 0), CHARINDEX('-', value) - 1)) AS split_value

    FROM (

    ...

  • RE: SP with 3 parameters as delimited list - Goal 500 milliseconds

    If you:

    1) always, or

    2) almost always, or

    3) most critically

    search these tables using RECORD_TYPE_CD, as in this query, then you should cluster those tables first on RECORD_TYPE_CD. That...

  • RE: SP with 3 parameters as delimited list - Goal 500 milliseconds

    If you:

    1) always, or

    2) almost always, or

    3) most critically

    search these tables using RECORD_TYPE_CD, as in this query, then you should cluster those tables first on RECORD_TYPE_CD. That...

  • RE: Concatenate strings

    Jeff Moden (7/1/2016)


    ScottPletcher (7/1/2016)


    I still say don't explicitly code it unless the code requires it (some system procs require unicode strings specifically, for example), because it can cause performance...

  • RE: Concatenate strings

    Jeff Moden (7/1/2016)


    Agreed... and the catch here is that if this happens, what else could happen? If you use the "N" prefix for the literals whenever NVARCHAR is used,...

  • RE: Concatenate strings

    Sergiy (6/30/2016)


    ScottPletcher (6/30/2016)


    Jeff Moden (6/24/2016)

    Shifting gears a bit and depending on how that's used, it could become a performance problem due to the implicit conversions of the string literals. ...

  • RE: Concatenate strings

    Jeff Moden (6/24/2016)

    Shifting gears a bit and depending on how that's used, it could become a performance problem due to the implicit conversions of the string literals. Since @database2...

  • RE: Update 1 of 3 tables based on parameter

    Jeff Moden (6/28/2016)


    David92595 (6/28/2016)


    @jeff

    Because I inherited this database and the person that made it thought in spreadsheets not relational tables.

    @scott

    Thank you! Are their any other good ways to stop a...

  • RE: Update 1 of 3 tables based on parameter

    David92595 (6/28/2016)


    @jeff

    Because I inherited this database and the person that made it thought in spreadsheets not relational tables.

    @scott

    Thank you! Are their any other good ways to stop a sql injection?...

  • RE: Update 1 of 3 tables based on parameter

    As a quickie "solution", for now, something like this:

    SET ANSI_NULLS ON;

    SET QUOTED_IDENTIFIER ON;

    GO

    ALTER PROCEDURE <proc_name>

    @ID int,

    @State varchar(30),

    @ColumnName varchar(100),

    @NewValue datetime

    AS

    SET NOCOUNT ON;

    IF @State LIKE '%[;]%' OR @ColumnName LIKE '%[;]%' OR @NewValue...

  • RE: What's the reason?

    Or the object(s) could be in a schema that is not the default schema, since the q is written as:

    DROP TABLE table1

    rather than

    DROP TABLE schema_name.table1

    Almost certainly not the answer the...

  • RE: Return string between 2 characters from the end of the string

    Sorry if this overlaps already-posted code, was busy for a long while before I was able to get back to working on this:

    SELECT string, CASE WHEN next_to_last_space = 0 THEN...

  • RE: Column Matching.

    SELECT

    T.CallQueue, T.ReportQueue, T.ServiceLevel,

    CASE WHEN T.ServiceLevel = T.Threshold1 THEN C.Segment1

    WHEN T.ServiceLevel = T.Threshold2...

  • RE: Using data windows in 650M rows table

    What's really critical here is how the 680MrowsTable is clustered. Best for what you are doing here would be ( CustomerId, ACTdatetime ). If this is typical of...

  • RE: Performance difference with filter index and with out filter index

    If UAN is how you do lookups and, especially, joins, then you'd probably get better overall performance by clustering the table on UAN rather than on an identity column. ...

Viewing 15 posts - 4,231 through 4,245 (of 7,597 total)