Viewing 15 posts - 556 through 570 (of 627 total)
You could do something like this. Just be mindful if you have any values that exceeds 24hrs (in seconds).
DECLARE @seconds INT
SET @seconds = 24331
IF @seconds < 43200
SELECT CAST(@seconds/3600 AS...
June 15, 2015 at 11:53 am
You have a few options.
1. Setup a trace using profiler
2. Extended Events (I'm assuming your using 2008)
3. You can get some limited stats from DMV's i.e. sys.dm_exec_query_stats
Cheers,
June 15, 2015 at 11:39 am
Just threw this together quickly so take it as you will but it might help with what you are looking for.
USE [MSDB];
WITH Last_Run AS
(
SELECT MAX(instance_id) AS maxID, job_id FROM sysjobhistory...
June 12, 2015 at 8:33 am
halifaxdal (6/4/2015)
yb751 (6/4/2015)
Sounds like you just need to use PIVOT...can't be 100% sure though without some sample data/output.Thanks, never used pivot before, can you help?
If it is indeed what you...
June 4, 2015 at 2:03 pm
Sounds like you just need to use PIVOT...can't be 100% sure though without some sample data/output.
June 4, 2015 at 1:20 pm
This is just a shot at the dark here because I'm still not exactly sure what you want. The output is a little different but I built it based...
June 4, 2015 at 1:07 pm
patelxx (6/3/2015)
declare @EndTime nvarchar(10)= '12:45'
declare @Diff time(1) = cast(@EndTime as datetime) - cast(@StartTime as datetime)
How to I use Column names instead of Hard coding variables - e.g....
June 3, 2015 at 8:40 am
I'm not sure if you realized but Lynn was being quite literal. Open up your procedure and just do a Ctrl-F and look for any RETURN statements. Often...
June 2, 2015 at 9:54 am
Since you are completely new to the site I'll throw you a bone. 😉
Just for future reference people here are very helpful and always ready to help. However, like...
June 1, 2015 at 1:54 pm
Well I'm no SSIS expert but assuming you have a stored procedure as your data source you could do something like this.
CREATE PROCEDURE DefaultTest
@date_param DATETIME = NULL
AS
SET NOCOUNT ON
DECLARE @date...
June 1, 2015 at 7:59 am
Hmmm, I hadn't considered that. I have 17 columns and looking at the data types only one raises an eyebrow which is a LOB used to store images.
May 27, 2015 at 1:52 pm
It's much easier to visualize with data.
Try this for example:
DECLARE @test-2 TABLE(myDate DATE, Sales MONEY)
INSERT INTO @test-2(myDate, Sales)
VALUES
('12/30/2013',100),
('12/31/2013',100),
('01/01/2014',100),
('01/02/2014',100),
('01/03/2014',200),
('01/04/2014',200),
('01/05/2014',100),
('01/06/2014',100),
('01/07/2014',100),
('01/08/2014',100),
('01/09/2014',100),
('01/10/2014',250),
('01/11/2014',250),
('01/01/2015',100),
('01/02/2015',150),
('01/03/2015',150),
('01/04/2015',100),
('01/05/2015',100),
('01/06/2015',100),
('01/07/2015',100),
('01/08/2015',100),
('01/09/2015',300),
('01/10/2015',300)
SELECT *, DATEPART(dw, myDate) AS Day_Week, DATEPART(isowk, myDate)...
May 25, 2015 at 1:44 pm
Could you further explain why C is eliminated from your desired output? In fact we could use a little more info in general. Without knowing how A is...
May 25, 2015 at 11:47 am
Despite your description being vague I 'think' I know what you want.
If the cities need to be known by different names then you are best to just create a table...
May 22, 2015 at 8:23 am
Brandie Tarvin (5/11/2015)
You should turn that into an article, if you haven't already. Lots of people would be interested in your journey.
I hadn't thought of that. It's a good...
May 15, 2015 at 9:44 am
Viewing 15 posts - 556 through 570 (of 627 total)