Forum Replies Created

Viewing 15 posts - 421 through 435 (of 2,462 total)

  • RE: Solving FIFO Queues Using Windowed Functions

    Great, great work Drew. Very well done.

    "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: Recommendation for better perfromance

    ramyours2003 (10/4/2016)


    HI

    I need recommendations for better performance of sql .we have 32bit SQL servers and want to make sure we have them configured optimally for performance. We...

    "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: Setting Up Reporting Services

    amy26 (10/5/2016)


    But the report viewer is only available "intranet" its not available on the internet... our website is public facing. The database server is not accessible from the outside....

    "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: Setting Up Reporting Services

    Part of the SSRS setup is configuring a Report Server URL. This is something you can also do after SSRS is set up. The Report Server URL is where you...

    "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: Query processing

    First, ditto everything Chris said.

    How does SQL Server handle casts in the WHERE clause?

    Not all that well. You are going to get an index scan instead 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: Syntax help please

    You could do this:

    WHERE CONVERT(DATE, Getdate())

    NOT BETWEEN TRY_CONVERT(monthbegindate, datetime) AND TRY_CONVERT(monthenddate, datetime)

    "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 to use sp_msforeachdb to create multiple table in multiple databases

    drew.allen (10/4/2016)


    You have to be careful with sp_MSforeachdb, because it will also run in the system databases. I assume that you don't really want to create these tables in...

    "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 to use sp_msforeachdb to create multiple table in multiple databases

    sp_msforeachdatabase is undocumented and overrated. That said, let's say you wanted to create a table named SomeTable in each db, you could do so like this:

    EXEC sp_msforeachdb

    '

    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: Need help to get prevoius 4 hrs data

    Perhaps something like this:

    WHERE a.start_execution_date >= DATEADD(Hour,-4,getdate())

    Edit: that's a "greater than or equal" sign above, it keeps messed up when I post.

    "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: split string by number of characters

    drew.allen (10/3/2016)


    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';...

    "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: split string by number of characters

    Luis Cazares (10/3/2016)


    Hi Alan, you're still missing the GetNumsAB definition. I'd be interested on checking out how everything works. 🙂

    getnumsAB

    CREATE FUNCTION dbo.GetNumsAB

    (

    @low bigint,

    @high bigint,...

    "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: split string by number of characters

    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 *...

    "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: SSRS Print Button in Chrome Not Working (Browser Comaptibility)?

    Was this fixed in SSRS 2016?

    It appears to be but I have not tested it. In BOL, for SSRS versions 2014 and earlier, it explicitly says for Chrome, "Printing and...

    "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: Maximum number of CROSS APPLY functions

    ok, quick update. There does not seem to be a limit (I know you can do 2048 for sure).

    For fun, play around with this code:

    -- one time setup

    USE...

    "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: Maximum number of CROSS APPLY functions

    I was curious about this too and did a little research. There appears to be absolutely nothing about this out there about APPLY. Since APPLY is very similar to 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

Viewing 15 posts - 421 through 435 (of 2,462 total)