Can I install SQL Server on a USB drive?
Asked Answered
M

4

6

I'm a developer and I often work remotely when I can rather than commuting to work. I would like to be able to take the dev database environment with me. I know I can access the database remotely, but it slow. I sometimes work where there's no wireless connection. Any ideas?

Marybelle answered 5/2, 2009 at 21:5 Comment(1)
Can you RDP to your work pc or a pc on site?Sunny
L
6

Yes, it's possible. See this thread on MSDN.

Lawhorn answered 5/2, 2009 at 21:8 Comment(1)
I guess I assumed that SQL CE wasn't an option. If so, then this is great!Levins
L
6

You can store the data files on an external drive. The server software itself, though, I'd install naively on each machine you use.

This method assumes that your database is small and or you don't care about performance that much.

For SQLServer, you'll probably have good luck if you set it to "autoclose". This will unlock the data files when the db isn't in use for some time. Otherwise, manually detaching the database or stopping SQL Server is advised when you pull the drive.

This is almost certainly an unsupported use case so I'd make sure to keep regular backups in place in case something goes wrong.

Levins answered 5/2, 2009 at 21:7 Comment(0)
L
6

Yes, it's possible. See this thread on MSDN.

Lawhorn answered 5/2, 2009 at 21:8 Comment(1)
I guess I assumed that SQL CE wasn't an option. If so, then this is great!Levins
S
0

your best bet is to backup the database to a file (on the USB drive) and restore it to a local machine.

You could also copy the file to USB and run the attach file command. I dont know if USB is going to be much better than a network connection.

Sunny answered 5/2, 2009 at 21:8 Comment(0)
C
0

While I'm sure this can be done, depending on how much IO goes on with the DB, you probably don't want to. Flash devices have a limited number of reads/writes until they fail. More specifically, this limit is within the realm of possibility when it comes to running systems off of a flash device (since, technically, all devices have a limited number to failure).

If your solution is to simply port the data around and export/import when you change sites, I'm sure that would work fine. Additionally, a lot of software is released with a "portable device" version, which makes heavy use of system RAM, and greatly decreases the need for device IO. Maybe SQL Server has a version like that?

Contaminate answered 5/2, 2009 at 22:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.