Forum Replies Created

Viewing 15 posts - 3,946 through 3,960 (of 8,731 total)

  • RE: format field

    A different way to do it.

    SELECT rowid,

    YEAR( dateMeeting),

    MONTH( dateMeeting),

    DAY( dateMeeting),

    STUFF( (hoursMeeting * 100) +...

    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: NULL and empty string question...

    Setting ANSI_NULLS off would give you the expected results. But I won't recommend on doing that other than general testing for additional knowledge.

    :exclamation:Important

    In a future version of SQL Server, ANSI_NULLS...

    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: NULL and empty string question...

    g.britton (10/29/2015)


    SQL uses three-value logic. So anything = NULL evaluates to False and anything <> NULL also evaluates to FALSE. Also, NULL = NULL is FALSE as is...

    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?

    ChrisM@Work (10/29/2015)


    Ed Wagner (10/29/2015)


    yb751 (10/29/2015)


    I was on my last eye twitch yesterday (so to speak) so I put together this image. (attached)

    I was thinking about unleashing it but then 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: Import file characters into a various tables

    dbman (10/29/2015)


    Hello,

    I have actually got the data importing into APP1 table, however im struggling to see how APP2 and other APP lines can be split to begin a new import...

    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: Retrieving VIEW Metadata

    Try querying:

    sys.views

    sys.sql_modules

    sys.columns

    What specific metadata do you need?

    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: SQL2008R2 FIFO Allocation Recursive CTE

    Just so you know, a well written cursor or while loop can be better than a recursive CTE. I made a test some time ago and it's published in here:...

    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: Use Like and DateDiff in where Clause

    This is how I would do it if there's no option to correct the data to save the date as a real date and not part of the string.

    CREATE...

    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: More wildcard searches

    freyes (10/28/2015)


    I tink the question must include the collation, because if the collation is case sensitive the answer will be 2.

    Unless otherwise specified, the default settings are used, which include...

    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: More wildcard searches

    My guess is that Steve selected the wrong answer as correct answer, as the explanation says all the rows are returned.

    He's at PASS Summit, so he might not be able...

    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: Summarising transaction data removing nulls

    yb751 (10/27/2015)


    Awesome solution Luis, I'm going to keep this one for a rainy day. Just curious why you created a @date_serial variable. Is it needed?

    Yes, it's needed to...

    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!

    whereisSQL? (10/27/2015)


    crookj (10/27/2015)


    happygeek (10/27/2015)


    Ed Wagner (10/27/2015)


    happygeek (10/26/2015)


    Luis Cazares (10/26/2015)


    crookj (10/26/2015)


    whereisSQL? (10/26/2015)


    Ed Wagner (10/26/2015)


    DonlSimpson (10/26/2015)


    Ed Wagner (10/26/2015)


    eccentricDBA (10/26/2015)


    Luis Cazares (10/23/2015)


    happygeek (10/23/2015)


    Spices

    Girls

    Pop

    Coke

    Cartel

    Tunnel

    Smuggle

    Snuggle

    Struggle

    Fight

    UFC

    Cage

    Luke

    PowerMan

    Jessica

    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: Summarising transaction data removing nulls

    This looks very similar to a running total problem (except that there's no total). This can be managed by the quirky update, a cursor or a triangular join. Here's 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: SQL Server Management Studio Query Analyzer Replacement

    You can either download the last version of SQL Server Management Studio which is "standalone". https://msdn.microsoft.com/en-us/library/mt238290.aspx

    Or you can download an express version of SQL Server which includes it (be sure...

    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: beginner row to column ?

    You can use cross tabs to convert rows into columns. You can fine more information in these articles:

    http://www.sqlservercentral.com/articles/T-SQL/63681/

    http://www.sqlservercentral.com/articles/Crosstab/65048/

    Here's an example based on your sample data.

    SELECT MAX( CASE WHEN id =...

    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 - 3,946 through 3,960 (of 8,731 total)