Viewing 15 posts - 4,756 through 4,770 (of 14,953 total)
Here's a sample.
CREATE TABLE #T (
ID INT IDENTITY PRIMARY KEY,
LogEntry XML);
INSERT INTO #T (LogEntry)
VALUES ('<EVENT_INSTANCE>
<EventType>event </EventType>
<PostTime>date-time</PostTime>
<SPID>spid</SPID>
<ServerName>name </ServerName>
<LoginName>login </LoginName>
<UserName>name</UserName>
<DatabaseName>name</DatabaseName>
<SchemaName>name</SchemaName>
<ObjectName>name</ObjectName>
<ObjectType>type</ObjectType>
<TSQLCommand>command</TSQLCommand>
</EVENT_INSTANCE>');
SELECT LogEntry.value('(EVENT_INSTANCE/EventType/text())[1]','varchar(100)')
FROM #T;
What you're looking for is "XQuery". Search for that in...
March 1, 2011 at 3:08 pm
You can't use varchar(max) with xp_cmdshell. Found that out the hard way. Try a finite number (I usually just go with either 1000 or 8000).
March 1, 2011 at 2:45 pm
Craig Farrell (3/1/2011)
amenjonathan (3/1/2011)
March 1, 2011 at 2:37 pm
amenjonathan (3/1/2011)
March 1, 2011 at 2:25 pm
I'd never expect to see severity 10 (or below) errors in a log, since those are "info messages", and don't even switch control from Try to Catch when raised. ...
March 1, 2011 at 2:06 pm
I could be wrong, but to my knowledge, SQL uses the OS to manage that level of I/O. If you tell it all the files are on the same...
March 1, 2011 at 2:01 pm
Even the "vertical" split is only advantageous if your bottleneck is actual disk access, and not the connection to the SAN or anything in between the disks and the connection.
March 1, 2011 at 1:37 pm
You'll want to take a look at the Pivot and Unpivot operators in T-SQL.
Honestly though, I do everything I can to avoid doing that in the database or in T-SQL....
March 1, 2011 at 1:27 pm
Insert the parent data, use an "output" clause to get the necessary data from that in order to create the child data, and then use that to insert the child...
March 1, 2011 at 1:26 pm
amen: Here was the discussion where it went personal and became rude:
amenjonathan (2/28/2011)
GSquared (2/28/2011)
amenjonathan (2/25/2011)
GSquared (2/25/2011)
amenjonathan (2/25/2011)
March 1, 2011 at 1:22 pm
You can do it with one table, by denormalizing, but you'll have one row for each Program, multiplied by the number of Majors, multipled by the number of Years. ...
March 1, 2011 at 12:24 pm
Will you need to find orders that have the same two (or more) items (and nothing else)? Or just the ones with the same one item? If you...
March 1, 2011 at 12:22 pm
Here's my understanding of it.
If you have a stored procedure that can call another stored procedure, when the sub-proc completes, it will show as a completed procedure, and when the...
March 1, 2011 at 12:17 pm
Then you're looking at two tables. One that joins majors to programs, one that joins years to programs. This could be a Majors table that has an FK...
March 1, 2011 at 12:04 pm
Koen Verbeeck (3/1/2011)
GSquared (3/1/2011)
... and possibly insane." (Okay, I dubbed in that last one. You can leave it off.)But ... you are possibly insane 😉
What "possibly"? Better...
March 1, 2011 at 12:01 pm
Viewing 15 posts - 4,756 through 4,770 (of 14,953 total)