Viewing 15 posts - 1,336 through 1,350 (of 3,957 total)
Jeff Moden (8/8/2013)
Sean Lange (8/8/2013)
October 8, 2013 at 12:23 am
polkadot (10/7/2013)
I am making a permanent table. But I need the datetime without the zeros on end.just
2009-10-20 21:45
not
2009-10-20 21:45:00.000
A DATETIME data type will always have those zeroes...
October 7, 2013 at 11:41 pm
Kurt W. Zimmerman (10/7/2013)
October 7, 2013 at 7:31 pm
And by the way, I don't think you can "configure a 2008 server to run as 2005" but a 2008 server can run databases at a lower compatibility level.
Try this...
October 7, 2013 at 7:19 pm
rs80 (10/7/2013)
The expected result that I want is:
ProductID ...
October 7, 2013 at 7:10 pm
Duplicate post. All replies here please: http://www.sqlservercentral.com/Forums/Topic1502389-392-1.aspx
October 7, 2013 at 6:47 pm
Note this is cross-posted to the SQL 2005 forum. Please clarify which version of SQL you are working in.
October 7, 2013 at 6:47 pm
Certainly no way around the CASE but I might do it this way so as to only have to CASE it once.
WITH SampleData (accountNumber, MaturityDate, ResetFreq, Amount) AS
(
...
October 7, 2013 at 6:44 pm
I'm a bit confused by your question as I'm thinking maybe you need to PIVOT and not UNPIVOT.
Could you clarify by giving your expected results?
October 7, 2013 at 6:26 pm
But it can also be done with a single call to PatternSplitCM:
WITH SampleData(MyString) AS
(
SELECT' [{mark,peters,mr}{jane,fonda,mrs}{john,doo,mr}{james,bond,mr}]'
)
SELECT MyString
,Col1=MAX(CASE WHEN ItemNumber%6 = 2 THEN Item...
October 7, 2013 at 6:13 pm
Alan.B (10/7/2013)
declare @val varchar(8000)= '[{mark,peters,mr}{jane,fonda,mrs}{john,doo,mr}{james,bond,mr}]';
WITH x AS
(
SELECT ItemNumber, Item
FROM dbo.PatternSplitCM(REPLACE(REPLACE(@val,'[{',''),'}]',''),'%[}{]%')
WHERE Matched=0
)
SELECTROW_NUMBER() OVER (ORDER BY x.ItemNumber) AS Id,
MAX(CASE WHEN ps.ItemNumber=1...
October 7, 2013 at 6:05 pm
Tom - You might want to look at the first article in my signature links for a (sometimes) faster way to UNPIVOT.
Doesn't do the ordering for you though. You...
October 7, 2013 at 6:02 pm
Sean Pearce (10/7/2013)
Dwain, I meant no offence ...
No problem sir and none taken.
October 7, 2013 at 5:52 pm
It appears I'm also late to the party but perhaps this is another alternative:
SELECT EventName, Venue, EventDate
,IDs=STUFF((
SELECT ',...
October 6, 2013 at 6:48 pm
I skimmed the article but I couldn't really identify what's new in this re-publish.
I don't suppose you could give us a quick synopsis Jeff?
October 6, 2013 at 6:03 pm
Viewing 15 posts - 1,336 through 1,350 (of 3,957 total)