Forum Replies Created

Viewing 15 posts - 4,756 through 4,770 (of 14,953 total)

  • RE: Report from XML audit log

    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...

  • RE: xp_cmdshell - Procedure expects parameter 'command_string' of type 'varchar'

    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).

  • RE: Odd Questions

    Craig Farrell (3/1/2011)


    amenjonathan (3/1/2011)


    Actually I retract my comments about you. I re-read every single post, and I looked at them from a different perspective. They don't come off as rude...

  • RE: Odd Questions

    amenjonathan (3/1/2011)


    Actually I retract my comments about you. I re-read every single post, and I looked at them from a different perspective. They don't come off as rude or condecending....

  • RE: Bad Question on Exam Review?

    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. ...

  • RE: No advantage to multiple data files on SAN?

    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...

  • RE: No advantage to multiple data files on SAN?

    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.

  • RE: Row transpose

    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....

  • RE: Insert a Parent and Child record in one statement

    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...

  • RE: Odd Questions

    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)


    I've done a few interviews. A couple were for commercial analyst positions working directly...

  • RE: Normalization Question

    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. ...

  • RE: Find orders with ALL the same items

    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...

  • RE: what is the difference between RPC:Completed and SP:Completed in sqlprofiler

    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...

  • RE: Normalization Question

    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...

  • RE: Odd Questions

    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...

Viewing 15 posts - 4,756 through 4,770 (of 14,953 total)