Forum Replies Created

Viewing 15 posts - 6,616 through 6,630 (of 7,608 total)

  • RE: Update Help..

    Also, be sure to check: sys.sql_expression_dependencies.

    And not just in its own db but in other dbs, esp. on the same instance.

    And the usual disclaimer: even that isn't guaranteed to be...

  • RE: data design considerations

    There must be more fragmentation in a history table than a current-data-only table.

    For single row lookups, this is not really a performance hit.

    But for table scans, even partial ones, it...

  • RE: Execute SQL in all database

    EXEC sp_MSforeachdb '

    IF NOT EXISTS(SELECT 1 FROM [?].sys.tables WHERE name = N''myTable'')

    RETURN

    SELECT ''?'' AS Db_Name, *

    FROM [?]..mytable

    '

  • RE: Count number of days that a doctor works

    My best guess on the very limited info so far is something like this:

    select MonthName, DocName, count(distinct day(appointment_date)) as days_worked

    from Appointments

    group by MonthName, DocName

  • RE: Any potential issues with putting a Stored Procedure in Master?

    You could easily use master for that. Especially given that you must use master for some procedures anyway. Moreover, it's much easier from SQL2005 on to distinguish your...

  • RE: Query - Please Help!

    sp_MSforeachdb is indeed a cursor, and not a particularly good one.

    Still, it exists, and it's useful for quick-and-dirty tasks sometimes, particularly if you don't have a lot of dbs.

    So, I'll...

  • RE: Alpha Numeric number Generation

    Sean Lange (3/26/2013)


    nitin_456 (3/25/2013)


    So the idea here is to Generate 2 -3 million consecutive unique numbers by using 5 Alpha Numeric digit. Please if you can help around this will...

  • RE: data design considerations

    The main table would still hold the entire current record. Even if the history table contains the current record, you don't want to get it from there because of...

  • RE: Only allow users to see their own records

    I don't see why it would necessarily be that bad, at least for a straightforward "row must match the username" check. I've done these a few times w/o any...

  • RE: Remove characters after last slash in string

    And, finally, you don't really need SUBSTRING, LEFT is good enough :-):

    SELECT @string, LEFT(@string, LEN(@string) - CHARINDEX('\', REVERSE(@string)) + 1)

  • RE: Only allow users to see their own records

    I wouldn't try using views, as then the table/view name changes every time, so you're forced to use dynamic SQL, which causes additional security headaches.

    Instead, I suggest creating a controller...

  • RE: Alpha Numeric number Generation

    Your stated incrementation method is so unusual and customized that I'd suggest just creating table with pre-generated key values; and, when you need to increment by one, instead of...

  • RE: Database Restore Causes Database User To Become Inoperable

    SQLKnowItAll (3/22/2013)

    IT is worth noting that we have 6 different environments and making sure all logins have a synced sid is sometimes not realistic. So that is why I...

  • RE: Database Restore Causes Database User To Become Inoperable

    SQLKnowItAll (3/22/2013)


    ScottPletcher (3/22/2013)


    SQLKnowItAll (3/22/2013)


    ScottPletcher (3/22/2013)


    IF you can very briefly drop the problem login(s) on your clients' machines, and immediately recreate them, you can fix this problem once and for all!...

  • RE: Database Restore Causes Database User To Become Inoperable

    SQLKnowItAll (3/22/2013)


    ScottPletcher (3/22/2013)


    IF you can very briefly drop the problem login(s) on your clients' machines, and immediately recreate them, you can fix this problem once and for all! Then...

Viewing 15 posts - 6,616 through 6,630 (of 7,608 total)