Forum Replies Created

Viewing 15 posts - 4,651 through 4,665 (of 8,731 total)

  • RE: Guidance on best string manipulation technique (image included)

    Christopher Kutsch (7/21/2015)


    Just a first crack at it, using a Split String function I have posted on this site as a tool http://www.sqlservercentral.com/scripts/SUBSTRING/124330/:

    SELECT partnum

    , ...

    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: Query runs fine individually but not together.

    Have you checked if anything is blocking this query, or if you have an adequate index?

    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: Guidance on best string manipulation technique (image included)

    Wow, that's a lot of data (to be considered a sample).

    I'll give it a try when I get home in the afternoon, because I want to do some tests that...

    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: Query runs fine individually but not together.

    What's wrong with keeping it simple with a single SELECT statement?

    DECLARE @NACELLE varchar(max) = 'NULL, NULL, NULL, NULL',

    @timeint int = 5; --time...

    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: Guidance on best string manipulation technique (image included)

    Using CHARINDEX and SUBSTRING would be one option. To simplify it, you might want to use CROSS APPLY.

    If You want more help, please post your data in a consumable format...

    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: Adding some text to a stored procedure

    Just remember that if there's human input, there's a threat. It doesn't matter if it comes from outside or inside of the company. Protect yourself against any way that 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: Table(s) design for messaging functionality

    .Netter (7/21/2015)


    I would have multiple entries / statuses in one table which may become a nightmare to manage / control.

    Why is that a problem? Tables are designed to 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: Adding some text to a stored procedure

    As mentioned, you need to use dynamic SQL, but with your current code, you're wide open for SQL Injection. Here's an example on how could you do it.

    CREATE PROCEDURE EP_Conterbalances

    (

    @Start_Date_For_Totals_Date...

    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: help with query

    If you only need the Ids, here's another option.

    SELECT ID

    FROM Test

    WHERE Type = 'Non-IT'

    EXCEPT

    SELECT ID

    FROM Test

    WHERE Type = 'Manager'

    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 - Splitting a source table into Dimension and Fact tables

    The payment table looks almost as a fact table to me. Just remove the payment_id and invoice_id, and group by the other columns. You need to create a dimension for...

    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: Variable to trigger

    A little tough to answer before the morning coffee, but got it right.

    It's a nice question, thanks.

    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: Need help with the Query Report.

    You might want to review your code as it has some issues that might cause problems. Such as the use of sp_MSforeachdb (Check an alternative[/url]), functions on columns in WHERE...

    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: Need help with the Query Report.

    I can't test right now, but instead of doing an insert an update in here:

    INSERT @FinalResult (seq_num, database_name, iuser_name, principal_type_desc, role_name)

    SELECT ROW_NUMBER() OVER(PARTITION BY database_name ORDER BY database_name ASC) AS...

    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: Foreign Key vs Delete Trigger

    Foreign keys can improve performance. It might not always happen, but there's a possibility.

    http://www.scarydba.com/2010/11/22/do-foreign-key-constraints-help-performance/

    Triggers can prevent deletes in general. This is good if you want that. If you only want...

    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!

    Ed Wagner (7/20/2015)


    Eirikur Eiriksson (7/20/2015)


    SQLRNNR (7/20/2015)


    Ed Wagner (7/20/2015)


    BWFC (7/20/2015)


    Eirikur Eiriksson (7/20/2015)


    Ed Wagner (7/20/2015)


    djj (7/20/2015)


    Eirikur Eiriksson (7/18/2015)


    jasona.work (7/17/2015)


    djj (7/17/2015)


    crookj (7/17/2015)


    Ed Wagner (7/17/2015)


    Jeff Moden (7/16/2015)


    SQLRNNR (7/16/2015)


    clam

    fn_clam 😀

    Oyster

    Pismo (The Great Clam Festival)

    Geoduck

    Dirty

    Read

    Random

    Sequential

    Waterfall

    Cataract

    Stigmatism

    fn_eye

    tvfn_eyes

    Video Game...

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