Forum Replies Created

Viewing 15 posts - 4,456 through 4,470 (of 8,731 total)

  • RE: Can I display all the days in a range even with no data ?

    You need to create a cartesian product that includes all dates for all the clients. The following code might need to be divided as it might cause problems to the...

    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: Can I display all the days in a range even with no data ?

    Please don't use a recursive CTE to generate a calendar table as it's only a way of hidden RBAR. You can read more about this on this article: http://www.sqlservercentral.com/articles/T-SQL/74118/

    As an...

    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: Can I display all the days in a range even with no data ?

    The simplest way was to use the original query as a CTE or derived table and then join it to the calendar table.

    WITH cteQuery AS(

    SELECT RTRIM(data.dbo.CLI.LNAME)...

    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: Find max pool size in sql

    Isn't that a connection property?

    What exactly do you want to know? Does this answer your question?

    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: Can I display all the days in a range even with no data ?

    You need an outer join with a calendar table.

    Something like this:

    SELECT *

    FROM CalendarTable c

    LEFT

    JOIN SomeTable s ON c.calDate = s.SomeDate

    WHERE c.calDate >= @StartDate

    AND c.calDate < @EndDate + 1

    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: Data typeof calculated fields

    In this case, you don't need to know the types from the columns as they won't matter. The important part is to know the type the function returns.

    From BOL


    COUNT works...

    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: Searching for allowed characters from table using function

    This should work as explained in the original post. It doesn't return the same results because you don't have digits in your AllowedCharacters table.

    CREATE FUNCTION dbo.StripNonAllowedChars

    (

    @OriginalText Varchar(8000)

    )

    RETURNS...

    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: Searching for allowed characters from table using function

    Lowell (8/10/2015)


    Luis Cazares (8/10/2015)


    Any reason not use LIKE?

    yes, there's a reason!

    i built this a while ago , and i have a bunch of variations of it for specific purtposes.

    but i...

    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: Searching for allowed characters from table using function

    Any reason not use LIKE?

    ALTER FUNCTION dbo.StripNonAlphaNumeric_itvf

    (

    @OriginalText Varchar(8000)

    )

    RETURNS TABLE

    AS

    RETURN

    (

    WITH tally (N) as

    (SELECT TOP 10000 row_number() OVER (ORDER BY sc1.id)

    FROM Master.dbo.SysColumns sc1

    CROSS JOIN Master.dbo.SysColumns...

    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: Today's Random Word!

    crookj (8/10/2015)


    Ed Wagner (8/10/2015)


    djj (8/10/2015)


    Ed Wagner (8/10/2015)


    BL0B_EATER (8/10/2015)


    Stuart Davies (8/10/2015)


    TomThomson (8/9/2015)


    SQLRNNR (8/8/2015)


    Ed Wagner (8/8/2015)


    Eirikur Eiriksson (8/8/2015)


    SQLRNNR (8/7/2015)


    Mood

    🙂 Smiley

    Happy

    Shiny

    reflective

    pensive

    Deep

    Wide

    Load

    Reload

    Download

    Virus

    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: Split column value after every 50 characrters without splitting words

    After a good weekend of rest and a morning coffee, this is what I came out with. It's reducing the conditions by splitting the lines into separate rows before the...

    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: Issue with output parameter in stored procedure

    Your data doesn't help that much. It allows basic tests and I can't be sure that all conditions are met.

    You'll have to test this code to be sure that it...

    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: Issue with output parameter in stored procedure

    nadersam (8/9/2015)


    Hi Luis,

    Please bare with me, i am new with tally tables programming, i was reading about it during last few days.

    In our example you specified the number of rows...

    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: Are the posted questions getting worse?

    Sean Lange (8/7/2015)


    50k post update - just over 50 more to go. :w00t:

    5 more to get to page 1K for me.

    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: Are the posted questions getting worse?

    Jeff Moden (8/7/2015)


    SQLRNNR (8/7/2015)


    jasona.work (8/7/2015)


    Another day, another "how do we prevent sysadmins from doing something" post. Which almost always boils down to essentially "we don't trust anyone, and we...

    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 - 4,456 through 4,470 (of 8,731 total)