Forum Replies Created

Viewing 15 posts - 6,511 through 6,525 (of 8,731 total)

  • RE: If I understand Views VS Functions correctly...I should use views to enapsulated commonly used where clauses?

    Phillip.Putzback (5/2/2014)


    Maybe I should simplify it. Let's say you need to report on Midwest states in many reports, ETLS, or stored procedures... Would it not be easier to have a...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: t-sql start position of number value in a string

    You could start by posting the correct information. The values that you posted can't be stored in an int column. You have either the incorrect column or the incorrect logic....

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: t-sql start position of number value in a string

    djj (5/2/2014)


    I believe you are looking for CHARINDEX with [0-9][0-9][0-9].

    Something like:

    SUBSTRING(yourvalue, CHARINDEX('[0-9][0-9][0-9]',yourvalue), lengthyourvalue)

    Note this is not tested.

    CHARINDEX doesn't accept wildcards, that why we need to use PATINDEX.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: t-sql start position of number value in a string

    Are you looking for something like this? Or what is your expected output?

    WITH SampleData AS(

    SELECT 'xxIN187 13-14 W Elem' CalendarId UNION ALL

    SELECT...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Outer Join performance

    Real column names or data don't matter. Real data types matter and the structure of the data as well to be sure that we can give an accurate solution.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Performance issues in FULL recovery model?

    pooyan_pdm (4/30/2014)


    well, in some cases it could have some performance impact depending on the workload, disk subsystem,...assuming you've also set the log backup jobs on your databases, but this...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: How to modify these procedure for my input is null or zero

    It took me a while to go through your code to figure out what it was doing.

    As stated before, you just need to add a default to your parameter. But...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Performance issues in FULL recovery model?

    Grant Fritchey (4/30/2014)


    There is a tiny impact on performance because you're using resources to backup the logs. But it's really tiny. If you're already at 99% resource usage, adding this...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Outer Join performance

    rock.liu (4/30/2014)


    can you use this one ?

    SELECT a.BoxId, b.field1 as value1, c.field1 as value2, d.field1 as value3, e.field1 as value4

    FROM boxes a

    cross apply (select top 1 b.field1 from widgets b...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Min and Max Number from string

    The Pattern Splitter made by Chris Morris is able to help you in this situation. You can read about it in this article: http://www.sqlservercentral.com/articles/String+Manipulation/94365/

    And you'll end up with something like...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: trigger to call a program to write a text file onto a folder in the server

    Why would you want to delete a row that has just been inserted in a table?

    If you really need something like that (instead of directly executing the program) you could...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: trying to figure out join to find all records from one table that do not exist in other table, grouped by a certain column

    I'm not sure that I understand exactly what you want. First of all, it's nonsense to store a column with a value that will be the same for all rows.

    Second,...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Error in Drop Create stored procedure.

    What about using the code 120?

    CONVERT( datetime, @myDate, 120)

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Select ID with the Greatest Rank

    Something like this?

    WITH SampleData(ID, Source, Rank) AS(

    SELECT 123, 'Foo', 10 UNION ALL

    SELECT 123, 'Bar', 20 UNION ALL

    SELECT 124,...

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • RE: Select ID with the Greatest Rank

    caippers (4/29/2014)


    ID is the PK in this table.

    If ID is the PK, why is it repeated? PKs should be unique.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

Viewing 15 posts - 6,511 through 6,525 (of 8,731 total)