Forum Replies Created

Viewing 15 posts - 331 through 345 (of 2,462 total)

  • RE: Issue with column parsing

    mcfarlandparkway (12/27/2016)


    Set based approach? How to do this?

    How to parse(split) this 9000430944:7|Information

    -> 9000430944 - emp number

    -- 7 - stud number

    --Information - Description

    How to split on pipe? and How to...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Filtered Index, Getting 'Created failed for Index"

    comic_rage (12/27/2016)


    Hi,

    Thanks for the input, is this correct approach,

    In my VIEW, vMyTable

    select col1,

    isnull(column50,1) as column50,

    column51

    from dbo.MyTable

    where Column50 = 1

    In the MyTable indexes, I added the following script

    create nonclustered index ixIndex_Column50...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: I am very new to SQL

    I'm with Jeff, there is no substitute for T-SQL expertise and database design. SQL Server Developer edition (2014 and 2016) is identical to SQL Server Enterprise except that you can't...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Index with leading BIT column

    I don't see any problem with using a leading bit column for an index. I can think of many more examples where it would be appropriate as part of a...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Find the maxId and update the ID by 1 when a null is found

    First some sample data:

    USE tempdb; -- a safe place for testing on a dev/sandbox instance

    GO

    -- create table for storing sample data

    CREATE TABLE dbo.TableA

    (

    AssetName nvarchar(50),

    AssetID...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Creating a small banking datawarehouse

    First, Welcome - you've definately come to the right place. SQLServerCentral.com is a goldmine.

    Ditto everything Eric said. I would also highly recommend:

    Star Schema The Complete Reference

    Next, regarding the...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Very Large Transaction Causing Error 'Attempting to set a non-NULL-able column's value to NULL'

    I've always found that error to be misleading and is usually a result (in my experience anyhow) of not including a record for a non-nullable column. This will give me...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Are the posted questions getting worse?

    Me: "OK, I'll do it. You don't have to keep reminding me every 6 months!"

    Unfortunately the wife and I don't always find the same things funny. :ermm:

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Desing of a table and Hirerarchy - IP's

    Welcome to SSC!

    I'm still not 100% clear on what the output should look like and this solution might not be complete but it's a start...

    DECLARE @sampledata TABLE(ip varchar(12) NOT...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: How do I use 'DECLARE' from SQL query in SSRS 2012?

    NewSSAS (12/12/2016)


    Thanks Alan. I appreciate your explanation and I agree with you.

    It worked when I removed the DECLARE and Set from the query and I am trying to set the...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: How do I use 'DECLARE' from SQL query in SSRS 2012?

    Yes - this logic should be put into a stored proc. What the stored proc looks like will depend on what you are doing with @Current_College_year & @Prior_College_year.

    If these...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Let the optimizer do it's thing -- wrong

    Indianrock (12/9/2016)


    I've heard this advice everywhere. Don't do things to change the way the sql optimizer produces plans etc. "it's smart so don't use plan guides, query hints,...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Anti Join question

    sgmunson (12/8/2016)


    Alan.B (12/8/2016)


    Ok, say I have two tables table1 and table2 and I want to find records from table1 that don't exist in table2 or vise-versa. I could use EXCEPT...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Anti Join question

    That FULL JOIN solution was what I'd seen before - The HAVING solution works just as well. Excellent work, thanks Luis!

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

  • RE: Concatenate fields with separator character using XML PATH

    On a similar note, I really like CONCAT (available for SQL Serve 2012+) because it's cleaner and circumvents the need to do any casting/converting when dealing with numbers.

    DECLARE @table...

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

Viewing 15 posts - 331 through 345 (of 2,462 total)