Viewing 15 posts - 3,736 through 3,750 (of 4,087 total)
Yes, the string split that you are using returns the values as ROWS and you need them as COLUMNS. You can use a PIVOT or crosstab to change your...
May 17, 2011 at 2:07 pm
You can certainly obtain the desired output, but since the correlation between the variable and the column name seems rather arbitrary, the following code is completely ad hoc and might...
May 17, 2011 at 8:45 am
I think what you are looking for is the following
SELECT LogText as [*]
FROM LogFile
FOR XML PATH(''), TYPE
The [*] tells SQL that the data represents XML, so it should retain the...
May 13, 2011 at 7:43 am
ramadesai108 (5/12/2011)
I hope I am posting this in the right forum.
The correct forum is here: http://www.sqlservercentral.com/Forums/Forum148-1.aspx
Drew
May 12, 2011 at 12:27 pm
There are a number of ways that you can approach this. I tend to use the system views, because they have some of the necessary joins already set up...
May 11, 2011 at 11:45 am
It's actually very simple, but if you have any records that are missing a comma, you will get an index out of range error message. You can fix this...
May 6, 2011 at 8:36 am
frfernan (5/5/2011)
May 5, 2011 at 9:02 am
I used a calendar table fragment for this, because dynamically generating half-hour intervals would be a bit of a mess. Also the conditions under which two time intervals overlap...
May 5, 2011 at 8:45 am
frfernan (5/5/2011)
declare @Temp table(MonthID char(6))
insert INTO @Temp values ('201010')
insert INTO @Temp values ('201011')
insert INTO @Temp values ('201012')
INSERT INTO @TEMP
select convert(char(6), dateadd(m, 1, cast(max(MonthID) +...
May 5, 2011 at 7:22 am
Ken Jr. (5/4/2011)
May 4, 2011 at 2:35 pm
That's exactly what triggers are for. You can look up triggers in BOL to find out more.
Drew
May 4, 2011 at 2:27 pm
Pam Brisjar (4/28/2011)
It's not ASCII, it's Unicode. Values go up to 65533 (decimal). Which, by the way, we do get.
Random sampling via PATINDEX is no good.
PATINDEX is NOT...
May 3, 2011 at 12:03 pm
Let me be clear.
* It's best to use a datetime field to store and manipulate datetime data.
* Adding a month is manipulating datetime data.
* Your MonthID is...
May 3, 2011 at 9:41 am
Do you really need to do a character by character review of the given column or just find columns that contain invalid characters? Perhaps you just need to return...
April 28, 2011 at 3:16 pm
First, you say that you want a monthID, but your formula actually calculates a WEEK ID.
Second, you don't say how the timestamp field relates to the month ID, if at...
April 28, 2011 at 2:45 pm
Viewing 15 posts - 3,736 through 3,750 (of 4,087 total)