Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Trininole
Yak Posting Veteran
83 Posts |
Posted - 2012-03-28 : 10:59:09
|
| Does anyone know how to import a .bak file into SQL Server 2008?Roger DeFour |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2012-03-28 : 10:59:59
|
what file is that ? if it is a database backup file, then use the RESTORE DATABASE command KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
Trininole
Yak Posting Veteran
83 Posts |
Posted - 2012-03-28 : 11:03:14
|
| How do i go about using this restore database command?Roger DeFour |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2012-03-28 : 11:11:13
|
since you ask that, maybe this should be easier for youhttp://msdn.microsoft.com/en-us/library/ms177429%28v=sql.110%29.aspx KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2012-03-28 : 11:38:23
|
Place the *.BAK file on the server..Are you using SSMS (SQL Server Management Studio)?If not You should..open a new query WindowThenEXEC master..xp_cmdshell 'dir \\servername\instance\path\*.*'-- Look at the internal file informationRESTORE FILELISTONLY FROM DISK = N'\\servername\instance\path\database.BAK' GO-- If the DB Exists, Kick everyone outALTER DATABASE [database] SET SINGLE_USER WITH ROLLBACK IMMEDIATEGO-- RESTORE The database...this will overlay an existing one, OR Create a new one if not in existence-- Get the Logical file names from filelistonlyRESTORE DATABASE [database]FROM DISK = N'\\servername\instance\path\database.BAK' WITH MOVE 'logical data file' TO '\\servername\instance\datafilepath\database.MDF' ,MOVE 'logical log file' TO '\\servername\instance\datafilepath\database_log.LDF' , REPLACEGOALTER DATABASE [database] SET READ_WRITEALTER DATABASE [database] SET MULTI_USERGO Brett8-)Hint: Want your questions answered fast? Follow the direction in this linkhttp://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxWant to help yourself?http://msdn.microsoft.com/en-us/library/ms130214.aspxhttp://weblogs.sqlteam.com/brettk/http://brettkaiser.blogspot.com/ |
 |
|
|
Trininole
Yak Posting Veteran
83 Posts |
Posted - 2012-03-28 : 11:39:32
|
| Yes i am using SQL Server 2008 Management Studio!Roger DeFour |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-03-28 : 12:19:02
|
| then you've restore option available from management studio itself under tasks. Make sure .bak file is in server itself before you restore from it------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|