Forum Replies Created

Viewing 15 posts - 1,471 through 1,485 (of 2,462 total)

  • RE: Get the maximum Row number for the duplicate valued rows

    Ditto everything Jason said. Some DDL and an example of what you are doing/trying to do would help.

    Perhaps you can use this code as an example of 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: SQL 2012 table read performance

    20 GB seems rather large for a table with 4000 rows even with the max data types, and especially since your clustered index and 1-column non clustered index is taking...

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

    TJT (5/19/2015)


    Sorry, I should have provided more information. The IP Addresses could be any IP addresses.

    I was trying to use REPLACE with RIGHT statement

    Ok, by "any IP address" what...

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

    Luis Cazares (5/19/2015)


    Alan.B (5/19/2015)


    You could do this:

    DECLARE @ipaddresses TABLE (ip varchar(30));

    INSERT @ipaddresses VALUES

    ('175.139.45.127'),

    ('175.139.45.12'),

    ('175.139.45.1'),

    ('10.10.10.100'),

    ('10.10.10.10'),

    ('10.10.10.1');

    SELECT ip = PARSENAME(ip,1)+'.'+PARSENAME(ip,2)+'.'+PARSENAME(ip,3)+'.0'

    FROM @ipaddresses

    Alan, that's cheating. You didn't test your code. 😛

    I guess I didn't :blush:

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

    You could do this:

    DECLARE @ipaddresses TABLE (ip varchar(30));

    INSERT @ipaddresses VALUES

    ('175.139.45.127'),

    ('175.139.45.12'),

    ('175.139.45.1'),

    ('10.10.10.100'),

    ('10.10.10.10'),

    ('10.10.10.1');

    SELECT ip = PARSENAME(ip,1)+'.'+PARSENAME(ip,2)+'.'+PARSENAME(ip,3)+'.0'

    FROM @ipaddresses

    "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: Transactional database or Datawarehouse?

    Always this:

    I want to find out if this is a good idea or I should design a transactional database for the application and a Data warehouse separate for 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: a simple join

    Angel DBA Mex (5/19/2015)


    thanks SSC-Insane

    but already I´ve found the mistake, it is when the information has imported from a txt file, this has a special character, Char(13), Char(10),...

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

    Or something like

    ON

    (Project_Code = Manager.Code AND Project_Code <> '')

    OR

    (Project_Code = '' AND Project_cost_center = Manager.Code)

    "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 optimise the performance of the reports

    Avoid ad-hoc sql and use stored procs to drive your ssrs data. Faster queries mean faster reports; tune your queries - make em fast.

    For your slowest reports consider...

    "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: Case Sensitive Collation Causing Cardinality Warning

    Jason A. Long (5/18/2015)


    Alan.B (5/18/2015)


    I'm not 100% sure about this and hope someone corrects me if I'm wrong...

    If the collation that the table is stored in is Case Insensitive then...

    "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: QUESTION ABOUT MULTIPLE EXCEPT STATEMENTS

    In Ben-Gan's T-SQL Fundamentals 2012 (Ch. 6) he dedicates a whole chapter to set operators. I would encourage anyone to trying to get a grasp on this topic 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: Enable Report User to Bookmark Report with selected Parameters

    Use the parameters to create the URL like you specified and a message or something on how to create a bookmark, favorite, whatever using that string (that's just me thinking...

    "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: To get Top 10

    Note the article in my signature about how to best get help here. Sample data and some DDL would really help. That said...

    This wont be too hard: the solution will...

    "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: Case Sensitive Collation Causing Cardinality Warning

    I'm not 100% sure about this and hope someone corrects me if I'm wrong...

    If the collation that the table is stored in is Case Insensitive then you use a Case...

    "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: implicit conversion failure varchar to numeric using DelimitedSplit8K function

    Make org_id an int.

    declare @invoice table (inv_id int,inv_amt money,org_id int /*numeric(10,0)*/)

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