Forum Replies Created

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

  • RE: Cannot add rights for Builtin/administrators (SQL 2000)

    the built in administrators group has rights to everything, so logically you shouldn't add or subtract rights to a built in group.

    you usually do this two ways, add a role,...

  • RE: Executing Stored Procedure with data time column

    you shouldn't use varchar fields to carry/pass datetime fields.

    your procedure should accept datetime fields instead:

    ALTER procedure P_REALTYTAX (@DATE1 datetime, @DATE2 datetime)

    as

    ...

    to test whether this would work, simply try sticking...

  • RE: Rename a column

    yeah, there's a stored procedure for it:

    exec sp_rename 'tablename.columnname','newname','COLUMN'

  • RE: Constraints that doesn't allow ID from another table.

    it seems that what you are describing is literally the definition of a foreign key.

    1.a child table can have the ParentId as a column, and a foreign key constraint in...

  • 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...

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