Forum Replies Created

Viewing 15 posts - 1,006 through 1,020 (of 2,462 total)

  • RE: Iterate though Sub OU of main OU

    It's been awhile since I wrote an LDAP query...

    If you can post some sample data for what of #tempAD I'm sure I can help 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: Display numeric as empty string based on condition

    Luis beat me to it. Note the code/comments below.

    DECLARE @table TABLE (NumericColumn int);

    INSERT @table VALUES (1),(2),(-999);

    -- This WONT work because blanks on numeric columns are returned as 0's

    SELECT NumericColumn...

    "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 for VARCHAR field

    SQL!$@w$0ME (2/17/2016)


    Thanks.

    For VARCHAR [varchar(MAX) & varchar(800] fields on two different tables. This fields are intended to use in WHERE CLAUSE (using 'like').

    You can't add a nonclustered index with a varchar...

    "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: SQL Query to Extract after 2nd - in a field

    trvlbabie (2/16/2016)


    When I add the line: SUBSTRING(String, 10, 5)

    It is giving me the following error: SQL API: [SQLExecDirectW], SQL RETURN: [-1], SQL STATE: [42000], SQL NATIVE ERROR:...

    "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?

    djj (2/16/2016)


    Alan.B (2/16/2016)


    Lynn Pettis (2/16/2016)


    The real problem is that those that govern have forgotten who are the masters and who are the servants. Government is supposed to the servants...

    "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: Windows Functions: Tell me when that changes.

    hartmann 74688 (2/17/2016)


    Just to make it clear, they are windowing functions or window functions.

    Windows functions sounds like API of the OS :).

    Good Article, great reminder!

    I noticed that too (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: I want to automate my database compression , can anyone provide me the T sql code...

    Note the section titled "Using Transact-SQL" in this link: Enable Compression on a Table or Index

    "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: Return multiple values in a one column preformatted string

    If there is a possibility that OccurrenceTypeName will contain any of what SQL Server considers XML characters (e.g. CHAR(1) through CHAR(32), CHAR(38), CHAR(60) or CHAR(62)) then you would make 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: Replace Cursor with alternative solution

    There is no reason you should need a cursor here or any other form of RBAR solution for this. Based on a quick look at what you're trying to do...

    "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 for VARCHAR field

    SQL!$@w$0ME (2/16/2016)


    Hi Folks:

    For VARCHAR field, non-clustered index or full-text index recommended. When should we use full-text index.

    Any guidance/thoughts much appreciated.

    Many thanks!

    Why do you think you need any index on 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: Reports taking too much time from application

    EasyBoy (2/16/2016)


    We have few (2-3) reports which are run by users through application everyday in the morning.

    Through SQL profiler i found those queries (dynamic SQL), which are running through SQL...

    "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: SQL Query to Extract after 2nd - in a field

    and most people helping on forums aren't being paid

    Huh?!?! I just thought my SSC paycheck was really late. Aw man!

    "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?

    Lynn Pettis (2/16/2016)


    The real problem is that those that govern have forgotten who are the masters and who are the servants. Government is supposed to the servants of 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: Datetime Parameter Default

    Luis Cazares (2/16/2016)


    For this particular case, there's a simpler solution using common date routines[/url]

    SELECT

    StartTime = DATEADD(DD, DATEDIFF(DD, 0, GETDATE()), -.25), -- 6PM yesterday

    EndTime ...

    "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: Datetime Parameter Default

    I prefer to use T-SQL for this type of thing. The way I would do this is:

    1) Create a Dataset named something like DS_DateDefaults (use whatever matches your naming convention)

    2)...

    "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 - 1,006 through 1,020 (of 2,462 total)