Re: SQL Server Application Roles

From: Chuck Hawkins (charles.hawkins_at_NOSPAMjenzabar.net)
Date: 11/21/05

  • Next message: Howard Hoffman: "SQL Server 2005 Service Accounts Questions / Seeking Recommendations"
    Date: Mon, 21 Nov 2005 09:24:54 -0500
    
    

    Au contraire.

    Application roles have certainly not been deprecated in SQL 2005. They are
    very much alive and well and actually improved. In SQL 2005 you can actually
    unset the application role and return back to the user's original context.
    This is conveninent in allowing you to move in and out of different parts of
    an application with different security contexts. One application role might
    have broad rights in one part of a schema while another might have broad
    rights in another part. You might have a master control table specifying
    which users can walk into which application roles.

    Chuck Hawkins

    "Dan Guzman" <guzmanda@nospam-online.sbcglobal.net> wrote in message
    news:uwPjvwc7FHA.3636@TK2MSFTNGP09.phx.gbl...
    >I assume you are using SQL 2000. Application roles have been deprecated in
    >SQL Server 2005.
    >
    > You need a single-quote after the password literal. Also, when you use
    > application roles, consider disabling connection pooling.
    >
    > --
    > Hope this helps.
    >
    > Dan Guzman
    > SQL Server MVP
    >
    > "Jonathan Allen" <x@x.x> wrote in message
    > news:eeb26qV7FHA.3388@TK2MSFTNGP11.phx.gbl...
    >> Allow me to restate my question.
    >>
    >> What the hell is the right way to use application roles from VB/C#? When
    >> I try the below code, I get an exception the second time I call
    >> GetDBConnection.
    >>
    >> --
    >> Jonathan Allen
    >>
    >>
    >> "Jonathan Allen" <x@x.x> wrote in message
    >> news:eF4AhZV7FHA.472@TK2MSFTNGP15.phx.gbl...
    >>> Is this the correct way to use application roles?
    >>>
    >>> Public Function GetDBConnection() As SqlConnection
    >>> Dim oCon As New SqlConnection(myConnectionString)
    >>> oCon.Open()
    >>> Using oCmd As SqlCommand = oCon.CreateCommand
    >>> oCmd.CommandText = "IF NOT User_NAME() = 'app_name' Exec
    >>> sp_setapprole 'app_name' ,'password"
    >>> oCmd.ExecuteNonQuery()
    >>> End Using
    >>> Return oCon
    >>>
    >>> What is a good way to embed/encrypt the application role's password in
    >>> the program?
    >>>
    >>> --
    >>> Jonathan Allen
    >>>
    >>>
    >>>
    >>>
    >>
    >>
    >
    >


  • Next message: Howard Hoffman: "SQL Server 2005 Service Accounts Questions / Seeking Recommendations"

    Relevant Pages

    • Re: Unable to Apply SP4 to SQL 2000 Cluster (new Node)
      ... Rebuild the node in the failover cluster. ... Scenario 1" in SQL Server 2000 Books Online. ... This setup process updates to SP4 only the binaries on the new ...
      (microsoft.public.sqlserver.clustering)
    • Re: WSS 3.0 question
      ... I followed the advise given in removing WSS 3.0 etc, ... the server is complaining that the SQL service(?) was tempered with or corrupt. ... I may just instal the SQL server as I was going eventuall use it anyway. ... If WSUS 3.0 is installed, I would suggest you uninstall it and then you install WSS 3.0. ...
      (microsoft.public.windows.server.sbs)
    • Re: SQL Server 2005 Cluster Setup Quiz
      ... I did test and it did not install the client tools. ... http://www.clusterhelp.com - Cluster Training ... Microsoft SQL Server MVP ... Provide a template on how to read SQL Server 2005 setup log files. ...
      (microsoft.public.sqlserver.clustering)
    • Re: WSUS
      ... I'm not seeing performance issues with the full enchilada installed, and 25 users busy hitting SQL. ... WSUS isn't difficult to uninstall - if you have WSUS v2 (installed with SBS R2) uninstall R2 from add/remove programs. ... How can anyone work with 4 instances of SQL Server on the same box? ...
      (microsoft.public.windows.server.sbs)
    • Re: Cannot setup SQL Mail on SBS 2003
      ... Microsoft CSS Online Newsgroup Support ... Cannot setup SQL Mail on SBS 2003 ... The account you use to start the SQL Server service must be a domain ...
      (microsoft.public.windows.server.sbs)