Forum Replies Created

Viewing 15 posts - 6,361 through 6,375 (of 7,636 total)

  • RE: Script to find all objects owned by a user (loginname)

    Sorry, I just noticed that you wanted a SQL2000 version as well. This is only SQL2005 and the SQL2000 version would be significantly different. Possibly simpler though.

  • RE: Script to find all objects owned by a user (loginname)

    Oops, found a bug.

    Corrected version:

    Alter Proc spLogin_OwnedObjects ( @login as SYSNAME ) As

    /*

    Display all objects in all DBs owned by the Login.

    2008-07-06 RBarryYoung Created.

    Test:

    spLogin_OwnedObjects 'sa'

    */

    declare @sql varchar(MAX), @DB_Objects varchar(512)

    Select @DB_Objects...

  • RE: Creating a View using a Cursor

    OK, here is a much simplified version that should work for you:

    Create Proc spCreate_MultiDBView As

    declare @sql varchar(MAX)

    Set @sql = 'CREATE VIEW v_student_addresses As

    '

    ...

  • RE: Creating a View using a Cursor

    I just posted a way to do somethng very similar, without cursors:

    Create Proc spLogin_OwnedObjects ( @login as SYSNAME ) As

    --spLogin_OwnedObjects 'sa'

    declare @sql...

  • RE: Slow Query

    I'd have to see the whole procedure to answer that.

  • RE: Script to find all objects owned by a user (loginname)

    Harder than I thought, but try this:

    alter Proc spLogin_OwnedObjects ( @login as SYSNAME ) As

    --spLogin_OwnedObjects 'sa'

    declare @sql varchar(MAX), @DB_Objects varchar(512)

    Select @DB_Objects = ' L.name as Login, U.*

    From %D%.sys.objects o

    ...

  • RE: Removal of user IDs when comparing of SQL servers?

    These are server level triggers.

    Does this 3rd party software provide/control a database or the whole server? While possible, that would be unusual. 3rd party software usually only provides/controls...

  • RE: Slow Query

    The other thing that you should consider is making an index for the columns on your WHERE clause.

  • RE: Slow Query

    OK, I checked it out. It still doesn't look right to me. I might use this approach for SQL 2000, but not SQL 2005. I've also seen...

  • RE: Removal of user IDs when comparing of SQL servers?

    I am not aware of one, but you could certainly write one.

    i would suggest creating DDL Login Events triggers/event notifications on the production box. when one of these fires,...

  • RE: Slow Query

    I must be missing something.

    Why can't you just do this in a loop:

    DELETE TOP 1000

    FROM PRTran

    WHERE TranAmt = 0 and Qty = 0 and UnitPrice =...

  • RE: fast file split on CRLF?

    Heh. I don't mean to laugh, but I just spent the last three days trying to figure out the same thing.

    First, credit where credit is due: Jeff Moden...

  • RE: eliminating duplicates

    Heh. It's amazing how the OP not putting their requirements in the first post, then putting them in their second post, can result in a 100+ replies. And...

  • RE: fast file split on CRLF?

    Yeah, I was wondering about that, but he also said "sent as one Varchar(max) parameter...", so it's a little contradictory. Anyway, I'm pretty sure that I'm going to fall...

  • RE: fast file split on CRLF?

    I am parsing 1MB strings in about 6 seconds on my laptop with the following function:

    ALTER function [dbo].[fnSplit3](

    ...

Viewing 15 posts - 6,361 through 6,375 (of 7,636 total)