Forum Replies Created

Viewing 15 posts - 2,236 through 2,250 (of 8,731 total)

  • RE: SQL help - how do we find that a particular string appears x times in a certain field

    Maybe this could help:

    if object_id('tempdb..#t') is not null DROP TABLE #t;

    create table #t( str varchar(4000) );

    insert into #t(str) values ( '<DataReference>ABCGT ' );

    insert into #t(str) values ( '<DataReference>UITR <DataReference>ACDE <DataReference>ERR...

    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/25/2016)


    Grant Fritchey (8/25/2016)


    Sean Lange (8/25/2016)


    Grant Fritchey (8/25/2016)


    Lynn Pettis (8/25/2016)


    Got to the following from a LinkedIn email. Not sure about a few of the answers.

    https://intellipaat.com/interview-question/sql-interview-questions/

    I posted a comment....

    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 help - how do we find that a particular string appears x times in a certain field

    Maybe something like this:

    SELECT *, (LEN(str) - LEN(REPLACE(str, 'fox', '')) ) / 3

    FROM #t;

    But I'm not sure if it causes a problem with the result. What would you expect if...

    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 set of words by ignoring spaces

    The Dixie Flatline (8/25/2016)


    But isn't the problem with just replacing spaces is that it doesn't deal with other special characters?

    It depends on what you're doing.

    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?

    BLOB_EATER (8/25/2016)


    GilaMonster (8/25/2016)


    If you were to attend a keynote presentation on "New features of SQL 2016", would you prefer brief demos of each new feature? Just discussion and use 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: Are the posted questions getting worse?

    Are you serious? I think they're perfect. They're great to identify cheaters from people that actually know what they're talking about.

    I couldn't get past the 3rd question, it's full of...

    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: Seconds to hours??

    I'm sorry, I'm lost. What's the problem that you have?

    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/25/2016)


    Steve Jones - SSC Editor (8/25/2016)


    OK, test upgrade to the newest version of InstantForums went well this week. Upgrade time down to a few hours (was over 24...

    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: CALCULATING DELAY SECONDS

    Other than using basic operations, you just need to use DATEDIFF and a CASE expression, maybe ISNULL to prevent NULL values. What are you having problems with?

    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: updating a field with unique 15 digit navarchar

    Alvin Ramard (8/25/2016)


    Would this work?

    LEFT(REPLACE(CAST(NEWID () AS NVARCHAR(MAX)), '-', '') , 15)

    I'm not sure if that will return unique strings. Although, the chance for duplicates is low.

    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: Cast Varchar to Float Resulting In (Scientific) E Notation

    waxingsatirical (8/25/2016)


    Well what is the "Why"? Why are floats not considered best practice by some?

    I don't know what unnecessary work later is incurred by using floats, but I know of...

    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: Table Row Counts

    As each database is a container on itself, you need to loop into every database. One easy way to do it is with the sp_foreachdb shared in here: https://www.mssqltips.com/sqlservertip/2201/making-a-more-reliable-and-flexible-spmsforeachdb/

    There's one...

    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!

    djj (8/25/2016)


    Ed Wagner (8/25/2016)


    Alan.B (8/25/2016)


    BWFC (8/25/2016)


    Prefect

    day

    Night

    Dark

    Knight

    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: BULK INSERT from multiple objects

    Something like this applied to your code:

    DECLARE @sql_files_path varchar(100) = '\\SomeServer\Somepath\'

    DECLARE @BulKInsert nvarchar(300)

    SET @BulkInsert = '

    BULK INSERT #fileContent FROM ''' + @sql_files_path + 'receipt_header.sql''

    WITH (FIELDTERMINATOR ='' | '',ROWTERMINATOR =''...

    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: Cast Varchar to Float Resulting In (Scientific) E Notation

    waxingsatirical (8/25/2016)


    Luis Cazares (6/3/2016)


    using float is just lazy programming.

    and by 'lazy' you mean??? Not doing unnecessary work?

    If by unnecessary work you mean analysis and planning, yes it's lazy programming. Some...

    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 - 2,236 through 2,250 (of 8,731 total)