Forum Replies Created

Viewing 15 posts - 6,856 through 6,870 (of 8,731 total)

  • RE: UPDATE SQL Query Help !

    You shouldn't store lists for delimited values in a single line for a single value. It violates the first normal form.

    If you really need this (I suggest to use 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: UNIQUE constraint vs checking before INSERT

    I would let the database do the work for me. Just to be clear, a single constraint that involves all 3 columns should be fine instead of 3 unique constraints.

    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: Reduce Logical reads

    There's not enough information on what's happening. The problem is too generic and can't be solved.

    For performance problems, check the following article:http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

    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: Byte Me: BYOD

    Jim P. (2/19/2014)


    phonetictalk (2/19/2014)


    I have this problem! I have my phone by me all day and forget to plug it in. Then, when I'm out & about and go 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: Complex search Functionality with joins

    I'm not sure that your expected results are correct because you say that if you pass "Cooking Candy" as a parameter, you should get "Cooking Waffles". If that's incorrect, this...

    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 this query

    sql2k8 (2/19/2014)


    I have to rewrite the code in another language. This correlated subquery is not working in the another language. So i am trying to rewrite the code without correlated...

    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 this query

    sql2k8 (2/19/2014)


    The below query works fine. I am trying to rewrite the code without using the sub query. In the end i should get the same results for both 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: Multiple CASE Statements in SQL Server 2012 Dev Ed

    It seems correct to me. What's the problem? Can you post sample data (check my signature to know how to do it properly)?

    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: Append with 0's

    tschuler-738392 (2/19/2014)


    The string in those fields can start with any Letter not always C or P

    None of the solutions given depend on the field starting with C or P. However,...

    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: Append with 0's

    That's why I included a link to BOL. You should check it to know exactly what's happening. Be sure to ask any questions you have after reading it.

    Here's an example...

    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: Append with 0's

    You could do it easily with the STUFF function.

    Would you need help on how to do 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: Extract last 7 days data based on current date using TSQL

    To get last 7 days of data, you could use some datetime formulas like this:

    WHERE DateColumn >= DATEADD( DAY, DATEDIFF(DAY, 0, GETDATE()) - 7, 0)

    AND DateColumn < GETDATE()

    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: Filter Duplicates based on string

    Maybe something like this if you just want to eliminate duplicates while displaying the information:

    WITH CTE AS(

    SELECT *,

    ROW_NUMBER() OVER(PARTITION BY LEFT( Name, CHARINDEX( '.', Name + '.') - 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: Error message - aggregate function and group by clause

    It's good to know that it worked for you. Do you understand why does it work and how? Do you have any questions you would like to ask?

    For future posts,...

    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: Error message - aggregate function and group by clause

    hunchback (2/19/2014)


    Columns in the SELECT clause that are not part of the GROUP BY should participate in an aggregation function.

    ph.CalculatedTotalTime,

    ph.MachGrpCode,

    ph.EmpId,

    pd.PartCode

    Can you post the exact error msg you are getting?

    He posted...

    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 - 6,856 through 6,870 (of 8,731 total)