not able to login in other computers!

I'm developing with Visual Studio 2005 Standard Edition and SQL Server 2005 Express Edition, my problem is that as default SQL Server Express uses windows authentication.

Since I develop in my own PC and install the software in another PC, my SQL Server Database is useless cause it still tries to log in wih my computer name and windows user. I'm using a conventional intallation project in which I include all the files (fonts, project output) that the computer should have, and I also included the .mdf file for the Database to work.

I tried using SQL Server Management Studio CTP to help me create a user for my Database, but the users I create with it are useless, I can't even create a login, I always have to use windows authentication.

I really need to change that because if I don't I won't be able to distribute the aplication I'm working in right now.

[897 byte] By [neto] at [2008-2-27]
# 1

Why are you distributing an MDF ? Why not distribute scripts that you run against the local SQL Server to create the DB ?

cgraus at 2007-9-8 > top of Msdn Tech,SQL Server,SQL Server Express...
# 2

how do I generate the script for my MDF database?

And will this work if I only install SQL Server Express or do I need to install SQL Server Standard Edition?

neto at 2007-9-8 > top of Msdn Tech,SQL Server,SQL Server Express...
# 3

The scripts will work with any version of SQL Server. Personally, I develop databases by writing scripts, with this in mind. However, you can generate scripts in SQL Server itself, I'm just not sure how ( because I don't ).

I know you can do it per item by right clicking and choosing to generate a script for that item, but I'm sure there's a more universal way to do it all in one go.

cgraus at 2007-9-8 > top of Msdn Tech,SQL Server,SQL Server Express...
# 4
How do I run a script from a Windows Application? I need to make this so easily that the user won't even notice. And I also need to generate the database in a specific location on my HD!
neto at 2007-9-8 > top of Msdn Tech,SQL Server,SQL Server Express...
# 5


Should be no problem. Running the script in a windows application is quite easy as issuing a command against the database (because it is nothing more than that). Connect to the server, and fire up your generated script. How ? If you already have the script (by using any scripting tool, like those one in SQL Server Management Studio, or other which are available over the internet), open a connection, load the file (with the script) in a string variable (I assume that you use .NET) and assing the string variable to the commandtext option of a SQLCommand. if you would like to have it more granular (not executing the the database script as a whole, rather than just creating the database, then the users, then the tables... and so on) split the scripts by categories.

HTH, Jens Suessmeyer.


http://www.sqlserver2005.de

JensSuessmeyer at 2007-9-8 > top of Msdn Tech,SQL Server,SQL Server Express...
# 6

Hi,

try to use sql server autentication, by right click on computer\sqlexpress-> properties ->security ->Sqlserver and windows autentication

JorgeLoureiro at 2007-9-8 > top of Msdn Tech,SQL Server,SQL Server Express...

SQL Server

Site Classified