Forum Replies Created

Viewing 15 posts - 4,651 through 4,665 (of 13,460 total)

  • RE: Invalid object error when I run ANYTHING!

    it sounds to me like there's a server wide or database trigger tracking DDL changes, but the auditing table hasn't been granted rights to teh users doing DDL, so it...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Need help with trigger

    and a basic example of the trigger:

    CREATE TRIGGER TR_UPDATE_EXAMPLE ON SOMETABLE

    FOR UPDATE

    AS

    BEGIN

    UPDATE SOMETABLE

    SET LastModifedUserName = SUSER_NAME(),

    LastModifedDate = GETDATE()

    FROM INSERTED

    WHERE SOMETABLE.PKID = INSERTED.PKID

    END

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Need help with trigger

    I have this saved as a handy auditing snippet;

    all these variables are available in 2008 and above, so if you have an audit table, just include some columns for the...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: security, Execute Stored Proc As

    here's a couple of examples i made from another forum post.

    this one was just a basic example, where something normally done by a sysadmin, can be delegated tro a...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: "sa" not able to access view while another user can!

    sql-noob (10/3/2012)


    question

    Isn't the sa suppose to have full control over the database?

    thanks to all of u for answering the questions with limited resources, i really appreciate it.

    As you are discovering,...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Query AD (Active Directory)

    this site has the most comprehensive list of attributes you can query that i've ever tripped over:

    http://www.rlmueller.net/UserAttributes.htm

    specifically, his excel spreadsheet has a ton of stuff:

    http://www.rlmueller.net/References/Schema.xls

    i searched for "locked" and "enabled"...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: determine which transactions add up to a specific value?

    ahh "bin packing" was the keyword; I've got a lot of saved scripts, could't remeber the label for it.

    I wrote a script i wrote long ago, but my version...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: determine which transactions add up to a specific value?

    SQLKnowItAll (10/2/2012)


    Will they be sequential, or can it be any combination of rows?

    definitely non sequential/gaps are involved;

    i'm trying a mini tally table and n-1 transactions, but i keep thinking i...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Need help to convert multiple rows of 0,1 to single row

    looks like a simple grouping problem..is this homework?

    SELECT

    Col1,

    MAX(Col2),

    MAX(Col3),

    MAX(Col4),

    MAX(Col5),

    MAX(Col6)

    GROUP BY Col1

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Rollup with varchar field

    i'm thinking that you need a case statement plus a min, ot get a status/status indicator.

    you cannot use alphabetical order of the statuses, because In Progress comes before Initial

    maybe change...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Read n-table from SQL Database

    the row counts are already materialized in one of the system tables, so if you query that, it will be boatloads faster than querying each table individually:

    Select

    ...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Help needed with a query (Cursors+union+pivot?)

    there's no need for a cursor on this, but I think youa re right, you will need to pivot the rows to columns;

    is there a fixed number of answers for...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: how to add indexes in all tables in a database

    here's the script I mentioned that blindly builds the SQL statements to create indexes on any foreign keys that do not have indexes on them yet;

    any peer review would be...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: How can I count the number of occurances of a string in an ntext column for each record?

    i like all the examples so rar, but make sure you search for <table without the ending > tag.

    if the table has a class, a css style or even older...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: how to add indexes in all tables in a database

    Steve Hendricks (9/28/2012)


    In re: "it's the selectivity of the data that is what the SQL engine uses to determine whether to use an index or not."

    For SELECTs that would be...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 15 posts - 4,651 through 4,665 (of 13,460 total)