Forum Replies Created

Viewing 15 posts - 811 through 825 (of 2,458 total)

  • RE: FK and Index

    I would take a look at this book: Performance Tuning With SQL Server Dynamic Management Views. It will help you put together scripts you can use to determine which FK...

    "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: Recording data in an .xml file to SQL server for tracking

    I would add:

    You'll want to learn first how to import the XML data which should be pretty easy. Then how to save it as relational data - meaning that it's...

    "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: Reaping the benefits of the Window functions in T-SQL

    Eirikur Eiriksson (4/22/2016)


    Alan.B (4/22/2016)


    Nice to see this article again. Still awesome!:-P

    Thanks Alan! When are you going to do a piece about your interesting work?

    😎

    Very soon sir, I have a few...

    "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: Reaping the benefits of the Window functions in T-SQL

    Nice to see this article again. Still awesome!:-P

    "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: Mondays and Sundays of the month

    You can get rid of this statement:

    drop table #tmp_datesforMonthAM

    "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: Recording data in an .xml file to SQL server for tracking

    First, welcome to SQLServerCentral. This sounds like fun.

    What you want to do sounds simple and easy. A few questions:

    1. Do you have an MS SQL Server you can use? If...

    "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: More TRY_CONVERTing numbers

    I said 2. What is wrong with 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: stored procedure parameter issue

    John Rowan (4/21/2016)


    This is a pretty simple task if I'm reading your requirements correctly. Before we all do the work for you, can you show us what you've tried...

    "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: Building BI from Scratch!

    singhamitpal (4/20/2016)


    Thanks everyone for your responses, my intentions was not to offend anyone here. Just needed a direction in picking the right path. Thanks for sharing your knowledge &...

    "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: Max value in Case Statements

    Con Alexis (4/20/2016)


    I'd probably use a CROSS APPLY in this instance...

    e.g.

    WITH Data AS

    (

    SELECT 1 AS ID, '1/1/1900' AS Date

    UNION ALL SELECT 2, '1/1/1900'

    UNION ALL SELECT 3, getdate()

    UNION ALL SELECT 4,...

    "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: Max value in Case Statements

    drew.allen (4/20/2016)


    Is there some reason that you chose to use CROSS APPLY rather than CROSS JOIN? I tend to only use CROSS APPLY if the right side is somehow...

    "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: Max value in Case Statements

    Some people beat me to it but this was my test:

    SET NOCOUNT ON;

    CREATE TABLE #temp (ID int identity primary key, [Date] DATE NOT NULL);

    CREATE INDEX dt ON #temp([date]);

    INSERT INTO...

    "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: Max value in Case Statements

    Luis Cazares (4/20/2016)


    A different version.

    WITH Table1(ID,Date) AS

    (SELECT ID,Date FROM (

    VALUES

    (1 ,'1/1/1900')

    ,(2 ,'1/1/1900')

    ,(3 ,getdate() )

    ,(4 ,Getdate() )

    ) AS X(ID,Date))

    SELECT

    T1.ID

    ,T1.Date

    ,CASE

    WHEN...

    "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: CONCAT

    Nice one.

    "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: maintance plan vs Sql job

    Simpy put - when you create a maintenance plan and schedule it you are creating a new SQL Agent Job that runs your "maintenance plan" at a time of your...

    "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 - 811 through 825 (of 2,458 total)