Forum Replies Created

Viewing 15 posts - 5,806 through 5,820 (of 8,731 total)

  • RE: Find weekdays between 2 dates

    Something like this could do the trick and you can convert it into an inline table valued function which would be as fast as the normal query.

    DECLARE @Start 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: DATETIME

    Does increasing the length of your varchar to 19 solves the problem?

    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: Parameters may improve SQL Backup Performance in SQL Server 2008

    I was expecting that compression would be one of the answers.

    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 Old School Pivot

    Eirikur Eiriksson (9/18/2014)


    Oops, used the wrong code:-P Here is the correct version, in fact the same thing Luis posted, but in SQLite dialect

    😎

    I tested it on sqlfiddle.com and it worked...

    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: The 10 (.5) Commandments for IT Professionals

    I'm sure there's a commandment missing.

    STUDY. You'll never finish to learn. There's always something else that you must learn and that's why studying is so important. When we're not moving...

    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 Old School Pivot

    Something like this?

    SELECT 'Total' AS Dept,

    SUM(CASE WHEN dept = 'A' THEN Total ELSE 0 END) AS A,

    SUM(CASE WHEN dept = 'B' THEN Total ELSE 0 END) AS B,

    ...

    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: TSQL SCRIPT

    Maybe something like this (you should read about sp_send_dbmail):

    IF NOT EXISTS(

    SELECT *

    FROM RESTOREHISTORY

    WHERE DESTINATION_DATABASE_NAME = 'intelligence'

    ...

    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 perform mathematical formula without using case.

    ScottPletcher (9/18/2014)


    @luis:

    I believe my code above met your (implied) challenge ;-).

    Yes, I know. 😀

    Thank you for sharing.

    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 perform mathematical formula without using case.

    shahi.alokchandra (9/17/2014)


    Actually i am having more then 100000 rows in table and if i use functions then my index might not be called.,that why want to avoid cases and functions.

    Are...

    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 30 days of each month

    Sean Lange (9/18/2014)


    waseemshaikh345 (9/18/2014)


    Like for example lets say I Have 14 people who made payments to their account, I want to know in those 30 days of September how many...

    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?

    Stefan Krzywicki (9/17/2014)


    I know people who frequent this list will mention when they're looking for a new position. Does anyone happen to be looking for something in the Boston area...

    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?

    Do I see some personal/professional growth in these words? I really hope so.

    This Post is closed. I will research the issue.

    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: Release a large amount of free space from a data file.

    Do you need the space? You might need it in the future for DB growth so unless you really need it right now, you shouldn't try to release it. 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: Hot to Get Number of days for given date range.?

    vineet_dubey1975 (9/17/2014)


    I glade and thanks to all members for giving solution and suggestion. This is working pretty nicely.

    Vineet D

    Thank you for the feedback.

    Now, something really important. Do you understand...

    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 perform mathematical formula without using case.

    The simplest version I could think of.

    declare @t table (Qty decimal(12,3),CF1 Decimal(12,3),CF2 Decimal(12,3),Flag TinyInt)

    insert @t select 10,2,6,0

    insert @t select 10,2,6,1

    SELECT Qty* POWER(CF2/CF1, Flag)

    FROM @t

    EDIT: Unless someone proves me wrong, 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

Viewing 15 posts - 5,806 through 5,820 (of 8,731 total)