how to define trigger scope variable
While the syntax of your trigger is not quite correct, this is not the source of the error. The main problem...


  Msg 8197, Level 16, State 4, Procedure ComputeGrade
  The object 'dbo.StudentMarks' does not exist or is invalid for this operation.


...is exactly what the error message states. Either you have spelled the name of the table wrong, you are in the wrong database, or it is in a schema other than dbo. To locate it, make sure you are in the right database, then run:

SELECT s.name, t.name
  FROM sys.schemas AS s
  INNER JOIN sys.tables AS t
  ON s.[schema_id] = t.[schema_id]
  WHERE t.name LIKE N'StudentMark%';


Now, on to the trigger. The main problem is this: which row do you expect to process in the case of a multi-row insert or update? Assigning a value from inserted to a variable assigns exactly one value. Which one will it be? The first one? The last one? Random? You should re-write it using a set-based operation, for example:

CREATE TRIGGER dbo.ComputeGrade 
   ON  dbo.StudentMarks 
   AFTER INSERT,UPDATE
AS 
BEGIN
    SET NOCOUNT ON;

    UPDATE m
      SET Grade = CASE
        WHEN MarkObtained &lt; 50 THEN 'Fail'
        WHEN MarkObtained &lt; 65 THEN 'Fair'
        WHEN MarkObtained &lt; 75 THEN 'Good'
        WHEN MarkObtained &lt; 85 THEN 'Very Good'
        ELSE 'Excellent' END
   FROM dbo.StudentMarks AS m
   INNER JOIN inserted AS i
   ON m.[key column] = i.[key column];
END


But even better than a trigger would be a computed column.

ALTER TABLE dbo.StudentMarks DROP COLUMN Grade;

ALTER TABLE dbo.StudentMarks ADD Grade AS
  CONVERT(VARCHAR(10), CASE
        WHEN MarkObtained &lt; 50 THEN 'Fail'
        WHEN MarkObtained &lt; 65 THEN 'Fair'
        WHEN MarkObtained &lt; 75 THEN 'Good'
        WHEN MarkObtained &lt; 85 THEN 'Very Good'
        ELSE 'Excellent' END);


This way there is no trigger to maintain (or keep enabled) and all data is automatically synced at all times.