Viewing 15 posts - 3,361 through 3,375 (of 3,957 total)
Understood. A minor modification:
;WITH CTE AS (
SELECT [Length], [Width], [Height]
,(SELECT MAX(dim)
FROM (VALUES ([Length]), ([Width]), ([Height]))...
June 19, 2012 at 8:04 pm
While I am loathe to quote myself (well, not really, just saying), have you seen this article?
http://www.sqlservercentral.com/articles/sql+n-Tuples/89809/
A minor modification to calculate the value of each n-tuple and then select for...
June 19, 2012 at 7:38 pm
Maybe this is too simplistic but couldn't you do something like this?
create table #Demo (vc varchar(100))
insert into #Demo (vc)
select 'King'
union select 'Queen'
union select '<Food> Apple </Food>'
union select 'Teacher'
union select 'Student'
union...
June 19, 2012 at 7:27 pm
I'd say the design is probably OK for what you're doing.
I'm concerned about the data getting stored for the reading time. Your sample data is nice and clean, that...
June 19, 2012 at 7:15 pm
Post deleted because I mistakenly quoted above instead of editing it. 😀
June 19, 2012 at 7:08 pm
Something like this should get you there:
Update c1
Set ClientName = 'ZZ ' + convert(nvarchar(max),ClientName)
FROM Clients c1
LEFT JOIN Clients c2 ON 'ZZ ' + convert(nvarchar(max),c1.ClientName) = c2.ClientName
Where ClientTerminationDate Is Not NULL...
June 19, 2012 at 7:07 pm
hisakimatama (6/19/2012)Basically, what I need to do is to take the three columns of the table, and compare them against some numbers; specifically, 9, 6.5, and 3. If any...
June 19, 2012 at 6:55 pm
Last time for tonight I promise. Here's the killer version:
create table #MyDataTable (ID INT, code char(10), value money, cumtot money, threshold money)
insert #MyDataTable (ID, code, value)
select 1, 'PROD1', £600...
June 19, 2012 at 7:32 am
Not being one to rest on past accomplishments, I've improved both versions:
create table #MyDataTable (ID INT, code char(10), value money, cumtot money, threshold money)
insert #MyDataTable (ID, code, value)
...
June 19, 2012 at 7:09 am
And in case anybody calls me a one trick pony, here's another way to do it.
But I do need to warn of the hidden RBAR that you can find explained...
June 19, 2012 at 6:22 am
Siten0308 (6/19/2012)
thanks dwain for the correction, however I have tried what you have and came up with the same results for example:
if i do the rowid = row_Number() etc.,...
June 19, 2012 at 6:07 am
My guess was right then.
BTW. I meant the dissection by Cadavre not dissection of Cadavre, in case anyone was wondering. 😀
June 19, 2012 at 6:05 am
vinu512 (6/19/2012)
dwain.c (6/19/2012)
DECLARE @t TABLE (mystring VARCHAR(100))
INSERT INTO @t
SELECT '100034/com.ccs.ccscontact'
UNION ALL SELECT '1003/com.ccs.ccscontact'
UNION ALL SELECT '100/com.ccs.ccscontact'
UNION ALL SELECT '20005/com.ccs.ccscontact'
SELECT SUBSTRING(mystring, 1, PATINDEX('%[^0-9]%', mystring)-1)
FROM @t
Just...
June 19, 2012 at 5:41 am
Kelvin Phayre (6/19/2012)
Absolutely brilliant solution.Fits my requirement's 100%.
Many thanks.
Well thank you kind Sir Kelvin!
You do need to be careful about a couple of things though:
1. If you are doing this...
June 19, 2012 at 4:33 am
Easy, peasy!
Just for fun, I'm going to take the OP's formatting literally.
DECLARE @team table (emp_code int,old_emp_code int, emp_name varchar(20))
insert into @team (emp_code,old_emp_code, emp_name)
select 1, 100,'ABA' UNION ALL select 2, 200,'ABB'...
June 19, 2012 at 4:25 am
Viewing 15 posts - 3,361 through 3,375 (of 3,957 total)