Forum Replies Created

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

  • 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

  • RE: How to remove special characters like ~,? from column value in a string

    This is a job for patexclude8K.

    CREATE FUNCTION dbo.PatExclude8K

    (

    @String VARCHAR(8000),

    @Pattern VARCHAR(50)

    )

    /*******************************************************************************

    Purpose:

    Given a string (@String) and a pattern (@Pattern) of characters to remove,

    ...

    "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: Cursors for SQl server

    As others said, more details: good, cursor for this: bad.

    It sounds like you can accomplish what you are trying to do with two update statements.

    "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: Create SSRS reports on my Workstation

    For a great tutorial try the Stairway to SQL Server Reporting Services[/url] right here on SSC.

    "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: Parameter Problem

    Using this DDL and sample data:

    USE tempdb

    GO

    CREATE TABLE dbo.[ACTION]

    (

    actionid int not null,

    actionvalue varchar(100) not null

    );

    CREATE TABLE dbo.ACTIONRESULT

    (

    resultid int primary key,

    actionid int 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

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