Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2003
    Location
    Sweden
    Posts
    19

    Unhappy Unanswered: where statement in a view

    I want to create a view where I grant the database user permission to insert. But how can I check in the where statement that it is the databaseuser?

    IF EXISTS (SELECT TABLE_NAME
    FROM INFORMATION_SCHEMA.VIEWS
    WHERE TABLE_NAME = 'SkrivInl_res')
    DROP VIEW SkrivInl_res
    GO
    CREATE VIEW SkrivInl_res
    AS
    SELECT Upg_nr, Kurs_kod, Pers_nr, Klass_kod, Resultat
    FROM Betyg, Kurs
    WHERE Kurs.Pers_nr = <------- here I want to check against the dbusers pers_nr
    GO

    the users log in with their pers_nr as user name.

  2. #2
    Join Date
    Sep 2003
    Posts
    522
    you mean current_user?

  3. #3
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Look up NILADIC functions in Books Online to see all your options.

    blindman

Posting Permissions

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