I wanted to read .bak files that are the backup files of my ms sql database.Now I am wodering how to read these files using Sql Mngmnt studio. Please help me out .Thanks
You can restore the .BAK file to a temporary database using SQL Management Studio and read them!
Some pointers here
you can restore the .bak file.there you get all the datas
Related
I am looking to attach a .MDF database file via a SQL query that has no .LDF file. That said, I need the .LDF path to be able to be set to a different location from the .MDF.
As far as I can tell CREATE DATABASE...FOR ATTACH doesn't provide this ability.
Any way around this?
I have a .sql file. How can I convert this .sql file to a .mdf SQL Server database file?
I know that .sql file is nothing but a script file if I open the .sql file in notepad it will show me the db code I can simply copy those code and paste into SQL Server Management Studio.
Is there any other way to convert .sql to .mdf file?
Unless your SQL file contains the script to create a database, your question wouldn't make any sense. If it does contain such script you need an environment to execute it. There are many tools that will allow you to do that. For example, many IDE tools that integrate with SQL Server have such capability.
So to answer your question: it is impossible to convert SQL file to MDF. You, however, can sometimes use an SQL file to build MDF.
I want to change the place of my database. but I have make one small mistake...
I have attached my db but I have not select LDF file therefore SQL creates one new LDF file. Now I want to attach my old LDF.
So how can I do that??
What I have tried is : first detach then delete new LDF and re-attach with old LDF but it gives me error like :
One or more files do not match the primary file of the database. If
you are attempting to attach a database, retry the operation with the
correct files. If this is an existing database, the file may be
corrupted and should be restored from a backup.
More Info. : I am using SQL 2008 R2
You need to attach your old MDF and your old LDF. If you have a backup of the database then you can restore the backup. If you do not have your old MDF nor a backup, then you lost your data.
I'm sorry that I put this question because I think that is simple but I don't know how to do this think because I am a beginner.
I made a database in sql server management studio 2008 express and now I need to send this database to somebody by email.Where is this database saved?
I need to send it with all tables I created and with the diagram.
Should I generate a script or the database is saved somewhere on my computer.
You can take backup of your database and you will get .bak file as a database backup copy then you can mail anyone and they can just restore it to use it.
In sql server management studio 2008 -> Right click on your database -> Task -> backup
To Restore the database right click on Databases then Restore database give the location
of .bak file.
I have a SQL Server DB that is about 13Gb with a 1.6Gb log file. When I back it up, however, it creates a 50Gb .bak file! Why is that?
I have read some commentary here about transaction logs, but my DB runs on my laptop and there is no DB activity during the time of the backup. (It only takes 5 minutes).
My backup type is Full, my recovery type is Full, and I am doing Copy-Only backups. Any ideas? Much appreciated!
I am using SQL 2008 R2, Developer Edition.
It might be because the backup routine is appending the new backup to the same file?
There is an option in the Backup dialog in Sql Management Studio to Append or Overwrite all existing backup sets. If you have Append if will add the backup to the same .bak file and the .bak file will be larger for every backup.
In Transact Sql it is the INIT and NOINIT option which determine if the bak file is overwritten or appended.
In my case, I found that the 500MB database also had a 560MB full text catalogue attached which gets included in the backup file. I thought I'd add this despite another answer having been accepted in case anyone else is still stumped :)
In my case, heavy use of filestream objects made for the largest part of the backup file.