Forum Replies Created

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

  • 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 +...

  • 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...

  • 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,...

  • 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...

  • 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...

  • 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

  • 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...

  • 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...

  • 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...

  • 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...

  • 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...

  • 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...

  • RE: Are the posted questions getting worse?

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

  • 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...

  • RE: Read Letters until first Number

    Change the Table Value Constructor to use your table and change the column to your column.

    I'm using the exact name so you can search for the items yourself and be...

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