Forum Replies Created

Viewing 15 posts - 12,196 through 12,210 (of 13,461 total)

  • RE: When does a Trigger trigger?

    your sources are right, it is a set based operation...only one execution for the all affected rows.

    this is the advantage of Set Based Operations

    if you update a table so...

  • RE: Cannot drop temp table

    you want to drop only the tables that are related to your connection; your IF EXISTS statement checks accross all connections, so you could pick up a temp table from...

  • RE: datetime stamping for ModifiedDate and CreatedDate

    yeah, in order to have a changedDt column with the last Updated/changed, you'd need to add a trigger to the table. with the trigger, you'd be able to update the...

  • RE: datetime stamping for ModifiedDate and CreatedDate

    the timestamp datatype lets you know the last affected automatically, but it's not a datetime field;

    here's an example:

    create table #sample(somevalue varchar(30),CreatedDt datetime default getdate(),ChangedDt timestamp)

    insert into #sample(somevalue) values('value 1')

    insert into...

  • RE: Destroyed databases with SQL 2005 Express

    i use this cursor below on our dev machine at work;

    it runs as a job twice a day, which is often enough to switch any new or newly restored databases...

  • RE: CASE with SELECT * FROM TableName not possible?!

    it's kinda straightforward i think; a case statement can return only one datatype.

    when the case is constructed, i think it is assuming the first item int he case statement will...

  • RE: Foreign Key help!!

    AFTER YOU PRINT YOUR VARIABLE, I THINK YOU'LL SEE HTE MISSING OPEN PARENTHESIS FOR OBJECT_ID FUNCTION:

    parent_object_id = OBJECT_ID(' + @table + ')'

  • RE: Adding same foreign key to two columns

    when i reformatted your sql for readability, it was missing a couple of commas.

    this works:

    CREATE TABLE BATCHES_LOTS (

    [BATCHNO] varchar (15),

    [TRANSFERID] int,

    CONSTRAINT PK_BATCHES_LOT PRIMARY KEY (BATCHNO,TRANSFERID ))

    CREATE...

  • RE: loading data from Oracle

    i googled for "oracle epoch date" and found a lot of stuff.

    one of the more obvious selectiosn was where they took the datatime as a double, and subtracted it from...

  • RE: Create trigger on update

    Andras's example of the trigger determining what changed is perfect...but you want to send the email outside of the trigger code, and not inside it.

    remember that a trigger needs to...

  • RE: CASE with SELECT * FROM TableName not possible?!

    the case statment is for a field, I think you thought you needed to identify the table and where for each case, and that's not true:

    this is syntactically correct:

    DECLARE @Ind...

  • RE: update archivedata base from active database

    here's how I do it as a scheduled job; i don't need instant updates via a trigger:

    --new records first

    INSERT INTO ARCHIVETABLE(list_of_Columns)

    SELECT list_of_Columns from ACTIVETABLE

    LEFT OUTER JOIN ARCHIVETABLE ON...

  • RE: Set Query governor in a logon trigger

    SET QUERY_GOVERNOR_COST_LIMIT sets the limit for all commands in a batch, not at a connection or user level. so the limit was invoked during the life of the trigger execution,...

  • RE: VB script for checking whether server is running or shutdown

    there's so many levels you can check, it depends on what you want to do.

    For example:

    --you can ping a server via a script to see if DNS works/server exists on...

  • RE: T-SQL Set NOCOUNT On and Off

    the SET NOCOUNT ON command is to affect all of the subsequent commands in the batch you are running....

    if you were to set it off at the end of a...

Viewing 15 posts - 12,196 through 12,210 (of 13,461 total)