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.
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 *,...
July 15, 2008 at 5:03 am
Try replacing
select
Log#,
TextID,with...
select distinct Log#,
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
July 14, 2008 at 10:22 am
Another technique which can be useful in some circumstances...
update #TEST set Descr = replace(replace(replace(Descr, ' ', '¬ '), ' ¬', ''), '¬', '') where Descr like '% %'
(Where ¬...
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...
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,...
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')
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)...
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...
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,
...
May 22, 2008 at 8:33 am
Glad to help, thanks for the feedback 🙂
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
May 20, 2008 at 5:47 am
rbarryyoung (5/18/2008)
Here's what I put in:
[font="Times...
May 19, 2008 at 4:50 am
Viewing 15 posts - 76 through 90 (of 683 total)