CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

MS SQL 2008 on ASP.NET Hosting



Can Reply:  No Members Can Edit: No Online: Yes
Zone: > NEWSGROUP > Asp.Net Forum > visual_studio.visual_studio_2005 Tags:
Item Type: NewsGroup Date Entered: 10/11/2007 5:34:00 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 3 Views: 39 Favorited: 0 Favorite
4 Items, 1 Pages 1 |< << Go >> >|
scarabee
Asp.Net User
Run sql script to add tables to Sql 2005 Express10/11/2007 5:34:00 PM

0/0

Is it possible to run a sql installation script from Visual Studio 2005 and populate a Sql Server 2005 Express database? To save time (and error) I have made a sql script for creating tables and stored procedures for my web site. I could run this script from the Sql Server 2005 Express Management tool, but this tool does something to the database that result in the error "Cannot open user default database. Login failed.". After hours searching on the net I found a tip warning me not to use use the Management tool. So, are there other ways to run my sql script?


Regards, Sigurd

 

Benson Yu - MSF
Asp.Net User
Re: Run sql script to add tables to Sql 2005 Express10/15/2007 3:18:00 AM

0/0

Hi scarabee,

We can run the create table script in Visual Studio 2005 though we will get the SQL Syntax Error. For example, please refer to the following steps:

    1. Open the ?Server Explorer? panel (View | Server Explorer).
    2. Connect to the database, and expand it.
    3. Right click the ?Tables? node, and then select ?New Query?.
    4. Click the ?Close? button directly in the ?Add Table? dialog.
    5. Replace the ?SELECT FROM? script by our create table script.
    6. Click the ?Execute SQL (Ctrl+R)? button.
    7. Visual Studio will prompt error encountered. Ignore it by clicking ?OK? or ?Continue?.
    8. The table can be created successfully.

However, I don?t know where you got the warning about don?t use Management Studio tool. Actually we recommend using Management Studio to manage SQL Server 2005. The error message you encountered can be cause by Login account doesn?t mapped to the special database. Please login the SQL Server with Admin account. Or you can check the ?User Mapping? of the login account by the following steps:

    1. Open SQL Server Management Studio.
    2. Expand the ?Security | Logins? node.
    3. Right click your login account, and then select ?Properties?.
    4. Click ?User Mapping? node in the left panel.
    5. Check the ?Map? checkbox for special database, and grant database role membership for it.

 


Sincerely,
Benson Yu
Microsoft Online Community Support

Please remember to click ?Mark as Answer? on the post that helps you, and to click ?Unmark as Answer? if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
scarabee
Asp.Net User
Re: Run sql script to add tables to Sql 2005 Express10/15/2007 10:11:50 AM

0/0

Great, it works! When I got the first message (error) I thought it was not possible to run queries in a query window. But how about stored procedures? I can only one create stored procedure at the time. Are there other ways to run a script that adds several at the same time?

The problem with Management Studio 2005 Express is that is adds some security settings (or something else) to the database. After I have changed one or more tables in the Management Studio I get this error "Cannot open user default database. Login failed." when I try to run my webpage in Visual Studio. Maybe you can tell me what the problem is?

Sigurd
 

scarabee
Asp.Net User
Re: Run sql script to add tables to Sql 2005 Express10/15/2007 10:38:26 AM

0/0

I didn't see the last part of your answere. This one seems to work also. Thanks a lot!

 

Sigurd 

4 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Beginning SQL Server 2005 Express Database Applications: With Visual Basic Express and Visual Web Developer Express from Novice to Professional Authors: Rick Dobson, Pages: 596, Published: 2005
Microsoft SQL Server 2005 Express Edition For Dummies Authors: Robert Schneider, Stephen Giles, Pages: 408, Published: 2006
Pro WF: Windows Workflow in .NET 3.0 Authors: Bruce Bukovics, Pages: 709, Published: 2007
Wrox's SQL Server 2005 Express Edition Starter Kit: Express Edition Starter Kit Authors: Rajesh George, Lance Delano, Pages: 353, Published: 2006
Professional DotNetNuke 4: Open Source Web Application Framework for ASP.NET 2.0 Authors: Shaun Walker, Joe Brinkman, Bruce Hopkins, Scott McCulloch, Patrick J. Santry, Chris Paterra, Scott Willhite, Dan Caron, Pages: 517, Published: 2006
ASP.NET 2.0 Website Programming: Problem-design-solution Authors: Marco Bellinaso, Pages: 576, Published: 2006
Beginning DotNetNuke 4.0 Website Creation in C# 2005 with Visual Web Developer 2005 Express: From Novice to Professional Authors: Nick Symmonds, Pages: 391, Published: 2006
Pro ASP.NET 3.5 in C# 2008 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1498, Published: 2007
Beginning SQL Server 2005 Express for Developers: From Novice to Professional Authors: Robin Dewson, Pages: 436, Published: 2007
Pro ASP.NET 2.0 in C# 2005: Create Next-generation Web Applications with the Latest Version of Microsoft's Revolutionary Technology Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1426, Published: 2006

