Forum Replies Created

Viewing 15 posts - 151 through 165 (of 482 total)

  • RE: Change DB owner to AD account that is member of sa

    Exception calling "SetOwner" with "1" argument(s): "Set owner failed for Database DB"

    + $db.SetOwner("[Domain\User]")

  • RE: Need to help to Restore/attach a database in SQL 6.5

    If memory serves -- and it's been a loooong time -- the detach-attach functionality only arrived with SQL 7.

    So you're stuck with Restore Database.

    First, create an new, empty db.

    I think...

  • RE: Query AD - Script Out of memory

    Here's a slightly different approach: start with the the matching groups, so you don't process users that aren't members of any of those groups.

    Then count the groups for each of...

  • RE: Users scheduling jobs

    Hi Erland,

    They only need to be able to create a new schedule for an existing job. Essentially, I want them to be able to call a stored proc at the...

  • RE: Strange behaviour

    Hi Chris,

    Yep, that was my conclusion too. However, since query fails, I couldn't see the execution plan. Unless there's a way?

    And, the iTVF would probably neatly obviate the original...

  • RE: Strange behaviour

    So it turns out that in the 2 failing scenarios, the function is going through the full table before applying the WHERE clause, and failing on a row where first...

  • RE: Strange behaviour

    FWIW, Thinking it might have been generating an n x 1 CROSS JOIN, I moved the JOIN dbo.lookup out of the select statement in the function, since it wasn't actually...

  • RE: Strange behaviour

    Now, when I change the definition of that column in the table function to allow NULLs, it works!

    And the last 2 versions which previously threw the error do NOT...

  • RE: Strange behaviour

    Once again, that's not the problem: call that function directly with the single value -- and there is only one single value in this example -- and it works just...

  • RE: Strange behaviour

    That's not the problem, HanShi. The first name and last names are not null in this instance, and if you look at the original post, you'll note the code works...

  • RE: Strange behaviour

    Function code below.

    Specifically, the error thrown is:

    Msg 515, Level 16, State 2, Line 1

    Cannot insert the value NULL into column 'Clientname', table '@tRS'; column does not allow nulls. INSERT fails.

    The...

  • RE: Strange behaviour

    Lol! Fail as in throws an error. (But for my users, it's the End. Of. The. World.)

    The cross apply returns a table, but the table has the columns defined not...

  • RE: Phantom FK violation

    WHILE: Agreed. However, this sproc is called for Inserts and updates an average of 10x/day, so the perf hit is probably not noticeable.

    As for the cursor, there are 2 related...

  • RE: Phantom FK violation

    Sean, I'd be happy to hear any suggestions re: perf improvement.

  • RE: Phantom FK violation

    The value is passed in the call to the sproc:

    DECLARE @nKeyword_IdVarINTEGER = 120375

    DECLARE @nErrorVarINTEGER = 0

    BEGIN TRAN New_Tran

    EXECUTE @nErrorVar = dbo.wadw_keywords

    @cActionArg = 'D',

    @nKeyword_IdArg = @nKeyword_IdVar OUTPUT

    So it was evaluating to...

Viewing 15 posts - 151 through 165 (of 482 total)