Forum Replies Created

Viewing 15 posts - 2,551 through 2,565 (of 8,731 total)

  • RE: Query for splitting a single row into multiple rows based on a column data

    Here's an option using a tally table. If you don't know what a tally table is, read the following article:

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

    I'm not sure if my math is more complex that 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: Today's Random Word!

    whereisSQL? (7/5/2016)


    Ed Wagner (7/5/2016)


    Manic Star (7/5/2016)


    Ed Wagner (7/5/2016)


    djj (7/5/2016)


    ThomasRushton (7/5/2016)


    Ed Wagner (7/5/2016)


    Revenant (7/5/2016)


    Y.B. (7/5/2016)


    Ed Wagner (7/5/2016)


    ThomasRushton (7/5/2016)


    Stuart Davies (7/5/2016)


    Club

    Kitkat

    Candy

    Cane

    Kane [Citizen]

    Sugar

    Barley

    Wheat

    Flour

    E-Coli

    Bacteria

    Super

    Man

    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 rewrite sql statement to minimize guage of the complexity

    Using user-defined scalar functions (anywhere) is bad.

    Exceptions are possible but thorough testing must be done to confirm that, so just keep in mind the previous sentence.

    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 rewrite sql statement to minimize guage of the complexity

    From what I understand, you're concatenating 4 values delimited by double backslashes.

    Here's an option, it adds the delimiter before each value and uses STUFF to remove the first delimiter:

    SELECT STUFF(...

    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: Update table in Function or Call SP within Update statements

    > Is there a way in SQL to call a SP within update statement

    No, you can only have an update statement within a stored procedure. UPDATE is a statement, 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 transpose columns to rows

    The following article will explain how to do it:

    http://www.sqlservercentral.com/articles/comma+separated+list/71700/

    Read it and ask any questions you might 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: Dates in Fact or Dimention

    RonKyle (7/1/2016)


    I don't like that idea because that way you need to join tables for simple queries restricted by dates.

    To that I always reply that no user should be looking...

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


    djj (7/1/2016)


    Ed Wagner (7/1/2016)


    ThomasRushton (7/1/2016)


    Ed Wagner (7/1/2016)


    djj (7/1/2016)


    BWFC (7/1/2016)


    ThomasRushton (7/1/2016)


    Ed Wagner (6/30/2016)


    Revenant (6/30/2016)


    TomThomson (6/30/2016)


    djj (6/30/2016)


    HappyGeek (6/30/2016)


    jasona.work (6/30/2016)


    Ed Wagner (6/30/2016)


    Y.B. (6/30/2016)


    Vacation

    Soon

    Now

    Later

    Sometime

    Summertime

    Short

    Trousers

    Donald

    Daisy

    Duke

    Boys

    Charger

    Jumps

    Battery

    Bunnies

    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: Dates in Fact or Dimention

    I don't like that idea because that way you need to join tables for simple queries restricted by dates. Even if you won't have that problem once the cube 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: Getting result set from two tables without null values when using join

    vijay.sap1255 (7/1/2016)


    Dear Experts,

    I was trying to get rid of null values when using full outer join between two tables. For example, I have tables like below:

    Table 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: Correct MAXDOP setting

    Maybe these articles will explain this better:

    https://www.mssqltips.com/sqlservertip/2650/what-maxdop-setting-should-be-used-for-sql-server/

    https://support.microsoft.com/en-us/kb/2806535

    This is an additional to check five settings that often go overlooked

    https://www.brentozar.com/archive/2013/09/five-sql-server-settings-to-change/

    Durga, in the Microsoft article you can find the answer.

    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: Populate Data -- Loop

    This is equivalent to your code. Both are not guaranteed to get the same results each time as there's nothing to order. Pietlinden gave you the other part of 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: SP with 3 parameters as delimited list - Goal 500 milliseconds

    You could also check this to learn about catch-all-queries. http://sqlinthewild.co.za/index.php/2009/03/19/catch-all-queries/

    I would create a different temp table for each parameter.

    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: Dates in Fact or Dimention

    Maybe this simplified example from AdventureWorks can make it look simpler. The dates are both in the fact and the dimension.

    CREATE TABLE [dbo].[DimDate](

    [DateKey] [date] NOT NULL,

    [DayNumberOfWeek] [tinyint] NOT NULL,

    [DayNameOfWeek]...

    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: Dates in Fact or Dimention

    You just need 1 Time dimension. That dimension can have several hierarchies to represent natural year, fiscal year, etc. The key for that dimension is a date.

    In your fact tables,...

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