Database permission error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Taishi

    Database permission error

    Andy,

    I am new to SQL. It was hard just to figure out how to install it.

    I know I am logged in as a Admin. in Windows.

    I have the little server box with the round circle on it in the bottom right
    corner(toolbar) . The SQL Server Service Manager.

    I tried to search for the sp_helpsrvrolem ember command on my drive. It's
    not on the server.

    Any ideas?

    Do anyone have any suggestions?

    Thanks for your help,
    T



    "Andy Svendsen" <andymcdba1@NOM ORESPAM.yahoo.c om> wrote in message
    news:#3883ky6DH A.2628@TK2MSFTN GP10.phx.gbl...[color=blue]
    > Are you connecting with a trusted connection or as sa. It sounds like you
    > do not have the access required to create a database. Make sure you are
    > connecting in as a member of the Administrators group on that machine so[/color]
    you[color=blue]
    > become part of the sysadmin (aka System Administrators) role. At a[/color]
    minimum[color=blue]
    > you need the dbcreator role level access. Running
    >
    > sp_helpsrvrolem ember 'sysadmin'
    > -- or --
    > sp_helpsrvrolem ember 'dbcreator'
    >
    > will tell you who belongs to these roles. Looking at the Query window[/color]
    title[color=blue]
    > bar will tell you who you are logged in as.
    >
    > <servername>.<d atabase name>.<loginnam e> or <DOMAIN>\<usern ame> (for Win[/color]
    NT[color=blue]
    > authentication)
    >
    >
    > Reboot and sharing the folder will not help. You might want to check the[/color]
    NT[color=blue]
    > permissions though.
    >
    > --
    > *************** *************** *************** *************** *******
    > Andy S.
    > MCSE NT/2000, MCDBA SQL 7/2000
    > andymcdba1@NOMO RESPAM.yahoo.co m
    >
    > Please remove NOMORESPAM before replying.
    >
    > Always keep your antivirus and Microsoft software
    > up to date with the latest definitions and product updates.
    > Be suspicious of every email attachment, I will never send
    > or post anything other than the text of a http:// link nor
    > post the link directly to a file for downloading.
    >
    > This posting is provided "as is" with no warranties
    > and confers no rights.
    >
    > *************** *************** *************** *************** *******
    > "Taishi" <taishi_bak@hot mail.com> wrote in message
    > news:%23ZocZIy6 DHA.2568@TK2MSF TNGP10.phx.gbl. ..[color=green]
    > > Windows Pro
    > >
    > > Receiving the following error:
    > >
    > > CREATE DATABASE permission denied in database 'master'. Could not attach
    > > database 'pubs' to file 'D:\Program Files\Microsoft SQL
    > > Server\MSSQL$NE TSDK\Data\pubs. mdf'.
    > >
    > > Here are some things done to try to resolve the problem:
    > >
    > > Reboot 4-5 times
    > > Shared out the folder
    > > Web shared the folder
    > >
    > >
    > > Thanks for your help,
    > > T.
    > >
    > >
    > >[/color]
    >
    >[/color]


  • Erland Sommarskog

    #2
    Re: Database permission error

    Taishi (taishi_bak@hot mail.com) writes:[color=blue]
    > I tried to search for the sp_helpsrvrolem ember command on my drive. It's
    > not on the server.[/color]

    Searching the drive? There you will not find it. This is not a command
    you run Explorer or the Command-Line Window.

    This is a command that you run in Query Analyzer that comes with SQL Server.
    From Query Analyzer you can pass any T-SQL command to SQL Server and
    ser the result from it.



    --
    Erland Sommarskog, SQL Server MVP, sommar@algonet. se

    Books Online for SQL Server SP3 at
    Get the flexibility you need to use integrated solutions, apps, and innovations in technology with your data, wherever it lives—in the cloud, on-premises, or at the edge.

    Comment

    • Taishi

      #3
      Re: Database permission error

      I am using WIN XP Pro and the SQL is the MSDE.

      How can I check my access?

      How can I resolve the following error?

      CREATE DATABASE permission denied in database 'master'. Could not attach
      database 'pubs' to file 'D:\Program Files\Microsoft SQL
      Server\MSSQL$NE TSDK\Data\pubs. mdf'.

      Thanks,
      T.

      "Erland Sommarskog" <sommar@algonet .se> wrote in message
      news:Xns9486F27 E141C6Yazorman@ 127.0.0.1...[color=blue]
      > Taishi (taishi_bak@hot mail.com) writes:[color=green]
      > > I tried to search for the sp_helpsrvrolem ember command on my drive.[/color][/color]
      It's[color=blue][color=green]
      > > not on the server.[/color]
      >
      > Searching the drive? There you will not find it. This is not a command
      > you run Explorer or the Command-Line Window.
      >
      > This is a command that you run in Query Analyzer that comes with SQL[/color]
      Server.[color=blue]
      > From Query Analyzer you can pass any T-SQL command to SQL Server and
      > ser the result from it.
      >
      >
      >
      > --
      > Erland Sommarskog, SQL Server MVP, sommar@algonet. se
      >
      > Books Online for SQL Server SP3 at
      > http://www.microsoft.com/sql/techinf...2000/books.asp[/color]


      Comment

      • Erland Sommarskog

        #4
        Re: Database permission error

        Taishi (taishi_bak@hot mail.com) writes:[color=blue]
        > I am using WIN XP Pro and the SQL is the MSDE.
        >
        > How can I check my access?
        >
        > How can I resolve the following error?
        >
        > CREATE DATABASE permission denied in database 'master'. Could not attach
        > database 'pubs' to file 'D:\Program Files\Microsoft SQL
        > Server\MSSQL$NE TSDK\Data\pubs. mdf'.[/color]

        Exactly what command did you run?

        How did you log into SQL Server?

        --
        Erland Sommarskog, SQL Server MVP, sommar@algonet. se

        Books Online for SQL Server SP3 at
        Get the flexibility you need to use integrated solutions, apps, and innovations in technology with your data, wherever it lives—in the cloud, on-premises, or at the edge.

        Comment

        • Taishi

          #5
          Re: Database permission error

          I haven't ran any commands. I just installed it and tried to access the
          dbase from a web form. The error is in my first post. I installed the MSDE
          2000 from the following web site:

          ww.microsoft.co m/downloads

          Featured download
          Microsoft SQL Server 2000
          Desktop Engine(MSDE 2000) Release A

          I don't have the SQL server disks.

          Any ideas? What commands can I use to check access rights?

          Thanks,
          T.

          "Erland Sommarskog" <sommar@algonet .se> wrote in message
          news:Xns9488110 73404Yazorman@1 27.0.0.1...[color=blue]
          > Taishi (taishi_bak@hot mail.com) writes:[color=green]
          > > I am using WIN XP Pro and the SQL is the MSDE.
          > >
          > > How can I check my access?
          > >
          > > How can I resolve the following error?
          > >
          > > CREATE DATABASE permission denied in database 'master'. Could not attach
          > > database 'pubs' to file 'D:\Program Files\Microsoft SQL
          > > Server\MSSQL$NE TSDK\Data\pubs. mdf'.[/color]
          >
          > Exactly what command did you run?
          >
          > How did you log into SQL Server?
          >
          > --
          > Erland Sommarskog, SQL Server MVP, sommar@algonet. se
          >
          > Books Online for SQL Server SP3 at
          > http://www.microsoft.com/sql/techinf...2000/books.asp[/color]


          Comment

          • Erland Sommarskog

            #6
            Re: Database permission error

            Taishi (taishi_bak@hot mail.com) writes:[color=blue]
            > I haven't ran any commands. I just installed it and tried to access the
            > dbase from a web form. The error is in my first post. I installed the
            > MSDE 2000 from the following web site:
            >
            > ww.microsoft.co m/downloads
            >
            > Featured download
            > Microsoft SQL Server 2000
            > Desktop Engine(MSDE 2000) Release A
            >
            > I don't have the SQL server disks.
            >
            > Any ideas? What commands can I use to check access rights?[/color]

            Obviously then that web form tried run some commands. Exactly where
            did this web form come from? Did you write it yourself, or was it included
            in the download?

            Is the web server on the same machine as MSDE? And what rights does the
            account that web server is logged in have?

            I would assume that the web form logs into MSDE with Windows authentication,
            but it does not have sysadmin privileges. If you give the web-server account
            administrator privileges in Windows, things might go better. You may have to
            restart the web server for the change to have effect.
            --
            Erland Sommarskog, SQL Server MVP, sommar@algonet. se

            Books Online for SQL Server SP3 at
            Get the flexibility you need to use integrated solutions, apps, and innovations in technology with your data, wherever it lives—in the cloud, on-premises, or at the edge.

            Comment

            • Taishi

              #7
              Re: Database permission error



              "Erland Sommarskog" <sommar@algonet .se> wrote in message
              news:Xns948A645 8FF29BYazorman@ 127.0.0.1...[color=blue]
              > Taishi (taishi_bak@hot mail.com) writes:[color=green]
              > > I haven't ran any commands. I just installed it and tried to access the
              > > dbase from a web form. The error is in my first post. I installed the
              > > MSDE 2000 from the following web site:
              > >
              > > ww.microsoft.co m/downloads
              > >
              > > Featured download
              > > Microsoft SQL Server 2000
              > > Desktop Engine(MSDE 2000) Release A
              > >
              > > I don't have the SQL server disks.
              > >
              > > Any ideas? What commands can I use to check access rights?[/color]
              >
              > Obviously then that web form tried run some commands. Exactly where
              > did this web form come from? Did you write it yourself, or was it included
              > in the download?
              >
              > Is the web server on the same machine as MSDE? And what rights does the
              > account that web server is logged in have?
              >
              > I would assume that the web form logs into MSDE with Windows[/color]
              authentication,[color=blue]
              > but it does not have sysadmin privileges. If you give the web-server[/color]
              account[color=blue]
              > administrator privileges in Windows, things might go better. You may have[/color]
              to[color=blue]
              > restart the web server for the change to have effect.
              > --
              > Erland Sommarskog, SQL Server MVP, sommar@algonet. se
              >
              > Books Online for SQL Server SP3 at
              > http://www.microsoft.com/sql/techinf...2000/books.asp[/color]

              I wrote the Web form myself. Everything is on the same machine.

              I have to figure out your question about the Web Server account.

              I am using IIS and ASP. (i feel dumb)

              Is IIS my web server?

              Thanks for help,
              T.


              Comment

              • Erland Sommarskog

                #8
                Re: Database permission error

                Taishi (taishi_bak@hot mail.com) writes:[color=blue]
                > I wrote the Web form myself. Everything is on the same machine.[/color]

                Ah, but if you wrote the web form, you also included commands for
                SQL Server one way or another.
                [color=blue]
                > I have to figure out your question about the Web Server account.
                >
                > I am using IIS and ASP. (i feel dumb)
                >
                > Is IIS my web server?[/color]

                I don't know much about IIS (or ASP), but I believe it is a web server.

                --
                Erland Sommarskog, SQL Server MVP, sommar@algonet. se

                Books Online for SQL Server SP3 at
                Get the flexibility you need to use integrated solutions, apps, and innovations in technology with your data, wherever it lives—in the cloud, on-premises, or at the edge.

                Comment

                • Taishi

                  #9
                  Re: Database permission error

                  Erland,

                  Do you know how to use Enterprise Manager?

                  I was able to find a trial version of the Enterprise Manager.

                  After reading my error today, I can see there is a problem with 2 dbases
                  'PUBS' and 'Master'

                  CREATE DATABASE permission denied in database 'master'. Could not attach
                  database 'pubs' to file 'D:\Program Files\Microsoft SQL
                  Server\MSSQL$NE TSDK\Data\pubs. mdf'.

                  I can see the following in the MSDE manager:

                  sql server(my machine name\??SDK)
                  after I right click on 'PUBS' the following pops up.
                  ---Users/Roles/Public
                  ---public
                  ---machine_name\as pnet
                  ---guest

                  guest is the only one with 5 check marks going across from left to right for
                  the following:
                  Create Table, Create View, Create SP, Create Default, Create Rule

                  the following 3 are blank:
                  Create Function, Backup DB, and Backup Log

                  public has just 1 check mark on
                  Create SP

                  machine_name\as pnet is blank from left to right.

                  CREATE DBASE right is not displayed.

                  How can I solve my Permission denied error problem?

                  Thanks for the help,
                  Taishi

                  "Erland Sommarskog" <sommar@algonet .se> wrote in message
                  news:Xns948AEF0 77388EYazorman@ 127.0.0.1...[color=blue]
                  > Taishi (taishi_bak@hot mail.com) writes:[color=green]
                  > > I wrote the Web form myself. Everything is on the same machine.[/color]
                  >
                  > Ah, but if you wrote the web form, you also included commands for
                  > SQL Server one way or another.
                  >[color=green]
                  > > I have to figure out your question about the Web Server account.
                  > >
                  > > I am using IIS and ASP. (i feel dumb)
                  > >
                  > > Is IIS my web server?[/color]
                  >
                  > I don't know much about IIS (or ASP), but I believe it is a web server.
                  >
                  > --
                  > Erland Sommarskog, SQL Server MVP, sommar@algonet. se
                  >
                  > Books Online for SQL Server SP3 at
                  > http://www.microsoft.com/sql/techinf...2000/books.asp[/color]


                  Comment

                  • Erland Sommarskog

                    #10
                    Re: Database permission error

                    Taishi (taishi_bak@hot mail.com) writes:[color=blue]
                    > Do you know how to use Enterprise Manager?[/color]

                    Barely. :-) I prefer to carry most of my task by submitting T-SQL
                    commands from Enterprise Manager.
                    [color=blue]
                    > I was able to find a trial version of the Enterprise Manager.
                    >
                    > After reading my error today, I can see there is a problem with 2 dbases
                    > 'PUBS' and 'Master'
                    >
                    > CREATE DATABASE permission denied in database 'master'. Could not attach
                    > database 'pubs' to file 'D:\Program Files\Microsoft SQL
                    > Server\MSSQL$NE TSDK\Data\pubs. mdf'.[/color]

                    But you still have not told us what that web form is doing! Sorry, I
                    cannot give much precise help if you don't explain what you are trying
                    to do.

                    But for the record, master and pubs are both databases that comes with
                    SQL Server, but they are very different. pubs is a regular user database,
                    and is there for demonstration and training purposes. master on the
                    other hand, is, as the name, indicates the master database. In this
                    database, SQL Server stores all server-wide information, for instance
                    which databases there are.

                    So the permission error applies to the master database, not to pubs.
                    I can't tell why you get this error, because I don't know what you
                    are doing (and you refuse to tell me). But since pubs already exist,
                    you cannot attach it anyway.

                    Anyway, what I tried to tell you last time, is that the web server
                    needs to connect to SQL Server with sysadmin privileges to create
                    databases, and to do that it must either log in as "sa" using SQL
                    Server authentication, or log using Windows authentication with an
                    account that has Administrator rights in Windows, or which have been
                    added to the sysadmin role in SQL Server.

                    So the rights you should are those that the IIS account has.
                    --
                    Erland Sommarskog, SQL Server MVP, sommar@algonet. se

                    Books Online for SQL Server SP3 at
                    Get the flexibility you need to use integrated solutions, apps, and innovations in technology with your data, wherever it lives—in the cloud, on-premises, or at the edge.

                    Comment

                    • Taishi

                      #11
                      Re: Database permission error

                      Erland,

                      The web form is using a listbox to list items from SQL.

                      Here is my code:

                      Dim drStores As SqlClient.SqlDa taReader

                      If Not IsPostBack Then

                      conPubs.Open()

                      drStores = cmdStores.Execu teReader()

                      ddlStores.DataS ource = drStores

                      ddlStores.DataT extField = "stor_name"

                      ddlStores.DataB ind()

                      drStores.Close( )

                      conPubs.Close()

                      End If

                      I didn't close my conPubs()-->MyConnection . That's one reason why I was
                      receiving the error before. But now my problem is that the ListBox is not
                      populating. The form just has a box that is empty. Seems simple for an
                      experienced programmer but I'm not at the level, yet.

                      In the Properties for MyConnection I have the following as my Connection
                      String:

                      workstation id=MyMachineNam e;packet size=4096;integ rated security=SSPI;d ata
                      source="MyMachi neName\vsdotnet ";attachdbfilen ame="D:\Program Files\Microsoft
                      SQL Server\MSSQL$NE TSDK\Data\pubs. mdf";persist security info=False;init ial
                      catalog=pubs

                      In the Properties for MyCommand I have the following as my Connection
                      String:

                      workstation id=MyMachineNam e;packet size=4096;integ rated security=SSPI;d ata
                      source="MyMachi neName\vsdotnet ";attachdbfilen ame="D:\Program Files\Microsoft
                      SQL Server\MSSQL$NE TSDK\Data\pubs. mdf";persist security info=False;init ial
                      catalog=pubs

                      I'm trying to grasp the concept but it's frustrating.

                      So, now you should know all about my web form.

                      Any ideas on how to fix my problem?

                      I will pay a million dollars for the answer to this problem. :-)

                      Thanks,
                      T.




                      End Sub

                      "Erland Sommarskog" <sommar@algonet .se> wrote in message
                      news:Xns948CEBA 55DYazorman@127 .0.0.1...[color=blue]
                      > Taishi (taishi_bak@hot mail.com) writes:[color=green]
                      > > Do you know how to use Enterprise Manager?[/color]
                      >
                      > Barely. :-) I prefer to carry most of my task by submitting T-SQL
                      > commands from Enterprise Manager.
                      >[color=green]
                      > > I was able to find a trial version of the Enterprise Manager.
                      > >
                      > > After reading my error today, I can see there is a problem with 2 dbases
                      > > 'PUBS' and 'Master'
                      > >
                      > > CREATE DATABASE permission denied in database 'master'. Could not attach
                      > > database 'pubs' to file 'D:\Program Files\Microsoft SQL
                      > > Server\MSSQL$NE TSDK\Data\pubs. mdf'.[/color]
                      >
                      > But you still have not told us what that web form is doing! Sorry, I
                      > cannot give much precise help if you don't explain what you are trying
                      > to do.
                      >
                      > But for the record, master and pubs are both databases that comes with
                      > SQL Server, but they are very different. pubs is a regular user database,
                      > and is there for demonstration and training purposes. master on the
                      > other hand, is, as the name, indicates the master database. In this
                      > database, SQL Server stores all server-wide information, for instance
                      > which databases there are.
                      >
                      > So the permission error applies to the master database, not to pubs.
                      > I can't tell why you get this error, because I don't know what you
                      > are doing (and you refuse to tell me). But since pubs already exist,
                      > you cannot attach it anyway.
                      >
                      > Anyway, what I tried to tell you last time, is that the web server
                      > needs to connect to SQL Server with sysadmin privileges to create
                      > databases, and to do that it must either log in as "sa" using SQL
                      > Server authentication, or log using Windows authentication with an
                      > account that has Administrator rights in Windows, or which have been
                      > added to the sysadmin role in SQL Server.
                      >
                      > So the rights you should are those that the IIS account has.
                      > --
                      > Erland Sommarskog, SQL Server MVP, sommar@algonet. se
                      >
                      > Books Online for SQL Server SP3 at
                      > http://www.microsoft.com/sql/techinf...2000/books.asp[/color]


                      Comment

                      • Erland Sommarskog

                        #12
                        Re: Database permission error

                        Taishi (taishi_bak@hot mail.com) writes:[color=blue]
                        > I didn't close my conPubs()-->MyConnection . That's one reason why I was
                        > receiving the error before. But now my problem is that the ListBox is not
                        > populating. The form just has a box that is empty. Seems simple for an
                        > experienced programmer but I'm not at the level, yet.
                        >
                        > In the Properties for MyConnection I have the following as my Connection
                        > String:
                        >
                        > workstation id=MyMachineNam e;packet size=4096;integ rated
                        > security=SSPI;d ata
                        > source="MyMachi neName\vsdotnet ";attachdbfilen ame="D:\Program
                        > Files\Microsoft SQL Server\MSSQL$NE TSDK\Data\pubs. mdf";persist security
                        > info=False;init ial catalog=pubs
                        >
                        > In the Properties for MyCommand I have the following as my Connection
                        > String:
                        >
                        > workstation id=MyMachineNam e;packet size=4096;integ rated
                        > security=SSPI;d ata
                        > source="MyMachi neName\vsdotnet ";attachdbfilen ame="D:\Program
                        > Files\Microsoft SQL Server\MSSQL$NE TSDK\Data\pubs. mdf";persist security
                        > info=False;init ial catalog=pubs[/color]


                        Ah, we're on to something here. Take out that "attachdbfilena me" from
                        your Connection string. I see in MSDN Library, that this property is
                        actually supported for SqlClient, although I cannot understand the point
                        with it. Anyway, since pubs is already attached, you have no reason
                        to meddle with it.

                        --
                        Erland Sommarskog, SQL Server MVP, sommar@algonet. se

                        Books Online for SQL Server SP3 at
                        Get the flexibility you need to use integrated solutions, apps, and innovations in technology with your data, wherever it lives—in the cloud, on-premises, or at the edge.

                        Comment

                        Working...