Forum Replies Created

Viewing 15 posts - 5,521 through 5,535 (of 8,731 total)

  • RE: need table returning function with input table name as parameter

    Matt Miller (#4) (11/19/2014)


    Sean Lange (11/19/2014)


    DSNOSPAM (11/19/2014)


    Thanks Luis.

    I've been reading about possible performance hits. However, this is in a reporting/analysis environment, not on a production server, and it would...

    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: Conversion of Date from legacy systems with 7 and 6 digit format to DD/MM/YYYY format

    I agree with Sean, you should store your dates as a date/time data type. You can easily convert them with a simple formula.

    SELECT CAST( STUFF( oldDate, 1, 1, 19 +...

    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: Having issue with implementing CTE in Stored Procedure. Please help!!

    If we need to do it in our office and giving that the code here doesn't have any formatting standards and is a PITA to read, I would generate scripts...

    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 table returning function with input table name as parameter

    You (and your boss) need to define priorities.

    If you want flexibility to send the table's name as a parameter, you'll get bad performance.

    If you want to get good performance,...

    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: Document Your Database

    Wayne West (11/19/2014)


    Luis Cazares (11/18/2014)


    Wayne West (11/18/2014)


    I've made two minor tweaks, commenting out the sc.name on the Order By so that the fields display in the order of the structure...

    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: Document Your Database

    Wayne West (11/18/2014)


    I've made two minor tweaks, commenting out the sc.name on the Order By so that the fields display in the order of the structure of the table

    I...

    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: Case with Int and Varchar

    Or you can use CAST/CONVERT around SUM().

    Case when DATEDIFF(Day, Time_Stamp, getdate()) < = 1 And Status = 'Red' then CAST( SUM(RedCount) AS varchar(30)) Else 'No Data Available'End as CurrentRed

    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: Best Practices

    ramana3327 (11/18/2014)


    Hi Jeff,

    The report is now taking more than 12 hr.

    The report is executing one SP. The SP initially when tested 2 months it took around 10min to execute from...

    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: dynamic sql inside cursor syntax errors

    Yes, the problem was that I commented the EXECUTE and included a PRINT for testing purposes.

    I would also include the fully qualified name in your results.

    DECLARE @DB_Name varchar(max)

    DECLARE @Command...

    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: dynamic sql inside cursor syntax errors

    You had some problems with the number of quotes added.

    DECLARE @DB_Name varchar(max)

    DECLARE @Command nvarchar(max)

    DECLARE @ScriptPer nvarchar(max)

    DECLARE @Finalcmd nvarchar(max)

    --CREATE TABLE #Test(command varchar(8000))

    DECLARE database_cursor CURSOR FOR

    SELECT name

    FROM...

    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 HELP PLEASE

    Are rep_name1 and rep_name2 two different names? Or are they the same name divided into 2 columns? The solution might vary from one option to another. I hope it's 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: TSQL "where - 101"

    Hugo Kornelis (11/13/2014)


    Luis Cazares (11/12/2014)


    It's all fun and games until we find an employee with a NULL value in its name.

    A NULL in the QOTD table would in this case...

    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: Calculate Distance between two UK Post Codes

    If you want to code it yourself, you need to work with spatial data. There might be some way to get all the data instead of collecting it, but I...

    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?

    Help! The spam invasion returned. I feel like I'm drowning.

    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 remove cursor and impelment usig something else

    This is really complex and might take a while to transform into set based code. I wouldn't expect much help and even less without DDL and sample data.

    Basically, you're inserting...

    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,521 through 5,535 (of 8,731 total)