Forum Replies Created

Viewing 15 posts - 6,646 through 6,660 (of 8,731 total)

  • RE: Are the posted questions getting worse?

    jasona.work (3/31/2014)


    ChrisM@Work (3/31/2014)


    Way back in the early 90's many of us FoxPro programmers waited with bated breath for MS' release of a product which included a crude implementation of SQL....

    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: Rolling 12 month/Period SQL Query Logic

    Maybe this code will give you an idea.

    DECLARE @FYint=14,

    @P int=3;

    DECLARE @Date date

    SET @Date = CAST( @FY as CHAR(2)) + RIGHT( '0' + CAST( @P AS varchar(2)), 2) + '01'

    SELECT...

    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: rewrite cursor to set based

    This function can certainly be converted into an inline table-valued function. It's tricky, but it can be done and it has nothing to do with parameters as the previous 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: select based on date compare

    This is a repeated post which was asked in here: http://www.sqlservercentral.com/Forums/Topic1555882-391-1.aspx

    I would use the date math as Sean suggested to get

    DATEADD(dd, DATEDIFF(dd, 0, GETDATE()), 0)

    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 converting data type varchar to bigint

    You're setting your variable to 'SELECT MAX(CODIGO) FROM SGCTCENTRAL.DBO.SINCRONISMO' and that is a string value. You need to use dynamic code by using sp_executesql (preferred method) or EXECUTE().

    If your query...

    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 (3/28/2014)


    Luis Cazares (3/28/2014)


    I'm a developer/programmer/moroff/slave and for that reason, I wonder why people like to overcomplicate things if they have the tools available. Next thing, I'll hear about...

    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?

    I'm a developer/programmer/moroff/slave and for that reason, I wonder why people like to overcomplicate things if they have the tools available. Next thing, I'll hear about someone making a select...

    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: rewrite cursor to set based

    WayneS (3/27/2014)


    Well, hello there.

    Luis - thanks for linking to my article. However, I'm afraid that it doesn't do much for helping to learn how to remove cursors. For that task,...

    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: Scenario - TLog

    @SQLFRNDZ (3/27/2014)


    Of course, Prevention is better .. I have seen a database like this recently with one of my client configured in FULL and never backup for log, I 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?

    Jeff Moden (3/27/2014)


    Grant Fritchey (3/27/2014)


    jcrawf02 (3/27/2014)


    We have a written test we use to weed out people who don't know the first thing about SQL (report writing position, not DBA 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: Are the posted questions getting worse?

    How is it possible that someone writes a cursor instead of using SUM()?

    I'm afraid that this database is full of these pieces of sh code and it's slower than 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: rewrite cursor to set based

    Talk about RBAR on steroids and overcomplicating things. These cursors are just going row by row adding a value. This is totally unnecessary if you know about aggregate functions. In...

    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: Sub Query and Left Joins to isolate data for Merge and Insert

    The subquery looks fine, you're filtering using JOINs. You could change them to IN or EXISTS and you might have a slight performance gain, but it might not be...

    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 dynaminc and aggregate functions

    When you execute the code, SQL Server doesn't care if the code is dynamic or static. As long as the instruction in the dynamic code becomes exactly the same code...

    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 Select Headers in a SP

    Each column of a resultset will have one header. You could remove the UNION ALLs to have 3 resultsets, add a column for the description of the row or 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

Viewing 15 posts - 6,646 through 6,660 (of 8,731 total)