Viewing 15 posts - 5,521 through 5,535 (of 8,731 total)
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 +...
November 19, 2014 at 2:25 pm
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...
November 19, 2014 at 1:22 pm
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,...
November 19, 2014 at 12:48 pm
Wayne West (11/19/2014)
Luis Cazares (11/18/2014)
Wayne West (11/18/2014)
November 19, 2014 at 8:45 am
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...
November 18, 2014 at 5:43 pm
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
November 18, 2014 at 2:35 pm
ramana3327 (11/18/2014)
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...
November 18, 2014 at 12:29 pm
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...
November 18, 2014 at 10:10 am
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...
November 18, 2014 at 9:21 am
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...
November 18, 2014 at 8:08 am
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...
November 17, 2014 at 3:54 pm
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...
November 14, 2014 at 5:01 pm
Help! The spam invasion returned. I feel like I'm drowning.
November 14, 2014 at 4:55 pm
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...
November 14, 2014 at 4:49 pm
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...
November 14, 2014 at 9:57 am
Viewing 15 posts - 5,521 through 5,535 (of 8,731 total)