Forum Replies Created

Viewing 15 posts - 1,786 through 1,800 (of 8,731 total)

  • RE: recursive query to find out orphans

    Eventhough, I appreciate your intentions to "educate the noobs". I would suggest that you stop bashing them when you can't even test your code before posting it. The code 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: Converting time - from "seconds after midnight"

    Here's an option using an inline table-valued function which would perform a lot better than a normal function. It also has a test to show how does it work.

    The code...

    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: recursive query to find out orphans

    fabriziodb (12/2/2016)


    CELKO (11/30/2016)


    >> I need a query to find out all orphans over a hierarchical table <<

    ``

    I never heard this term before, and I wrote the standards. I think you...

    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: Is there a way to extract only credit card numbers from text

    SQLsharp has a validation for credit cards. It will only validate a number and won't extract it from a string. If you want to try it, feel free to do...

    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: Best way to automate running adhoc scripts?

    WebTechie (12/1/2016)


    Luis,

    I followed all of that up to "use the File Connection as the source".

    I'm not sure where you are setting the source to be the file connection?

    Thanks.

    Tony

    I'm sorry, 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: Are the posted questions getting worse?

    Lynn Pettis (12/1/2016)


    For someone who has been "around" SSC as long as "he" has, he sure hasn't changed in all these years.

    I stayed away and thinking I will bypass him...

    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: Is there a way to extract only credit card numbers from text

    You could have also changed it like this and keep it as a function with zero reads.

    CREATE FUNCTION [dbo].[PatternSplitCM](@List [varchar](8000) = NULL, @Pattern [varchar](50))

    RETURNS TABLE WITH SCHEMABINDING

    AS

    RETURN

    ...

    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 Query

    whenriksen (12/1/2016)


    Another option:

    SELECT @Dummy = CASE WHEN LEN( Med_Rec_Nbr ) < 7

    THEN...

    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: Is there a way to extract only credit card numbers from text

    How can you differentiate it from the visa card that has the expiration date together?

    Here's another option that works with your sample data. The function is posted and explained in...

    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: Is there a way to extract only credit card numbers from text

    This might give invalid card numbers, but it's worth a try.

    WITH ctePatterns AS(

    SELECT *

    FROM (VALUES

    ( '%[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]%', 16)

    ,(...

    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: CREATE FUNCTION with a WHILE LOOP

    You should also read this article to avoid looping in SQL.

    http://dwaincsql.com/2014/03/27/tally-tables-in-t-sql/

    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 Query

    whenriksen (12/1/2016)


    SELECT ps.Med_Rec_Nbr, REPLACE(STR(ps.Med_Rec_Nbr,7),' ','0')

    FROM @Primary_Summary AS ps

    This approach also makes it obvious if you got a number larger than expected, rather than truncating to 7 characters.

    It's also slower. It's...

    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: Increase speed of WHILE LOOP with INSERT

    Talvin Singh (12/1/2016)


    oh cr*p, that has worked!!!

    so ORDER BY NEWID() is a random function?

    It's not a random function, but it creates a random value which is designed to be 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: How to drop temp table created by somebody else?

    Kill all connections. 😀

    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: To be able to download 115 MB within 200 seconds a network speed of 600 kByte/sec

    To download 115MB in 200 seconds is the same that downloading 117,760KB in 200 seconds. If you divide the number of KB by the seconds, you'll get the KBs needed...

    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 - 1,786 through 1,800 (of 8,731 total)