locked
Where is .dbo file stored? RRS feed

  • Question

  • User2011366442 posted

    Hi Everyone,

    This is quite bewildering and can't believe I'm asking this.

    I'm looking for the .dbo database file to back up and later publish online to make the project live but cannot find it!

    I've done the countless Windows search (Windows 7), searched every folder in my project and every folder in Visual Studio 2008. Im using SQL Express edition (2008).

    In VS08: I can goto 'Publish to provider' and it cannot find the file, the Properties of the DB state the 'Provider' is .NET Framework.

    I was under the impression is always saved it in App_Data thus its not in that directory. Is there somewhere it automatically stores the Database/.dbo file? Also, it wouldnt be a hidden file surely?

    Yet when i click to access it, I can do everything, from querying data to adding tables, SP, etc - Also, is there any script that can generate the code for the database? so i could just run that thus recreating what I've already got? I've done it in Oracle briefly in one instance during my studies - but that was all automated.

    I know I'm being rather vague will my detail, any info needed i'll do my best to provide.

    Many Thanks!

    Dan

    Wednesday, May 12, 2010 11:20 PM

Answers

  • User-132834094 posted

    dbo is Database Owner

    The dbo is a user that has implied permissions to perform all activities in the database.Any member of the sysadmin fixed server role who uses a database is mapped to the special user inside each database called dbo. Also, any object created by any member of the sysadmin fixed server role belongs to dbo automatically... ALL you have to do login with sys or sysadmin and grant Database owner permission to your User.. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, May 13, 2010 12:02 AM
  • User1096912014 posted

    I think you got totally confused. If you open SQL Server Management studio and go to Object Explore, right click, you'll find several databases. Right click again and drill down to tables.

    Each table as well as other database objects are usually created under default dbo schema. You can create your own schemas, but this is a bit advanced topic - so for now just accept that all objects in each database are created under dbo schema.

    Now, you may not find your database in the list of databases if you created it in the App_Data folder. I personally prefer to create database directly from SSMS. 

    If you created it in the App_Data folder, you may need to attach it in SSMS.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, May 13, 2010 12:46 AM
  • User2011366442 posted

    Hi belial9,

    Apologies for the delayed response and with that said I don't think your going to like my response; Hopefully other contributors on this thread will input too. It rings a bell with a previous post or maybe something I read external. I'll break it down as best as I can try to explain what I know to best of my knowledge.

    How do I physically upload to the web host manually?

    Every web host I've been with (thats a grand total of 2!) have had their own methods of doing this, with some form of Web Application backing it e.g. Sonee.com let you upload the database seperately and it auto-generates code [ConnectionStrings etc.] to go in the web.config. Others like Fasthosts do it slightly differently, (I believe it to be) creating a Database on the hosting seperately - as a completely new one, uploading the actual .dbo, linking the two, while also making a backup file format for their records. So, basically, its probably best to ask your Web Hosting. In my early days I did just upload it (like your asking) via ftp with no luck - whatsoever.

    How can you find the Database?

    My problem, with this thread, was that I either, did what you have done using the Provider for SQL Server or done it through SQL Management Studio - the more I think about it I'm thinking it was the through the Provider. I don't know why but this, like yourself, caused problems locating it. What I should have done - like I did after, was create a 'App_Data' folder in my website and Right Click > Add Item > SQL Server Database - That way it IS stored in a physical folder (as it were) on your HDD and not, to what I can only assume, is a memory format via the Provider.

    It depends on how much you have done, I had done quite a bit, but not too much to get tied up over it. I bit the bullet and started over making sure I made a file I could access while also making a backup.

    Apologies I cant actually give a definitive answer on how to access it. There must be a way. Try finding the directory for the Framework Data Provider - should one exist?

    Others on this thread have stated "all the schema stored in sys.schemas table" I don't think I was able to access this in VS08 OR SMS (SQL Management Studio) and when I got to certain points in SMS I have permission problems that I couldn't fix. Another suggestion "ALL you have to do login with sys or sysadmin and grant Database owner permission to your User.." Im sure you've already read these so sorry for reiterating.  There after it gets vague but if you could try the SQL Management Studio suggestion (Object Explorer and drill down) as well as the permissions query too if you haven't already.

    Other than that I don't know what to suggest. Also, If you can find the .MDF file your in business. Whether that be in the directory of your solution/website/project, the Visual Studio directory or the SQL folders (there is quite a few).

    Regards,

    Daniel


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, December 13, 2010 7:23 AM

