Trigger Syntax

Results 1 to 3 of 3

Thread: Trigger Syntax

  1. #1
    Join Date
    Dec 1969

    Default Trigger Syntax

    This is the trigger I am Trtying to create and Error I am getting.<BR><BR>Create Trigger requestExpire ON {tblRequests} <BR>AS Delete from tblRequests where requestDate &#060; getDate()<BR>GO<BR><BR>[Microsoft][ODBC SQL Server Driver]Syntax error or access violation<BR><BR>Any ideas? Its supposed to create a trigger that will delete rows from tblRequests when the requestDate expires i.e. the day after requestDate

  2. #2
    Join Date
    Dec 1969

    Default Why {}?

    If anything, use [].<BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default Also, wouldn't that delete every record

    in your table? If your deleting everything that&#039;s less than this exact millisecond you&#039;re asking (using getDate()), you might as well, just delete the whole effin table.<BR><BR>TRUNCATE TABLE tblRequests<BR><BR><BR>Or am I missing something here?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts