Forum Replies Created

Viewing 15 posts - 2,671 through 2,685 (of 7,187 total)

  • RE: Select data where keyfield not in select statement failure

    OK, please provide table DDL in the form of CREATE TABLE statements, sample data in the form of INSERT statements, and expected results. We should be able to help...

  • RE: Select data where keyfield not in select statement failure

    Do the missing rows from SALESINVOICE have NULL DELIVERYNOTE, by any chance?

    John

  • RE: Re-Write SQL Query to a View

    Phil

    I'd say you're missing a ")" at the end of both of those WHEN lines.

    Edit - either that, or get rid of the first "(" on each line - I...

  • RE: nested query - bug?

    lotusnotes (4/13/2016)


    OREDERID comes from the outer table. (Execution plan says 'nested loops- left semi join')

    You answered the question yourself. If the column isn't found in the inner query, the...

  • RE: User mapping changes dissappear

    Yes, check for triggers. If you don't find anything, try an extended events session to capture user creation, role membership changes and so on. That might give you...

  • RE: How to to change the collation of newly migrated DB?

    Bear in mind that changing the database collation doesn't change the collation of existing columns (of user tables) in the database - it'll only affect new columns. So if...

  • RE: User mapping changes dissappear

    In that case, Perry's script should return the same SID twice. Something strange is going on. You'll need to talk us through exactly what you're doing, please, perhaps...

  • RE: Who's going to SQL Bits in Liverpool?

    I'll be there Thursday, Friday and Saturday. I'll look out for you all. You'll recognise me at the party if I'm the only one who's not dressed up!

    John

  • RE: User mapping changes dissappear

    Perhaps your login is mapped to a database user with a different name? Please run this:

    USE MyDB

    SELECT u.name

    FROM sys.server_principals l

    JOIN sys.database_principals u ON l.sid = u.sid

    WHERE l.name = 'DOMAIN\serviceAcct'...

  • RE: User mapping changes dissappear

    In that case, please will you post the exact script you ran to get that result, along with the script you ran when attempting to change the mapping. You...

  • RE: I want to view a users execute permissions on stored procedures

    Actually, I've just looked at your query again, and it can't be the one you ran. There's no such column as "user" in either of the catalog views that...

  • RE: Stored proc problem

    I don't really know what to suggest, then. Are you running the stored procedure with parameters, and if so, what parameters? Have you tried running the code in...

  • RE: Stored proc problem

    What's happened to your PRINT statement?

    If I were you, I would take this opportunity to terminate all statements with a semi-colon - there'll come a day where unterminated statements are...

  • RE: Stored proc problem

    The statement before the MERGE statement is required to be terminated with a semi-colon.

    John

  • RE: Master.dbo.SysColumns

    It's the old-style join syntax. These two are equivalent:

    ...

    FROM TableA, TableB

    ...

    FROM TableA CROSS JOIN TableB

    ... as are these two:

    ...

    FROM TableA, TableB

    WHERE TableA.ID = TableB.ID

    ...

    FROM TableA INNER JOIN TableB

    ON TableA.ID...

Viewing 15 posts - 2,671 through 2,685 (of 7,187 total)