Deploying Multi-user Sql Express Database To SQL Express Server
Jul 10, 2007
Okay, I've read massive topics on ClickOnce, and embedded database applications, etc, etc.
I need a handful of good suggestions how I can create a deployment package, to get my sql express database onto a SQL Express server.
The database will need to be multi-user, because I am also developing a WinForms application to connect to the SQL Express database.
I'm thinking I need to use some automated scripting features, to generate scripts for the database once I am done (unless you have a better suggestion).
After that, I need to know what to do with those scripts, and how can I create a setup / deployment packages to run those scripts against a SQL Express server.
The other alterntative obviously is to copy my sql express database, and run an attach command. This will work the first time, only because this will have been the first deployment of this database.
Please keep in mind when answering this question, that I will not be embedding the database, and as far as I understand ClickOnce is a feature for use with embedded databases or user instance databases (not sure).
I am new to SQL Server but have been using Access to provide Multi-User acces to a central data store. We are evaluating the replacement of Access with SQL Server. With Access we don't need any special installation; I believe that the Jet Database Engine installed locally on each user's PC allows them to work with this in a disconnected manner; we use ADO.net 2.0 with VB.net 2005.
If each user has a locally installed SQL Server Express can they all attach to a database that resides on a shared network location?
In another post on the Forum I see the following regarding multi-user access: Our application You will need to pick a central computer that everyone will be using the access the data and attach the file to the parent instance of SQL Express on that comuter, giving it a name that you can use to access it. Then you will need to modify your connection string to connect to the named database on the central server...
Can multiple locally installed SQL Server Express instances attach to a single data store that resides on a shared network location?
If not, what permissions do I need to create a parent instance of SQL Server Express?
Thank you for helping me understand how to implement our solution.
Hi there. I've created a windows forms app that connects to a sql server express database. now that it's working on my box, i need to install the entire solution on the end user's machine. what's the best way to move the database? I found this article: http://msdn.microsoft.com/en-us/library/ms165716.aspx but i'm wondering if anyone can give me some insights based on your own experience. I'm using ms visual studio 2005 and sql server express 2005. I'm hoping that all i'll really have to do is copy everything over to the new machine and then edit my connection string in the .exe.config file for my app.
Hi all, I have read/studied (i) Working with Databases in Visual Web Developer 2005 Express in http://quickstarts.asp.net/QuickStartv20/aspnet/doc/data/vwd.aspx, (ii) Xcopy Deployment (SQL Server Express) in http://msdn2.microsoft.com/en-us/library/ms165716.aspx, (iii) User Instances for Non-Administrators in http://msdn2.microsoft.com/en-us/library/ms143684.aspx, and (iv) Embedding SQL Server Server Express in Applications in http://msdn2.microsoft.com/en-us/library/ms165660.aspx. I do not understand the concepts and procedures to do Xcopy and User Instances for non-administrators completely-I do not know how to connect to databases and create database diagrams or schemas using the Database Explorer. I have a stand-alone Windows XP Pro PC. I have created a ChemDatabase with 3 dbo tables in the SQL Server Management Studio of my SQL Server Express and a website of my VWD Express application with an App_Data folder. I am not able to proceed to use Xcopy and user instance to bring the 3 dbo tables of ChemDatabase to my App_Data folder. Please help and give me some detailed procedures/instructions to bring the 3 dbo tables of ChemDatabase (or ChemDatabase itself) from the SQL Server Management Studio Express to the App_Data folder of the website of my VWD Express project? Thanks in advance, Scott Chang
I have developed two programs that operates against the same database. One of the program is just a display program that displayes the data put into the other administation program where you put in the data to be displayed (an administration program).
Every time I access the db from the administration program, the display program stops and throws connection pool errors and other database errors. For me, it looks like it doesīt do multi-access to a database.
I have tried putting user instance to off in both programs, but this didnīt help.
Connection string also points to same file database.
I get an error dialog when I try to create a new SQL database, both via the Add New Item dialog and the property wizard of a new SqlDataSource control. The error is:
Local Database File:
User does not have permission to perform this action.
I've searched for help with this.
I ensured the App_Data folder exists and I added the local ASP.NET account to the group that have R/W access to it (although the RO flag is in an unchangeable tri-state on the folder). The SQL Server Express error log is clean and indicates full functionality. Everything is running locally. No VWD installation errors.
I've written a ClickOnce app that deploys a Sql Server Express data file (.mdf) and log file (.ldf) along with the other application files. SQL Express SP2 is a prerequisite for this app. After the applicaiton installs and starts up it copies these files to a specific folder and attaches them by calling the AttachDatabase() method of a Microsoft.SqlServer.Management.Smo.Server object.
This method works fine using Windows XP, however when I run it on Windows Vista I get the following exception:
Microsoft.SqlServer.Management.Smo.FailedOperationException: Attach database failed for Server 'localhostSQLEXPRESS'. ---> Microsoft.SqlServer.Management.Common.ExecutionFailureException: An exception occurred while executing a Transact-SQL statement or batch. ---> System.Data.SqlClient.SqlException: Unable to open the physical file "C:WashMasterDatabasewasshmaster.mdf". Operating system error 5: "5(Access is denied.)".
This exception occurs when I try to programmatically attach the database.
I've searched through the MSDN forums for a solution and I've only found two suggestions:
1.) Create all database connections using a User Instance. 2.) Create the database (using SQL) in the target folder, rather than copying it over from the deployment folder.
I don't like the idea of using User Instances because my entire data access layer is currently written using Ole and I would rather not rewrite it if I don't have to. I cannot find any way to use User Instances with Ole.
I also don't like the idea of creating the database using SQL because it is fairly large.
Here are my questions:
1.) Can User Instances be used with Ole?
2.) Can I somehow programmatically set the permissions of the copied data and log files so that SQL Express can access them without error?
3.) Is there a better method for doing what I'm trying to do or am I destined to have to either rewrite in data access layer so I can use User Instances or create my large database rather than copy it to the target directory?
I have a web app that uses two SQL Express databases. One of the databases is the membership database. I am deploying the app to a hosted environment. Here is my connection string:
Could not open new database 'Akamojo_ASPNETDB'. CREATE DATABASE is aborted. Cannot attach the file 'e:hostingmemberakamojoTournamentLogApp_DataAkamojo_ASPNETDB.mdf' as database 'Akamojo_ASPNETDB'. File activation failure. The physical file name "c:inetpubwwwrootTournamentLogApp_DataAkamojo_ASPNETDB_log.LDF" may be incorrect. The log cannot be rebuilt when the primary file is read-only.
The mdf file is not read only. In the hosted environment the database is on the E drive. In my dev environment the database is on the C drive. From the error message, it appears that when it tries to build the log file it is trying to build it on the C drive in a path that doesn't exist in the hosted environment.
For the first time, I want to set up the configuration of my SQL Server Management Studio Express (SSMSE) to allow me in doing the non-User-Instance/ADO.NET 2.0 programming from my VB 2005 Express. The SSMSE and VB 2005 Express are in my Windows XP Pro PC that is part of our NT 4 LAN System in our office. I read the article "How to configure SQL Server 2005 to allow remotre connections" in http://support.microsoft.com/kb/914277/ about (i) "Enable remote connections for SQL Server 2005 Express", (ii) Enable the SQL Server Browser service", (iii) Create exception in Windows Firewall, and (iv) Create an exception for the SQL Server Browser service in Windows Firewall. I entered the SQL Server Surface Area Configuration and I could not decide what options I should take for doing the non-User-Instance/ADO.NET 2.0 programming from my VB 2005 Express. I have the following questions on the page of "Minimize SQL Server 2005 Surface Area": (1) I saw "Configure Surface Area for localhost [change computer]". I clicked on [change computer] and I saw the following: Select Computer The Surface Area Configuration of this surface area of this computer or a remote computer. Specify a computer to configure: O Local computer O Remote computer Should I choose the "Local computer" or the "Remote computer" option? (2) Below the "Configure Surface Area for localhost [change computer]", I clicked on "Surface Area Configuration for Service and Connections", Select a component and then configure its services and connections: |-| SQLEXPRESS |-| Database Engine Service I picked => Remote Connection On the right-hand side, there are: O Local connections only O Local and remorte connections O Using TCP/IP O Using named pipes only O Using both TCP/IP and named pipes Should I choose O Local and remorte connections and O Using named pipes only?
Please help and tell me what options I should choose in (1) and (2).
Hello, I would like to deploy a per-machine Express database as part of my VS2005 C# desktop application. The deployment must work with both XP and Vista from the same setup files. I'm not using One-Click installation. I don't want my users to have to configure Express with the Surface Area Configuration tool.
Since the database cannot go in C:Program Files because of Vista ACL issues, I am using COMMONAPPDATACompanyNameAppName as the install path for the database and other user writable application files. In XP this expands to C:Documents and SettingsAll UsersApplication DataCompanyNameAppName and in Vista it is C:ProgramDataCompanyNameAppName. Neither of these paths have write privileges for unprivileged users, so the install program needs to change the write permissions at install time. Right now I am using SetACL ( http://setacl.sourceforge.net/ ), to do that and the install goes fine with write permissions on the companyName folder and it's children for all users.
But I can't connect to the mdf file in my COMMONAPPDATACompanyNameAppName folder. If I am the administrator/installer it works fine, but as an unprivileged user I get different errors, but mostly "Could not login user ...". For debugging, I have also tried installing the database in the "AppFolder" directory (which for my app in both Vista and XP is C:Program FilesCompanyNameAppName) and using "User Instance=true" in the connection string, and the connection is made but (at least on XP) the unprivileged user cannot write to the database because the folder lacks write privileges for that user.
I suppose one thing I could do would be to change the folder/file permissions in the AppFolder, but I am reluctant to do that because I have read that Microsoft does not guarantee that the "Compatibility" feature in Vista for the Program Files directory will be available in future releases/service packs.
So is there a way to do a simple installation/db connection for a per-machine database located in a COMMONAPPDATA path?
I have developed a windows mobile 5.0 application that is currently syncing with sql server 2005. I want to deploy the application with sql server express for the client. What do I need to do to make this work?
Hello 1.) Is there any solution for integrating the deployment of the sql server express into the setup project of my vb 2005 app ? 'Cause it is too much to install the framework... then the sql server and then the app....... Any help would be appreciated!
Can any one clarify me the doubt in deploying the application build with SQL Server Express 2005 as database and Vb.Net 2005 as frontend with the same setup made for delopying application. will the server installation and database creation can be made automatic.
If this is possible then what are the steps in doing so and the files to be included while enbeding with vb.net setup.
I have created an installer for deploying Sql Server Express. My installer will start the process of installing Sql Server Express. However the installation of SqlServer Express will fail because it says another installer is currently running (which is my installer). Is there anyway to work around this problem?
The reason why I would like to create an installer for the installation of Sql Server Express is because I would like to configure the SqlServerExpress without the user fiddling with the ini file.
When I downloaded/started using Visual Web Developer I was under the impression that I needed to install SQL Server Management Studio Express in order to create/manage databases, and to provide the engine to access the data. Since then I have found tutorials and have successfully created/used databases solely from within Visual Web Developer. I'm assuming that Visual Web Developer includes a database engine, much like the webserver that is included. (This is an awesome thing). When I tried to upload my web application with database to my production server, the database would not work, it started working after I installed SQL Server Management Studio Express on the server. Is it my understanding that you need SQL Server Management Studio Express if you do not have Visual Web Developer Express installed in order to provide the data access engine? Also, I am unable to "attach" my Visual Web Developer Express created database to SQL Server Management Studio Express. Are there any posts that provide more information about this topic?
The only reason I'm asking is that I have extra whitespace on the end of my text fields, and I thought ANSI_PADDING was turned on. I do not see the option in Visual Web Developer Express, but have found it in SQL Server Management Studio Express.
I am a newbie so i apologies beforehand for any mistakes i make on this forum. Anyway, i created an asp.net website using the MS Visual Web developer tool. This has a couple of SQL SERVER databases within it. I then latervinstalled the SQL SERVER management studio express in order to manage the SQL SERVER DBs that i had as part of my website but they do not appear within the management studio db list. As this is the express version, is there anyway of importing the existing SQL SERVER dbs that i have to the management studio so i can manage them from there?
Hi, I'm completely new to SQL Server and ASP.NET, so please bear with me on my learning curve! I've installed Visual Web Developer Express and SQL Server Express (on the same PC). I then used Web Developer Express to successfully create a new database with a couple of tables in it. So far so good. I then installed SQL Server Management Studio Express on the same PC and tried to connect to my new database. The connection to the SQL Server instance appears to work OK (using Windows Authentication) but I can't see the database I previously created. All I can see are the System Databases. Does anyone know what the solution might be?
In the last one and half years, I used the Northwind Database in SQL Server Management Studio Express (SSMSE) to learn the programming of SqlConnections, Data sources, Database Exploere, ADO.NET 2.0, etc. via VB 2005 Express.
The Northwind Database in my SSMSE got lost very often, but I was not aware of it. How can I know where the Northwind Database is used or processed by my VB 2005 Express projects that were the examples of some tutorial books or my trial projects? How can I release the Northwind Database back to my SSMSE from the VB 2005 Express projects? Please help and advise.
I am new to this type of programming and and have read all articles on adding an image to the database and it seems they all use sql queries to add an image but I want to add an image at design time. I am using Visual Basic 2005. I am also using Visual Basic 2005 Express Edition to try the same thing. I am trying to build a Translator program for english to Brazilian Portuguese and the reason I want to add the images is so that when I translate the word cat from english to Portuguese, I can also show an image of a cat. Can anyone please help me
I just found that the content of my Database "ssmsExpressDB" is gone, but the name "ssmsExpressDB" remains in the Object Explorer of SQL Server Management Studio Express. If I delected the name "ssmsExpressDB" and executed the following .sql:
Unable to open the physical file "C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLDatassmsExpressDB.mdf". Operating system error 32: "32(The process cannot access the file because it is being used by another process.)".
And I have closed all my projects and I do not know what " The process cannot access the file because it is being used by another process" is all about!? Please help and tell me how I can re-attach the content of my "ssmsExpressDB" in the Object Explorer of SQL Server Management Studio Express.
I found the "ssmsExpressDB" is being used by my VB 2005 Express project "Hello-SQLCLR-1": in the Database Explorer, Data Connections place. How can I put it back to the Object Explorer of SQL Server Management Studio Express? Please help and advise.
Hi all, I want to do SQLCLR by Connecting to SQL Express User Instances in Management Studio via VB 2005 Express and I have read the following articles and books: (i) Connecting to SQL Express User Instances in Management Studio in http://blogs.msdn.com/sqlexpress/archive/2006/11/22/connecting-to-sql-express-user-insta... (ii) Managing SQL Server Express with SQL Server 2005 Management Studio Express Edition in http://www.microsoft.com/technet/sql/2005/mgsqlexpwssmse.mspx (iii) Chapter 16 - Going Beyand Transact-SQL: Using the SQL Common Language Rutime (SQLCLR) in Microsoft SQL Server 2005 Express Edition for Dummies (iv) Chapter 21 - Working with the Common Language Runtime in Microsft SQL Server 2005 Programming for Dummies (v) Chapter 4 - Introduction to Common Language Runtime (CLR) Integration in Programming SQL Server 2005 by Bill Hamilton. I want to create an SQLCLR project "HelloWorld" by Connecting to SQL Express User Instances in Management Studio via VB 2005 Express. But I am still not sure how to get it started, because I do not understand the following things: (1) Pipe Name for a User Instance, (2) Enabling (or Disabling) the CLR by using Transact-SQL, (3) Creating a Transact-SQL script, (4) Creating an Assembly, (5) Creating a backup device, etc. I need to see some simple examples of SQLCLR by Connecting to SQL Express User Instances in Management Studio via VB 2005 Express. Please help and tell me where in the websites I can find them.
Hello, I work for a company that manages computers and their software using Active Directory. One of our packages requires SQL Express 2005, and so far I've been unable to find a good resource online. All I need to do is find a .msi file or a batch script that will install it. Thanks!
I have a small ASP.Net application developed in VS 2005 that I would like to deploy with SQL Express.
I have included the MDF file in the Application and added SQL Express as a pre-requisite for the Setup and Deployment project.
It installs SQL Express but when it tries to connect I receive: "This is not a valid login Cannot open user default database. Login failed. Login failed for user 'NT AUTHORITYSYSTEM'."
I don't seem to have any options using the "prerequisite options in VS 2005 in terms of command line deployment parameters.
Likewise I would prefer to attach the database to the instance (because I need to write a connection string from a PDA using RDA and I have zero clue how to do RDA directly back to the file).
Hi, As per my understanding, if the user instance property is set to true for an express database then it is not multiuser/shared. A copy of the database is made for each user so he works on his private data. On the other hand, if user instance property is set to false then the express database is multiuser/shared. Thus different users will connect to the same instance of the database and changes by one user will be seen by the other users. Now, if we use an express database with asp.net and our application is installed on IIS then it is mandatory for the express database to have the user instance property set to true. But we see that in this case when different users visit our website, the data they enter goes into the same common database, ie. all the users share the same common database, even though user instance is true for the express database. Please shed some light to explain the correct functionality of the user instance property as related to the express database. Regards, Sandy
What are some recommended methods for deploying SQL Express throughout an entire organization? It appears that Active Directory/GPO deployment is out of the equation.
I'm trying to learn some VB programming with the VB 2005 Express Absolute Beginner Series video tutorials (which I think is great) and have come across a problem that I can't solve.
When I follow the instructions in Lesson 9 (Databinding Data to User Interface Controls) my application will display the data from the database correctly and I can edit it (and as long as the debugger is running the data remains changed). However, the changes won't propagate back to the database. I don't get any error messages but after I edit the data, save (with the save button on the BindingNavigator toolbar), and end debugging the data in my database remains unchanged. When I use a MessageBox to show how many rows where edited/updated in the
I get the correct number back. I'm sure the problem is not due to coding errors since I've also tried running the accompanying Lesson 9 project file that can be downloaded from MSDN and the problem persists.
I'm using Windows XP SP2, SQL Server 2005 Express Edition and VB 2005 Express Edition. I've tried installing SQL Server 2005 Express with a number of different settings, including default settings, but it doesn't make any difference.
Would greatly appreciate any feedback on this as I'm keen to resolve this problem so I can get on with the next tutorial lesson.
When I run in debug mode, I connect fine. I can do anything in the db in VisualStudio 2005.
Then I open the SQL Management Studio, connect to Sql Express, try to open the same database and it can't open it.
BUT...
If I stop running the VisualStudio application (I can leave VS open, but not run the app I'm developing),
and reopen SQL Management Studio, connect to Sql Express and open the same db, I can do anything.
It's not just VS and SQL either.
If I open CodeSmith and load a template I use that access the db, I can run my templates fine as long as I'm not running the application in VS or have the db open in SQL Express.
In other words, I can have one connection at a time only on this sql express db.
Before I detached it, I could have multiple connections at the same time.
I checked the properties in sql express and it says I can have multiple (4 is specified) connections at a time;
Allow remote access is also checked.
Arrow/Rick is db owner, the default database is Master.
I don't know any other information to provide.
DId I miss something? How can I get multiple connections working again on this?
Hello, I am having a difficult time with a complicated task. I have developed numerous SSRS reports for my application and want to deploy these reports with my application. The application uses SQL Express Edition with Advanced Services. I have written an installer to automate this process, but my problem is getting the SSRS reports that I developed on my server incorporated into the ReportServer database created during the install of SQL Express Edition with Advanced Services. I have read numerous good posts and articles regarding the rsconfig.exe and rskeymgmt.exe utilities, but I am having problems. The main problem seems to be dealing with the encryption key. I have done a restore of the ReportServer database using a backup of the ReportServer database I used to develop my SSRS reports. This worked well with the exception that I can't seem to get past an error message stating that reportiong services has not been initialized. Keep in mind, I need an automated way to do this. Anyway, I have tried using rskeymgmt to restore a backed up copy of the encryption file that I took from the server where I developed the reports. I get an error message that scale-out deployment is not supported in this version or something like that. I can't delete the encrypted data because then the connection information for my shared data source is deleted also. Again, please keep in mind I need all of this to occur behind the scenes during an install without end-user intervention.
Anyways, sorry for such a long post. I would appreciate any help anyone may be able to provide.
Hi, I hope you can help.I have configured a Windows 2003 web server and SQL 2005 Server (on same box) to successfully allow remote connections and to allow access via SQL Server Management Studio Express 2005.The problem I have is that I want to restrict access to the databases on the server via the Management Studio to specific databases e.g. 1 database user "sees" only 1 database.I can configure it so that the user's remote access permissions do not allow access to other databases but they can still "see" the database listed in the Management Studio explorer.I can also configure it so that the users cannot see all the databases (by disabling View All Databases on SQL Server), but this means that they cannot not see their own database which they have permissions for.Is it impossible to have the desired behaviour of only displaying the database which the remote user accessing has permissions for and hiding all other databases?I have MSN'd,Googled and Yahoo'd this one to no avail :(Many thanksFergus
Ok, I need to add aspnet user to my database in SQL Server express. I have the SQL Server Mangament Tool Express CTP that i am using to do it.Anyway when i go to add the permissions for my user to the table I type it in and it returns back that there is no user that exists with that name. I then went to the top level for SQL Server Express and it has the ASPNET user. I don't understand why the engine itself can see it and use it but not my individual database.
I have VC++ express and MSSQL SMS express and have an application working nicely locally. The Data explorer and data connections part works really easily.
Now, I want to make the application available to my home network.
I mapped the drive where the database is and called it Z: so I could put my "release" on my other network PC and assumed it would find Z: if I mapped the shared network drive on that machine and called it Z:
But: I can't even add the mapped connection on the local machine, I get:
The file "Z:databasescalorie.mdf" is on a network path not supported for database files. An attempt to attach.....etc"
It works fine on the original F drive.......
Am I approaching this the wrong way. How should I distribute to network PCs?
Here is the error message I get:http://img109.imageshack.us/my.php?image=error2ug.jpgI have just installed both packages and havent done much in the way of configuration... What do i need to do? Thanks!