Viewing 15 posts - 1,966 through 1,980 (of 3,008 total)
LoveSQL (3/10/2009)
Well the back end is SQL 2000 not SQL 2005thanks!
So why did you post your question in the SQL Server 2005 forum?
March 10, 2009 at 9:15 pm
The code should do what you want. Change the DB name from "test" to the database you are working with.
use master
go
declare @kill_spid varchar(20)
-- Find spid of user connection to...
March 10, 2009 at 3:45 pm
select
[SQL Server Start Time]= convert(varchar(23),a.SQL_Start,121),
[SQL Agent Start Time]= convert(varchar(23),a.Agent_Start,121),
[SQL Uptime] =
convert(varchar(15),
right(10000000+datediff(dd,0,getdate()-a.SQL_Start),4)+' '+
convert(varchar(20),getdate()-a.SQL_Start,108)) ,
[Agent Uptime] =
convert(varchar(15),
right(10000000+datediff(dd,0,getdate()-a.Agent_Start),4)+' '+
convert(varchar(20),getdate()-a.Agent_Start,108))
from
(
Select
SQL_Start = min(aa.login_time),
Agent_Start =
nullif(min(case when aa.program_name like 'SQLAgent %' then aa.login_time else '99990101' end),
convert(datetime,'99990101'))
from
master.dbo.sysprocesses aa
where
aa.login_time...
March 10, 2009 at 9:29 am
This change to the inner WHERE clause will fix your problem. Conditions in a CASE statement are evaluated in order, so only values that pass the ISDATE checks will...
March 10, 2009 at 8:59 am
Bob Hovious (3/6/2009)
By the way, does anyone else here follow the online comic XKCD? ...
March 6, 2009 at 11:15 pm
Instead of this being a club, I like to think of SSC as more like a bar. Come in, set down, have a cold one, and start spouting off...
March 6, 2009 at 6:56 pm
select
FirstMondayOfMonth =
dateadd(dd,(datediff(dd,'17530101',SeventhDayOfMonth)/7)*7,'17530101'),
FirstTuesdayOfMonth =
dateadd(dd,(datediff(dd,'17530102',SeventhDayOfMonth)/7)*7,'17530102'),
FirstWednesdayOfMonth =
dateadd(dd,(datediff(dd,'17530103',SeventhDayOfMonth)/7)*7,'17530103'),
FirstThursdayOfMonth =
dateadd(dd,(datediff(dd,'17530104',SeventhDayOfMonth)/7)*7,'17530104'),
FirstFridayOfMonth =
dateadd(dd,(datediff(dd,'17530105',SeventhDayOfMonth)/7)*7,'17530105'),
FirstSaturdayOfMonth =
dateadd(dd,(datediff(dd,'17530106',SeventhDayOfMonth)/7)*7,'17530106'),
FirstSundayOfMonth =
dateadd(dd,(datediff(dd,'17530107',SeventhDayOfMonth)/7)*7,'17530107')
from
(
Select SeventhDayOfMonth = dateadd(month,datediff(month,0,getdate()),0)+6
) a
March 6, 2009 at 3:29 pm
You can also just right-click on a table in the SSMS object explorer, and pick Script Table as, SELECT
March 6, 2009 at 7:56 am
t.walker (3/5/2009)
This is not a sarcastic point...
March 5, 2009 at 9:56 pm
SQL Server 2008 Books Online (February 2009)
What's New (SQL Server 2008)
http://msdn.microsoft.com/en-us/library/bb500435.aspx?ppud=4
March 5, 2009 at 9:42 pm
Being an MVP would be cool, but nothing beats basking in the warm glow of my own genuine and heartfelt self admiration. :satisfied:
March 5, 2009 at 8:59 pm
There is real value in responding to even really stupid posts by people that are completely clueless and hopeless in their stupidity.
If no one responds to those sorts of things,...
March 5, 2009 at 8:43 pm
Just padding my posts here, but I really don't see how answer ratings would contribute much. This is a discussion board, so all the meat is in the discussion....
March 5, 2009 at 8:23 pm
Maybe you could run the backup set query that was posted above and know for sure.
March 4, 2009 at 10:59 pm
You have changed the requirements of what you want with each post.
You should start by thinking through what you actually want, and then asking that question, instead of asking 4...
March 4, 2009 at 10:54 pm
Viewing 15 posts - 1,966 through 1,980 (of 3,008 total)