Viewing 15 posts - 76 through 90 (of 683 total)
The data section is just for this example. You only need the calculation section to work with your actual data.
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
July 15, 2008 at 5:06 am
Here are a few ways...
select a, min(b) as b from [Table 1] group by a
select a, max(b) as b from [Table 1] group by a
; with x as (select *,...
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
July 15, 2008 at 5:03 am
Try replacing
select
Log#,
TextID,with...
select distinct Log#,
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
July 14, 2008 at 11:37 am
Here are some links which might help...
http://www.nigelrivett.net/SQLTriggers/AuditTrailTrigger.html
http://www.nigelrivett.net/SQLTriggers/Triggers_2_Creating_Audit_Trails.html
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
July 14, 2008 at 10:22 am
Bare with you?
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
July 14, 2008 at 10:18 am
Another technique which can be useful in some circumstances...
update #TEST set Descr = replace(replace(replace(Descr, ' ', '¬ '), ' ¬', ''), '¬', '') where Descr like '% %'
(Where ¬...
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
July 14, 2008 at 10:14 am
Hopefully this will get you started...
--data
declare @t table (JOB_ID int, JOB_NAME varchar(10), [?] int, SIZE int, run int, SHEETS int,
QTY int, job_status int, mc int, pages...
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
July 14, 2008 at 9:30 am
This looks like fun, so I'm chipping in...
declare @t table (id int identity(1, 1), a1 int, a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int,...
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
July 14, 2008 at 8:34 am
Something like...
update movie
set price = case when movieName = 'fofo' then 12000*2 when movieName = 'lili' then 25000/2 end
where movieName in ('fofo', 'lili')
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
May 27, 2008 at 8:29 am
Peso (5/23/2008)
set statistics io on
-- Ryan
select Date from (select dateadd(d, Number-1, '20080106') as Date from dbo.Tally) a
where datename(weekday, Date)...
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
May 23, 2008 at 10:12 am
select Date from (select dateadd(d, N-1, '20080106') as Date from dbo.Tally) a
where datename(weekday, Date) = 'Sunday' and Date <= '20100103'
See this article for info on how to create the Tally...
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
May 23, 2008 at 4:58 am
Another XML-style approach...
drop table #Results
; with a as (select RowNum, cast('<parm '+ replace(replace(Parameters,'=','="'),'&','" ')+ '"/>' as xml) as Xml from #SourceTable)
select RowNum,
Xml.value('(parm[1]/@Subject)[1]', 'varchar(255)') as Subject,
...
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
May 22, 2008 at 8:33 am
Glad to help, thanks for the feedback 🙂
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
May 20, 2008 at 8:20 am
Todd Carrier (5/19/2008)
Cursor datatype, huh? Does somebody have any sample code to demonstrate? I've never used it before...
Microsoft does... http://msdn.microsoft.com/en-us/library/ms175498.aspx
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
May 20, 2008 at 5:47 am
rbarryyoung (5/18/2008)
Here's what I put in:
[font="Times...
Ryan Randall
Solutions are easy. Understanding the problem, now, that's the hard part.
May 19, 2008 at 4:50 am
Viewing 15 posts - 76 through 90 (of 683 total)