Forum Replies Created

Viewing 15 posts - 10,561 through 10,575 (of 13,469 total)

  • RE: Trigger not firing in SQL Server 2000

    the trigger itself looks ok, but it could still fail if any of the fields you are inserting are not null, but the data is null. That's where i...

  • RE: Trigger Code

    well, here's an example of a trigger...in this case, my trigger is keeping track of the last time a column was updated.

    for trigger interview questions, I'm afraid I can't help...

  • RE: alter query problem

    ranganathanmca (9/5/2009)


    thanks for your reply ps

    i want do it on sql query analyzer only if it possible for this plz tell me what is the error and...

  • RE: Can we schedule a job to generate scripts for objects?

    there's some script contributions here on SSC that call SMO; I've done this all via TSQL, where i stick a current "snapshot" of a database in a versioning table in...

  • RE: Granting Rights issue

    here's a similar example i did a while back; i was creating a database, and then adding roles, and then adding users, all as EXECUTE AS 'dbo'

    you could picksome of...

  • RE: Granting Rights issue

    I think this is exactly why they introduced the new EXECUTE AS command;

    you don't REALLY want to give them extra rights, but they need to perform certain functions.

    for #1, you...

  • RE: Reasons to use PRIMARY KEY?

    Ahh David, yeah, i fell into that SQL trap where i assume all my PK's are also the clustered index...my bad.

  • RE: Reasons to use PRIMARY KEY?

    Speed.

    the PK determines the actual order of the data, so the any SQL's that use that "PK = somevalue" is very fast...because that PK index is used, and makes...

  • RE: ANYTHING THAT CAN HELP TRIM THE DATA FOR A GIVEN STRING...

    here's how i would do it with an CTE Tally Table:

    CREATE FUNCTION StripExtraSpaces(@OriginalText VARCHAR(8000))

    RETURNS VARCHAR(8000)

    BEGIN

    DECLARE @CleanedText VARCHAR(8000)

    ;WITH tally (N) as

    (SELECT TOP 1000000 row_number() OVER...

  • RE: ANYTHING THAT CAN HELP TRIM THE DATA FOR A GIVEN STRING...

    Declare @myString Varchar(256)

    SET @MY STRING = 'A COSMETOLOGIST uses knowledge to do things to a client`s hair. A HAIRAPIST uses knowledge to give a customer guidance...

  • RE: Row in a table is out of sequence or not

    in this case, you join the table against a copy of itself, and compare;

    here i'm assuming col1 is an identity field:

    the key is to compare with an offset of...

  • RE: Creating Logins

    i don't get to play with permissions much, so this post intrigued me;

    does db_datareader automatically bring in EXECUTE permissions on views

    or db_datawriter automatically bring in EXECUTE permissions on...

  • RE: sql problem

    i read this this morning and did not know what he was after;here's a couple of guesses:

    --square root

    select sqrt(81)

    --is 3 a natural root of 81? if % 3 = 0...

  • RE: strange foreign keys error

    i think only one of the two foreign keys should have the cascade options; that would resolve your circular reference issue, right?

    the second column should reference, but not delete related...

  • RE: IF condition in CURSOR

    you could also use a CASE inside the cursor for the evaluation:

    i assume your 1=1 would actually be a real test condition;

    SELECT VendorID, Name

    FROM Purchasing.Vendor

    WHERE PreferredVendorStatus =

    CASE

    WHEN MyCondition...

Viewing 15 posts - 10,561 through 10,575 (of 13,469 total)