All replies

  • User1096912014 posted

    Your question is unclear. dbo is database administrator and this is the default schema name for all your objects. The database in SQL Server has .MDF extension. There is also log file LDF and there could be NDF file as well.



    Wednesday, May 12, 2010 11:46 PM
  • User-1802908944 posted

    as per my understanding DBO file for Schema of Database

    we can use like this Database.Schema.Tables/SP/Function/views....

    all the schema stored in sys.schemas table


    could you please more elaborate you problem, so that we can provide you better solution.

    Wednesday, May 12, 2010 11:54 PM
  • User-132834094 posted

    dbo is Database Owner

    The dbo is a user that has implied permissions to perform all activities in the database.Any member of the sysadmin fixed server role who uses a database is mapped to the special user inside each database called dbo. Also, any object created by any member of the sysadmin fixed server role belongs to dbo automatically... ALL you have to do login with sys or sysadmin and grant Database owner permission to your User.. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, May 13, 2010 12:02 AM
  • User2011366442 posted

    as per my understanding DBO file for Schema of Database

    we can use like this Database.Schema.Tables/SP/Function/views....

    all the schema stored in sys.schemas table


    could you please more elaborate you problem, so that we can provide you better solution.


    Now knowing this, I thought it would have been done MDF of which searching, there is one file just named 'Database'. So, DBO Schema can store tables, stored procedures etc like a MDF File? If so, how can I store it or convert it to a mdf so I can use it on a live website as well as keep as backup of it as I also intend a clean install for my HDD and so I dont want to have to re-create the database again. If not, and it has stored it as another entity where is it usually kept to do the above (store to use later).

    Thursday, May 13, 2010 12:13 AM
  • User2011366442 posted

    dbo is Database Owner

    The dbo is a user that has implied permissions to perform all activities in the database.Any member of the sysadmin fixed server role who uses a database is mapped to the special user inside each database called dbo. Also, any object created by any member of the sysadmin fixed server role belongs to dbo automatically... ALL you have to do login with sys or sysadmin and grant Database owner permission to your User.. 

    I'll give that a try, where do I login and using what? (sorry for the newbie questions)

    Thursday, May 13, 2010 12:16 AM
  • User-132834094 posted

    Login in Data base using sysadmin user or sys ... and use command(Alter Query )

    ALTER Login UserNAMe

    Grant Database Owner 

    .......

     

    Thursday, May 13, 2010 12:25 AM
  • User2011366442 posted

    Login in Data base using sysadmin user or sys ... and use command(Alter Query )

    ALTER Login UserNAMe

    Grant Database Owner 

    .......



    Im not being clear enough again, apologies - using Visual Studio or SQL Management Studio? another tool? if you mean the file directly, by itself, thats wot I cant find.

    and by 'Data base' u mean, the Database.mdf file?

    Thursday, May 13, 2010 12:30 AM
  • User1096912014 posted

    I think you got totally confused. If you open SQL Server Management studio and go to Object Explore, right click, you'll find several databases. Right click again and drill down to tables.

    Each table as well as other database objects are usually created under default dbo schema. You can create your own schemas, but this is a bit advanced topic - so for now just accept that all objects in each database are created under dbo schema.

    Now, you may not find your database in the list of databases if you created it in the App_Data folder. I personally prefer to create database directly from SSMS. 

    If you created it in the App_Data folder, you may need to attach it in SSMS.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, May 13, 2010 12:46 AM
  • User2011366442 posted

    I think you got totally confused. If you open SQL Server Management studio and go to Object Explore, right click, you'll find several databases. Right click again and drill down to tables.

    Each table as well as other database objects are usually created under default dbo schema. You can create your own schemas, but this is a bit advanced topic - so for now just accept that all objects in each database are created under dbo schema.

    Now, you may not find your database in the list of databases if you created it in the App_Data folder. I personally prefer to create database directly from SSMS. 

    If you created it in the App_Data folder, you may need to attach it in SSMS.

    I never had SSMS when I began the project and used VS08's instance of creating a 'database' i was using SQL05 Express after (as it turned out and it was not wot i origionally thought, being  2008), i've downloaded 08 and 'Upgraded' to only find that its now conflicting 05/08, there both express editions, so i cant access the file no matter what now ass im getting that darn 'network instance specific error.'

    Thursday, May 13, 2010 1:08 AM
  • User1504594398 posted

    I think the confusion is arrising by matter of explaination, but I totally get what the initial poster is trying to ask, as I too have the exact same problem. Basically, I have created an asp.net website in Visual Studio 2008 which has a fully fuctional database. (which I can access via the server explorer) But the problem is that now that we have this, how do I then use that to upload it to an external web server. (Basically, I will not be hosting this from my computer by via IIS, as instead all the asp.net pages will eventually be transferred to my paid web host) But what I am trying to do is find the physical file that contains this database, so that I can physically upload to the web host manually! How is this done? and how can I find the database file in order to do this? This database was not created directly through the SQL Management Server application, but instead was created automatically by visual studio, using the ".NET Framework Data Provider for SQL Server". Any help and insight would be greatly appreciated!

    Many thanks in advance!

    -belial9.

    Saturday, December 11, 2010 3:40 PM
  • User2011366442 posted

    Hi belial9,

    Apologies for the delayed response and with that said I don't think your going to like my response; Hopefully other contributors on this thread will input too. It rings a bell with a previous post or maybe something I read external. I'll break it down as best as I can try to explain what I know to best of my knowledge.

    How do I physically upload to the web host manually?

    Every web host I've been with (thats a grand total of 2!) have had their own methods of doing this, with some form of Web Application backing it e.g. Sonee.com let you upload the database seperately and it auto-generates code [ConnectionStrings etc.] to go in the web.config. Others like Fasthosts do it slightly differently, (I believe it to be) creating a Database on the hosting seperately - as a completely new one, uploading the actual .dbo, linking the two, while also making a backup file format for their records. So, basically, its probably best to ask your Web Hosting. In my early days I did just upload it (like your asking) via ftp with no luck - whatsoever.

    How can you find the Database?

    My problem, with this thread, was that I either, did what you have done using the Provider for SQL Server or done it through SQL Management Studio - the more I think about it I'm thinking it was the through the Provider. I don't know why but this, like yourself, caused problems locating it. What I should have done - like I did after, was create a 'App_Data' folder in my website and Right Click > Add Item > SQL Server Database - That way it IS stored in a physical folder (as it were) on your HDD and not, to what I can only assume, is a memory format via the Provider.

    It depends on how much you have done, I had done quite a bit, but not too much to get tied up over it. I bit the bullet and started over making sure I made a file I could access while also making a backup.

    Apologies I cant actually give a definitive answer on how to access it. There must be a way. Try finding the directory for the Framework Data Provider - should one exist?

    Others on this thread have stated "all the schema stored in sys.schemas table" I don't think I was able to access this in VS08 OR SMS (SQL Management Studio) and when I got to certain points in SMS I have permission problems that I couldn't fix. Another suggestion "ALL you have to do login with sys or sysadmin and grant Database owner permission to your User.." Im sure you've already read these so sorry for reiterating.  There after it gets vague but if you could try the SQL Management Studio suggestion (Object Explorer and drill down) as well as the permissions query too if you haven't already.

    Other than that I don't know what to suggest. Also, If you can find the .MDF file your in business. Whether that be in the directory of your solution/website/project, the Visual Studio directory or the SQL folders (there is quite a few).

    Regards,

    Daniel


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, December 13, 2010 7:23 AM
  • User1504594398 posted

    Hi Daniel!

    Thankyou for getting back to me on this, Your advice was superb! I think your advice on creating one manually in the app_data folder instead of just using Visual Studio's built in method sounds like the best bet! I'm pretty sure that once I have a physical database file that I can locate, then I should be able to upload it okay to the web host! Thankfully, they're usually pretty helpful in explaining how to use their features, just that without having an actual database to upload, I'd have been very stuck! So thankyou for taking the time to explain this one to me, I really appreciate it! I'm willing to bet that we weren't the first people to have come across this issue, but I'm glad that you'd gotten a little further with it than I had! If I can get it to work successfully, I'll let you know if I come across anything else that might be useful in this scenario! (I'm sure that somehow we'll crack this one eventually!)

    Once again, thankyou ever so much for your help!

    All the best,

    -Jim (belial9)

    Monday, December 13, 2010 8:55 PM
  • User2011366442 posted

    Not a problem Jim, All in a days frustration :P

    Any other info would be great for other users, like you say :)

    - Daniel

    Monday, December 13, 2010 9:47 PM