Web:
Embedding SQL Server Express into Custom Applications Deploying SQL Server 2005 Express Edition by Using a Wrapper ..... Under the Tables node, select the Department table, and then continue with the wizard. .... If they don't, the application should either run an upgrade script or fail. ... Next, you could either add the SQL scripts as separate strings, ...
Automating Database maintenance in SQL 2005 Express Edition Part I SQL Server 2005 Express Edition does not include such a utility, ... and the contents of the temporary tables used in the procedure. ... does not include SQL Agent, we need to rely on the Windows Task Scheduler to run our ... above (c:\ backup scripts\userfullbackup.sql), we could add parameters to it as shown below ...
SQL SERVER - 2005 - Create Script to Copy Database Schema and All ... Any one have procedure to generate table create script with passing .... script generated tables but not had data into it. from sql express 2005 to sql 2000 ... Would running this script on the new database I copied onto the SQL 2005 ...
SQL Server Express UPDATE, November 6, 2006: Running SQL Server ... Nov 6, 2006 ... Commentary; Running SQL Server 2005 Express on Vista .... To create a new set of tables, click Close on the Add Table dialog box. ... Database Publishing Wizard that creates a SQL script that you can use to recreate your ...
Scheduling Jobs in SQL Server Express - SQLTeam.com As we all know SQL Server 2005 Express is a very powerful free edition of SQL ... Only the pieces of code are shown here so look at the accompanying script for full code. ... First we have to have a valid SQL statement that we'll run as a ... We can add it to or remove it from the ScheduldJobs table by using our ...
openCRX Installation Guide for MS SQL Server 2005 Download MS SQL Server 2005 Express Edition from ... Run the SQL script populate -preferences.sql to do this. ... Copy/paste the database script dbcreate-tables. sql and execute by clicking on the button Execute:. Figure 9: Execute script ...
Re: How do you run a .sql script? Jun 1, 2007 ... Installed Microsoft SQL Server 2005 Express Edition with Advanced Services . ... downloaded files is a script to run to populate a database. I have ... what do I do to create the database and tables so I can use it on ...
Host .NET In SQL Server 2005 Express [ASP & .NET Tutorials] Aug 13, 2008 ... SQL Server 2005 Express Beta 2 is free to download, evaluate, and test. .... Often, C# Express will add to your library classes that are not compatible with ... The following examples use a table that stores the names of ...
SQL 2005 Express to SQL Server 2000 I attached the SQL 2005 Express database to my SQL Server 2005 instance, and ..... script at the Query Analyzer and run it. After that the Structure of the .... "Add user or Group" button greyed out in "Lock Pages in Memory" wi ... Re: How to tell sql server the maximum size my temp table will grow so that it does ...
script table as alter to sql management studio express <1> hey guys, im going to be trying SQL Server 2005 Express on a clients machine tomorrow and had no time to test <1> can i run a .sql script on it somehow and create my DB? .... <19> just add them all to the group by as well ...




Search This Site:










viewing *.designer.cs files in web site projects

style quickly flash then closes...how to resolve that?

help creating new web project with vs2005 and tfs

master page as start up page

need image resizing advice

not able to open visual studio design view

need help creating a report in asp.net

extending gridview - loose validation and intellisense

are there partial class not visible

user and roles config screens - asp.net configuration

unable to reference class library dll [developed in vs 2005] in vs 2003

slightly confused, looking for help from the community here

web application projects output setting

c# windows service

visual studio 2005 debugger times out

web services: missing template

icons messed up in toolbox after install of sp1

multiple web projects in one solution.

anybody using visual studio 2005 standard edition?

source code metrics

autodesk dwf viewer no longer working in my vs2005 app!

creating an object instance in object test bench view

conditional user interface within a deployment project?

vs2005 beta 2 ftp username & password save facility?

suppressing all the html errors which prevents from viewing the design view

designing in visual studio 2005

visual studio 2005 beta 2 and .vsi files not working

visual studio 2005 "closes by itself"

project name

network project with visual studio 2005

  Privacy | Contact Us
All Times Are GMT