Database Conversion: SqlExpress To MySql V5

Jan 25, 2007

Working on trying to support mutliple backend db's against a custom VB6 app. Right now the db is SqlExpress. It's relatively uncomplicated and I just want to move table structures and data over. Using the MySql Migration tool, I am able to authenticate as SA to a server-based instance of SqlExpress, however, only the MS-supplied databases appear as available databases; my databases don't appear. Can't seem to authenticate at all to any local instance of the database, either. Anyone done any successful migrations to MySql through their migration tool?

Rick

View 10 Replies


ADVERTISEMENT

MySQL Conversion To MS SQL

Nov 30, 2005

Hello

I am in the process of convering my code from using MySQL to MS SQL

I have queries of the form:

Code:


INSERT INTO <table> (params) VALUES (values)
ON DUPLICATE KEY UPDATE <param1>=<value1>, <param1>=<value1>... <param n>=<value n>


My question is:
Is there an equivalent syntax for such query in MS SQL?
I am looking for a syntax that does this in a single atomic query.
I can always break it down to 2 queries (select + insert/update), but I will do so only after I know there is no equivalent way for it in MS SQL

Also, is there an equivalent syntax for LIMIT X,Y in MS SQL
for quries in the form:

Code:


SELECT <params>
FROM <tables>
WHERE <conditions>
LIMIT X, Y


any help would be appreciated
Thanks

View 2 Replies View Related

MySQL Conversion To MS SQL - Problems With Syntax As Well As With Pk/fk Relationships

Apr 9, 2006

Hello all,

For those of you who are able to assist, I'd like to thank you in advance right now. This is a pretty big problem for me.

First let me setup what it is I'm trying to do before I describe the problem in detail. This is part of a semester-long Software Engineering project for my SE class at school. Now, I've got a month for this project, but the database part of it is something I'm trying to get done by this week. Our team is using GoDaddy to host our account and so to simplify our problems with using Visual Studio and MySQL we're switching over to MS SQL, where our code works.

Okay, onto the specifics: I'm used to using a database modeling program called DBDesigner4. Unfortunately, they're support forums have been closed down (fabFORCE.net) and I've spoken with a GoDaddy representative and their servers don't allow me to directly connect with my modeling program and create the schema/tables using the program. However, the program does export to a MySQL table creation script or even an MDB XML file (MSAcess I believe). I'm trying to hand convert the creation script over to MS SQL syntax and I'm having alot of problems (please bear with me, I've never messed with MS SQL before).

For your reference, I'm going to display the actual MySQL script here (just skip this section if you'd like to see the actual problem below):


Code:


CREATE TABLE Addresses (
address_id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
address_line1 VARCHAR(30) NOT NULL,
address_line2 VARCHAR(30) NULL,
address_city VARCHAR(30) NOT NULL,
address_state VARCHAR(2) NOT NULL,
address_zip MEDIUMINT UNSIGNED NOT NULL,
PRIMARY KEY(address_id)
)
TYPE=InnoDB;

CREATE TABLE Broadcasts (
broadcast_id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
address_id INTEGER UNSIGNED NOT NULL,
broadcast_title VARCHAR(30) NOT NULL,
broadcast_message VARCHAR(255) NOT NULL,
broadcast_image VARCHAR(255) NOT NULL,
broadcast_date_posted DATETIME NOT NULL,
broadcast_date_expires DATETIME NOT NULL,
broadcast_date_archived DATETIME NULL,
broadcast_clicks BIGINT NOT NULL DEFAULT 0,
broadcast_type ENUM('promo', 'announcement', 'other') NOT NULL DEFAULT 'promo',
broadcast_link VARCHAR(255) NULL,
PRIMARY KEY(broadcast_id),
INDEX Broadcasts_FKIndex1(address_id)
)
TYPE=InnoDB;

CREATE TABLE Classes (
user_id INTEGER UNSIGNED NOT NULL,
subject_id INTEGER UNSIGNED NOT NULL,
class_grade INTEGER UNSIGNED NOT NULL DEFAULT 100,
class_tardies INTEGER UNSIGNED NOT NULL DEFAULT 0,
class_absences INTEGER UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY(user_id, subject_id),
INDEX Users_has_Sections_FKIndex1(user_id),
INDEX Classes_FKIndex2(subject_id)
);

CREATE TABLE Classes_have_Grades (
subject_id INTEGER UNSIGNED NOT NULL,
user_id INTEGER UNSIGNED NOT NULL,
grade_id INTEGER UNSIGNED NOT NULL,
PRIMARY KEY(subject_id, user_id, grade_id),
INDEX Grades_has_Classes_FKIndex1(grade_id),
INDEX Grades_has_Classes_FKIndex2(user_id, subject_id)
);

CREATE TABLE Grades (
grade_id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
grade INTEGER UNSIGNED NOT NULL,
grade_type ENUM('h', 'q', 't') NOT NULL,
grade_desc VARCHAR(50) NOT NULL,
PRIMARY KEY(grade_id)
);

CREATE TABLE Locations (
loc_id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
address_id INTEGER UNSIGNED NOT NULL,
location_id VARCHAR(20) NOT NULL,
location_name VARCHAR(25) NOT NULL,
PRIMARY KEY(loc_id),
INDEX Locations_FKIndex1(address_id)
)
TYPE=InnoDB;

CREATE TABLE Passports (
passport_id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
user_id INTEGER UNSIGNED NOT NULL,
location_id INTEGER UNSIGNED NOT NULL,
passport_user VARCHAR(7) NOT NULL,
passport_code VARCHAR(32) NOT NULL,
passport_access ENUM('student', 'faculty', 'admin') NOT NULL DEFAULT 'student',
passport_tries TINYINT UNSIGNED NOT NULL DEFAULT 0,
passport_locked BOOL NOT NULL DEFAULT 'false',
passport_lastaccess DATETIME NULL,
PRIMARY KEY(passport_id),
INDEX Passports_FKIndex1(location_id),
INDEX Passports_FKIndex2(user_id)
)
TYPE=InnoDB;

CREATE TABLE Subjects (
subject_id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
subject_name VARCHAR(50) NOT NULL,
subject_offered BOOL NOT NULL,
subject_grade ENUM('1', '2', '3', '4', '5', '6') NOT NULL,
PRIMARY KEY(subject_id)
)
TYPE=InnoDB;

CREATE TABLE Users (
user_id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
address_id INTEGER UNSIGNED NOT NULL,
user_fname VARCHAR(20) NOT NULL,
user_mletter VARCHAR(1) NULL,
user_lname VARCHAR(20) NOT NULL,
user_grade FLOAT NOT NULL,
user_type ENUM('student', 'faculty') NOT NULL DEFAULT 'student',
user_balance FLOAT NOT NULL,
user_phone CHAR(15) NOT NULL,
user_email VARCHAR(50) NOT NULL,
PRIMARY KEY(user_id),
INDEX Users_FKIndex1(address_id)
)
TYPE=InnoDB;



That script runs just fine on MySQL and generates my application's tables with the correct relationships intact, indexes, etc.

However, as I said, I need this setup in MS SQL with a few additional checks and I've hand converted most of this, not knowing how to properly maintain primary keys or foreign keys:


Code:


CREATE TABLE Addresses
(
address_id
INT
PRIMARY KEY
IDENTITY(1,1)
NOT NULL,

address_line1
VARCHAR(30)
NOT NULL,

address_line2
VARCHAR(30)
NULL,

address_city
VARCHAR(30)
NOT NULL,

address_state
VARCHAR(2)
NOT NULL,

address_zip
ZIPCODE
CONSTRAINT CK_address_zip
CHECK (address_zip LIKE '[0-9][0-9][0-9][0-9][0-9] ')
)

CREATE TABLE Broadcasts
(
broadcast_id
INT
PRIMARY KEY
IDENTITY(1,1)
NOT NULL,

address_id
INT
NOT NULL,

broadcast_title
VARCHAR(30)
NOT NULL,

broadcast_message
VARCHAR(255)
NOT NULL,

broadcast_image
VARCHAR(255)
NOT NULL,

broadcast_date_posted
DATETIME
NOT NULL,

broadcast_date_expires
DATETIME
NOT NULL,

broadcast_date_archived
DATETIME
NULL,

broadcast_clicks
INT
NOT NULL
DEFAULT 0,

broadcast_type
CHAR(1)
NOT NULL
DEFAULT(‘a’),

broadcast_link
VARCHAR(255)
NULL
)

CREATE TABLE Classes
(
user_id
INT
PRIMARY KEY
NOT NULL,

subject_id
INT
NOT NULL,

class_grade
INT
NOT NULL
DEFAULT 100,

class_tardies
INT
NOT NULL
DEFAULT 0,

class_absences
INT
NOT NULL
DEFAULT 0
)

CREATE TABLE Classes_have_Grades
(
subject_id
INT
NOT NULL,

user_id
INT PRIMARY KEY
NOT NULL,

grade_id
INT
NOT NULL
)

CREATE TABLE Grades
(
grade_id
INT
PRIMARY KEY
IDENTITY(1,1)
NOT NULL,

Grade
INT
NOT NULL,

grade_type
CHAR(1)
NOT NULL
DEFAULT(‘h’),

grade_desc
VARCHAR(50)
NOT NULL
)

CREATE TABLE Locations
(
loc_id
INT
PRIMARY KEY
IDENTITY(1,1)
NOT NULL,

address_id
INT
NOT NULL,

location_id
VARCHAR(20)
NOT NULL,

location_name
VARCHAR(25)
NOT NULL
)

CREATE TABLE Passports
(
passport_id
INT
PRIMARY KEY
IDENTITY(1,1)
NOT NULL,

user_id
USERID
NOT NULL
CONSTRAINT CK_user_id
CHECK (user_id LIKE '[A-Z][A-Z][A-Z][0-9][0-9][0-9][0-9]'),

location_id
INT
NOT NULL,

passport_user
VARCHAR(7)
NOT NULL,

passport_code
VARCHAR(32)
NOT NULL,

passport_access
CHAR(1)
NOT NULL
DEFAULT(‘s’),

passport_tries
TINYINT
NOT NULL
DEFAULT(0),

passport_locked
BOOL
NOT NULL
DEFAULT(false),

passport_lastaccess
DATETIME
NULL
)

CREATE TABLE Subjects
(
subject_id
INT
PRIMARY KEY
IDENTITY(1,1)
NOT NULL,

subject_name
VARCHAR(50)
NOT NULL,

subject_offered
BOOL
NOT NULL,

subject_grade
SMALLINT
NOT NULL
DEFAULT 6
)

CREATE TABLE Users
(
user_id
INT
PRIMARY KEY
IDENTITY(1,1)
NOT NULL,

address_id
INT
NOT NULL,

user_fname
VARCHAR(20)
NOT NULL,

user_mletter
CHAR(1)
NULL,

user_lname
VARCHAR(20)
NOT NULL,

user_grade
FLOAT
NOT NULL,

user_type
CHAR(1)
NOT NULL
DEFAULT(‘s’),

user_balance
FLOAT
NOT NULL,

user_phone
CHAR(15)
NOT NULL,

user_email
VARCHAR(50)
NOT NULL
)



Unfortunately, Query Analyzer seems to have a problem and says I have an error in my syntax (on line 74) near "'".

I've googled around and found out a couple of things: TSQL doesn't support enumerations (that I'm aware of - therefore I converted my enum fields to CHAR(1)s or INTs) and that the single quotes surrounding default values is the proper way to do DEFAULT values. I can't figure out for the life of me what's wrong with my syntax and I've been going at this for about 4 hours now.

If you can help me out by explaining how I should properly do the PKs/FKs (I believe there's a keyword REFERENCE(field1, field2) for FKs, but I'm not sure where to place it, etc.) I'll go through the SQL script and try to implement it, but I have a feeling this is going to be a long thread if I do get someone willing to help.

Thanks to everyone who took the time to read this,
Ahad L. Amdani

View 2 Replies View Related

MySQL To SQL Server 2005 Conversion Table

Mar 20, 2007

Does anyone know of a reference site where I can find a reference table to get a better idea of data type conversions that I should be using?

I have a MySQL 5.0 database which had a lot of tables (mostly empty) that I already have gotten transferred to SQL Server 2005. However, I am suspicious of some of the data type conversions that SQL Server did.

I would really like a good web site to bookmark to help me with this if there is such a reference. Can anyone help?

If not, the most specific example I have right now is a MySQL column that is expecting to accept currency and the MySQL data type is "Double". SQL Server 2005 translated this as a "float" data type. I normally use a "decimal" data type.

- - - -
- Will -
- - - -
http://www.strohlsitedesign.com
http://www.servicerank.com/

View 2 Replies View Related

Can't Start SQLEXPRESS So That I Can't Install Latest SQLEXPRESS Security Updates.

Mar 13, 2007

I can't start SQLEXPRESS.

The SQL ERRORLOG shows: Error is 3414, Severity 21, State 2 and says: "An error occurred during recovery, preventing the database 'model' (database ID 3) from restarting." Just prior to this, I get a warning: "did not see LP_CKPT_END".

Any thoughts why this might be and how I can fix this?

View 3 Replies View Related

Installing SqlExpress (Advanced Services) Will This Break Existing SqlExpress?

Sep 21, 2006

hiya,

I have sqlExpress and sqlServerManagementStudio on my XP pro box.

Will the installation of sqlExpress (Advanced Services) cause any problems?IS thereanything that I shold be aware of in advance?

many thanks,

yogi

View 3 Replies View Related

Linked Server To MYSQL Using OLEDB Provider For MYSQL Cherry

Feb 12, 2007

Good Morning

Has anyone successfully used cherry's oledb provider for MYSQL to create a linked server from MS SQLserver 2005 to a Linux red hat platform running MYSQL.

I can not get it to work.

I've created a UDL which tests fine. it looks like this

[oledb]

; Everything after this line is an OLE DB initstring

Provider=OleMySql.MySqlSource.1;Persist Security Info=False;User ID=testuser;

Data Source=databridge;Location="";Mode=Read;Trace="""""""""""""""""""""""""""""";

Initial Catalog=riverford_rhdx_20060822

Can any on help me convert this to corrrect syntax for sql stored procedure

sp_addlinkedserver



I've tried this below but it does not work I just get an error saying it can not create an instance of OleMySql.MySqlSource.

I used SQL server management studio to create the linked server then just scripted this out below.

I seem to be missing the user ID, but don't know where to put it in.

EXEC master.dbo.sp_addlinkedserver @server = N'DATABRIDGE_OLEDB', @srvproduct=N'mysql', @provider=N'OleMySql.MySqlSource', @datasrc=N'databridge', @catalog=N'riverford_rhdx_20060822'

GO

EXEC master.dbo.sp_serveroption @server=N'DATABRIDGE_OLEDB', @optname=N'collation compatible', @optvalue=N'false'

GO

EXEC master.dbo.sp_serveroption @server=N'DATABRIDGE_OLEDB', @optname=N'data access', @optvalue=N'true'

GO

EXEC master.dbo.sp_serveroption @server=N'DATABRIDGE_OLEDB', @optname=N'dist', @optvalue=N'false'

GO

EXEC master.dbo.sp_serveroption @server=N'DATABRIDGE_OLEDB', @optname=N'pub', @optvalue=N'false'

GO

EXEC master.dbo.sp_serveroption @server=N'DATABRIDGE_OLEDB', @optname=N'rpc', @optvalue=N'false'

GO

EXEC master.dbo.sp_serveroption @server=N'DATABRIDGE_OLEDB', @optname=N'rpc out', @optvalue=N'false'

GO

EXEC master.dbo.sp_serveroption @server=N'DATABRIDGE_OLEDB', @optname=N'sub', @optvalue=N'false'

GO

EXEC master.dbo.sp_serveroption @server=N'DATABRIDGE_OLEDB', @optname=N'connect timeout', @optvalue=N'0'

GO

EXEC master.dbo.sp_serveroption @server=N'DATABRIDGE_OLEDB', @optname=N'collation name', @optvalue=null

GO

EXEC master.dbo.sp_serveroption @server=N'DATABRIDGE_OLEDB', @optname=N'lazy schema validation', @optvalue=N'false'

GO

EXEC master.dbo.sp_serveroption @server=N'DATABRIDGE_OLEDB', @optname=N'query timeout', @optvalue=N'0'

GO

EXEC master.dbo.sp_serveroption @server=N'DATABRIDGE_OLEDB', @optname=N'use remote collation', @optvalue=N'false'



Many Thanks



David Hills



View 7 Replies View Related

How To Install Windows Application(C#) With SQLExpress In A System Which Is Having SQLExpress Already?

Jan 19, 2007

Hi All,

I have created an installation application which will install the application with SQL Express and .NET Framework 2.0.

If i install this application in a Fresh system(i.e which is not having SQL Express), it is installing the application with new database instance successfully.

But if i try to install the same in a system which is already having SQL Express, throwing "Object reference exception" because it is not able to create the new database instance.

Can anybody help me out .

Regards,

Doppalapudi.

View 2 Replies View Related

Using Database SqlExpress 2005.

Dec 27, 2007

Hi, 
I have a web site in asp.net 2003 with sql 2000. Can I run this database with sqlExpress 2005. And what changes would be made in web.config file.
This is due to I am going to check it with Window vista.
Thanks in advance
 
Naveed baig.

View 16 Replies View Related

To Attach DataBase In SQLExpress!

Jul 4, 2005

I have install SQLExpress, too I download AdventureDB, but it created files *.mdf and *.ldf.Now in SQLExpress I cann't attach database witch mouse, I believe that it in code, how I can goal it?. Is there some other way to make this in SQLExpress?

View 11 Replies View Related

SQLEXPRESS Database To Host

Feb 10, 2006

I created a sqlexpress database in visual studio 2005 and can't figure out to move the database to my hosting company( godaddy ).  I can't connect remotely to the database on my hosting company.   Whats the best way to go about this?

View 1 Replies View Related

Add Database In VWD - Can't Find SQLExpress

Apr 27, 2006

ERROR:

Connection to SQLServer files (*.mdf) require SQLServer Express 2005 to function properly.

ASP.NET Config manager is able to create aspnetdb and set up MemberShip correctly.

SQLExpress service account has access to teh folder (as witnessed by ASP.NET manger success).

What else can cause the IDE to fail to create and attach the file?

Also the accoutn I am running VWD under can access and create/attach db files with no problem.

I have the same issue running VS2005 Professional on a second machine.

I already shut down firewall to see if that was part of the issue.

View 3 Replies View Related

Locating Sqlexpress Database

Sep 1, 2006

I have created my sqlexpress database in Visual Studio 2005. When i go to SQL Server Management Studio Express I cannot open my database. It is not listed automatically and I get an error 'There is no editor for 'database name' Make sure the application for file type (.mdf) if installed.'

Any help or suggestions will be appreciated.



Thanks

View 5 Replies View Related

SQLEXPRESS CREATE DATABASE

Jun 3, 2005

Why does:

View 9 Replies View Related

Recreate A MySql Database

Nov 17, 2005

Hello

I am trying to recreate a MySQL database on a new domain. The original database was exported into about 40 .SQL text files. I am importing these .SQL text files into a new database using phpmyadmin. When I attempt to import the first of these files, I get a "fatal error". It says the upload time has exceeded the 300 second limit. How do I set up the server so there is no upload time limit? Or how would you approach a solution to this problem? There are about 40 of these text files and each file varies in size between 5 and 15mb. Is it possible to split individual files in half or 3 parts and import that way? Any help would be greatly appreciated. Thanks!!

View 1 Replies View Related

Querying To Mysql Database

Sep 20, 2007

Hi, I have been using Microsoft Access for a couple of years and we have just switched to SQL Server. However, I'm having problems querying the Mysql databases our company has in place. I have managed to establish connections in the Visual Studio but can't seem to link tables from two different databases like I could in Access. Is this possible? Also, is it possible to connect to the mysql database via management studio? Apologies for my complete lack of knowledge!

View 4 Replies View Related

I Need To Import A Database Sent To Me From Mysql

May 21, 2008



How would I import a database in SQL 2005 that was sent to me from a mysql database?

Thank you

View 11 Replies View Related

Sqlexpress Installer Doesn't Believe Sqlexpress Has Been Uninstalled

Mar 21, 2006

Because of numerous problems trying to get sqlexpress working, I uninstalled it with the intention of reinstalling (via Add or Remove Programs). However, now when I try to reinstall it, I get a message that the I am not making a changes so it won't let me install it.

I do have sql server 2005 developer's edition installed; is that the reason? and does that mean I cannot have both installed on the same machine?

View 1 Replies View Related

HELP - Insert Record SQLExpress Database

Feb 26, 2007

Hi! i ask you some help..I should build a simple INSERT FORM in a SQLExpress database..
but clicking ADD I have this error :
 
Incorrect syntax near '='.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Incorrect syntax near '='.Source Error:



Line 38: conDatabase.Open()
Line 39:
Line 40: cmdInsert.ExecuteNonQuery()
Line 41:
Line 42: conDatabase.Close()
some solution?
the source code:
 
<%@ Page Language="VB" Debug="true"%>
<%@ Import Namespace="System.Data"%>
<%@ Import Namespace="System.Data.SqlClient"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Sub Button_clic(ByVal s As Object, ByVal e As EventArgs)
Dim conDatabase As SqlConnection
Dim strInsert As String
Dim cmdInsert As SqlCommand
Dim myExecuteQuery As String
Dim myExecuteCmd As SqlCommand
 
conDatabase = New SqlConnection("Data Source=.SQLEXPRESS;AttachDbFilename=C:Inetpubwwwroot esiApp_Datadatabase.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True")
 
strInsert = "Insert pubblicazioni (Nome, Cognome, Titolo) Values = (@Nome, @Cognome, @Titolo) "
cmdInsert = New SqlCommand(strInsert, conDatabase)
cmdInsert.Parameters.Add("@Nome", txtNome.Text)
cmdInsert.Parameters.Add("@Cognome", txtCognome.Text)
cmdInsert.Parameters.Add("@Titolo", txtTitolo.Text)
 
conDatabase.Open()
cmdInsert.ExecuteNonQuery()
conDatabase.Close()
 
Response.Redirect("success.html")
End Sub
 
 
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>iNSERIMENTO</title>
<LINK href="mauro.css" rel=stylesheet>
 
<script type="text/javascript" language="javascript">
<!--
function popopen(){
window.open("upload/upload.aspx","name"," toolbar=no,directories=no,menubar=no,width=300,height=300,top=100,left=150,resizable=no,scrollbars=yes");
}
// -->
</script>
 
 
 
</head>
<body bgcolor="#DFE5F2" style="font-size: 12pt">
<form id="form1" runat="server">
<div>
&nbsp;<asp:Label ID="Label1" runat="server" BackColor="#8080FF" BorderColor="Black"
ForeColor="Black" Height="29px" Text="FORM INSERIMENTO DOCUMENTO" Width="371px" Font-Bold="True" Font-Names="Verdana" Font-Size="14pt" Font-Underline="True"></asp:Label><br />
<br />
<br />
<B><span style="font-family: Verdana">NOME&nbsp; </span></B>
<asp:TextBox ID="txtNome" runat="server"></asp:TextBox>
&nbsp; &nbsp; <B><span style="font-family: Verdana">COGNOME&nbsp; </span></B>
<asp:TextBox ID="txtCognome" runat="server"></asp:TextBox><br />
<br />
<B><span style="font-family: Verdana">TITOLO&nbsp; </span></B>
<asp:TextBox ID="txtTitolo" runat="server"></asp:TextBox><br />
<br />

 
 
 <a href="javascript:popopen()">CARICA DOCUMENTO</a><br/><br />
 
 
 
 
 
<asp:Button ID="Button1" runat="server" OnClick="Button_Clic" Text="ADD" Font-Bold="True" Font-Names="Verdana" Font-Size="12pt" Width="160px" /></div>
<br><br>
</form>
 
</body>
</html>

View 2 Replies View Related

Unable To Attach SQLExpress Database

Jul 13, 2007

 This is by FAR, the most frustrating problem I have dealt with for a while.I have a project containing a SqlExpress database that I created in Visual Studio 2005. Everything works perfectly on my development machine. However, upon copying the site up to the webserver, I get an error stating:An attempt to attach an auto-named database for file
D:ContentwwwFMakerApp_DataClassAd.mdf failed. A database with the
same name exists, or specified file cannot be opened, or it is located
on UNC shareI have read almost every article/forum post that resulted from a search with google. I also searched these forums, to no avail.Note - SQLExpress had just been downloaded and installed on the server, so it wasn't being used yet. Server is Windows Server 2003. Here are the following steps I have already taken:Used SSEUTIL.EXE to verify that another database of the same name was not already attachedUninstalled & reinstalled SQLExpress multiple timesTemporarily granted 'Full Control' permissions to 'Everyone' on the site folder to verify that it was not a permissions issue.Created a very simple website, with a new database, one page - with one listbox control, and a sqldatasource. Got the exact same error. Should rule out a problem with my application.Tried various flavors of the web.config connection string.Probably other stuff that I forgot about, but will add if I remember.The only things I could imagine being wrong are either a problem with my connectionString, or the fact that SQLExpress is installed on C:, and webstuff is on D: (Wasn't able to install SqlExpress to D: for some reason)Connection String  <connectionStrings> <add name="ClassAdConnectionString" connectionString="Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|ClassAd.mdf;Integrated Security=true;User Instance=True" providerName="System.Data.SqlClient" /> </connectionStrings>  So I have had like 12 strokes today. If anybody could help me get this fixed, I will spread tales of your awesomeness throughout the landsI have included some extra info below in case it is needed. Thanks, Adam.Entire Error An attempt to attach an auto-named database for file
D:ContentwwwFMakerApp_DataClassAd.mdf failed. A database with the
same name exists, or specified file cannot be opened, or it is located
on UNC share.



Description: An
unhandled exception occurred during the execution of the current web
request. Please review the stack trace for more information about the
error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException:
An attempt to attach an auto-named database for file
D:ContentwwwFMakerApp_DataClassAd.mdf failed. A database with the
same name exists, or specified file cannot be opened, or it is located
on UNC share.

Source Error:




Line 1705: }Line 1706: ClassAd.CategoriesDataTable dataTable = new ClassAd.CategoriesDataTable();Line 1707: this.Adapter.Fill(dataTable);Line 1708: return dataTable;Line 1709: }







Source File: c:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Filesforms9d7c504b4b8a576eApp_Code.3dq8tdsl.9.cs    Line: 1707


Stack Trace:




[SqlException (0x80131904): An attempt to attach an auto-named database for file D:ContentwwwFMakerApp_DataClassAd.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +739123 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1956 System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +33 System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +170 System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +349 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +181 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +170 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +359 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66 System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +496 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105 System.Data.SqlClient.SqlConnection.Open() +111 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +121 System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) +162 System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) +107 ClassAdTableAdapters.CategoriesTableAdapter.GetCategoriesByPropCode(String PropCode) in c:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Filesforms9d7c504b4b8a576eApp_Code.3dq8tdsl.9.cs:1707[TargetInvocationException: Exception has been thrown by the target of an invocation.] System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) +0 System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) +72 System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +358 System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +29 System.Web.UI.WebControls.ObjectDataSourceView.InvokeMethod(ObjectDataSourceMethod method, Boolean disposeInstance, Object& instance) +482 System.Web.UI.WebControls.ObjectDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +2040 System.Web.UI.WebControls.ListControl.OnDataBinding(EventArgs e) +92 System.Web.UI.WebControls.ListControl.PerformSelect() +31 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82 System.Web.UI.WebControls.ListControl.OnPreRender(EventArgs e) +26 System.Web.UI.WebControls.ListBox.OnPreRender(EventArgs e) +9 System.Web.UI.Control.PreRenderRecursiveInternal() +77 System.Web.UI.Control.PreRenderRecursiveInternal() +161 System.Web.UI.Control.PreRenderRecursiveInternal() +161 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360 

View 1 Replies View Related

Does Anyone Have Northwind Database File For SQLExpress ?

May 25, 2006

Hello.Does anyone have Northwind database file for SQLExpress ? I really need it for learning purpose now.Thanks in advanced.

View 1 Replies View Related

Restore Master Database To SQLExpress

Sep 20, 2006



Hello,

I have a fresh install of sqlExpress and Management Studio Express on my test server. I want to restore my master database from backup.

From the command prompt I set the Sqlservr -s SQLEXPRESS -m

Then I opened another comand prompt and ran my SQLCMD script to restore the Master Database.

here is the sql script:
RESTORE DATABASE [Master] FROM DISK = N'E:COPLEYNEWSDATABASEBACKUPMaster.bak' WITH FILE = 1, MOVE N'mastlog' TO N'C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLDATAMaster_1.ldf', NOUNLOAD, STATS = 10
GO

I recieve the following error.

Msg 3154, Level 16, State 4, Server COPLEYNEWSSQLEXPRESS, Line 1
The backup set holds a backup of a database other than the existing 'Master' dat
abase.
Msg 3013, Level 16, State 1, Server COPLEYNEWSSQLEXPRESS, Line 1

How do I restore a Master Database on SQL Express?

View 8 Replies View Related

Unable To Attach SQLExpress Database

Jul 16, 2007

This is by FAR, the most frustrating problem I have dealt with for a while.

I have a project containing a SqlExpress database that I created in Visual Studio 2005. Everything works perfectly on my development machine. However, upon copying the site up to the webserver, I get an error stating:


An attempt to attach an auto-named database for fileD:ContentwwwFMakerApp_DataClassAd.mdf failed. A database with thesame name exists, or specified file cannot be opened, or it is locatedon UNC share

I have read almost every article/forum post that resulted from a search with google. I also searched these forums, to no avail.

Note - SQLExpress had just been downloaded and installed on the server, so it wasn't being used yet. Server is Windows Server 2003.

Here are the following steps I have already taken:

Used SSEUTIL.EXE to verify that another database of the same name was not already attached
Uninstalled & reinstalled SQLExpress multiple times
Temporarily granted 'Full Control' permissions to 'Everyone' on the site folder to verify that it was not a permissions issue.
Created a very simple website, with a new database, one page - with one listbox control, and a sqldatasource. Got the exact same error. Should rule out a problem with my application.
Tried various flavors of the web.config connection string.
Probably other stuff that I forgot about, but will add if I remember.

The only things I could imagine being wrong are either a problem with my connectionString, or the fact that SQLExpress is installed on C:, and webstuff is on D: (Wasn't able to install SqlExpress to D: for some reason)

Connection String
<connectionStrings>
<add name="ClassAdConnectionString" connectionString="Data Source=.SQLEXPRESS;
AttachDbFilename=|DataDirectory|ClassAd.mdf;Integrated Security=true;User Instance=True"
providerName="System.Data.SqlClient" />
</connectionStrings>




So I have had like 12 strokes today. If anybody could help me get this fixed, I will spread tales of your awesomeness throughout the lands


I have included some extra info below in case it is needed.
Thanks, Adam.


Entire Error

An attempt to attach an auto-named database for fileD:ContentwwwFMakerApp_DataClassAd.mdf failed. A database with thesame name exists, or specified file cannot be opened, or it is locatedon UNC share. Description: Anunhandled exception occurred during the execution of the current webrequest. Please review the stack trace for more information about theerror and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException:An attempt to attach an auto-named database for fileD:ContentwwwFMakerApp_DataClassAd.mdf failed. A database with thesame name exists, or specified file cannot be opened, or it is locatedon UNC share.

Source Error:





Line 1705: }
Line 1706: ClassAd.CategoriesDataTable dataTable = new ClassAd.CategoriesDataTable();
Line 1707: this.Adapter.Fill(dataTable);
Line 1708: return dataTable;
Line 1709: }
Source File: c:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Filesforms9d7c504b4b8a576eApp_Code.3dq8tdsl.9.cs Line: 1707

Stack Trace:





[SqlException (0x80131904): An attempt to attach an auto-named database for file D:ContentwwwFMakerApp_DataClassAd.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +739123
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1956
System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +33
System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +170
System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +349
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +181
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +170
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +359
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28
System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +496
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
System.Data.SqlClient.SqlConnection.Open() +111
System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +121
System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) +162
System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) +107
ClassAdTableAdapters.CategoriesTableAdapter.GetCategoriesByPropCode(String PropCode) in c:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Filesforms9d7c504b4b8a576eApp_Code.3dq8tdsl.9.cs:1707

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) +0
System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) +72
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +358
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +29
System.Web.UI.WebControls.ObjectDataSourceView.InvokeMethod(ObjectDataSourceMethod method, Boolean disposeInstance, Object& instance) +482
System.Web.UI.WebControls.ObjectDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +2040
System.Web.UI.WebControls.ListControl.OnDataBinding(EventArgs e) +92
System.Web.UI.WebControls.ListControl.PerformSelect() +31
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
System.Web.UI.WebControls.ListControl.OnPreRender(EventArgs e) +26
System.Web.UI.WebControls.ListBox.OnPreRender(EventArgs e) +9
System.Web.UI.Control.PreRenderRecursiveInternal() +77
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360





View 2 Replies View Related

Importing Access Database Into SQLExpress

Jun 1, 2006

I am trying to complete a lab in the Microsoft self-paced training kit, Developing Web Applications with Microsoft Visual C# .NET.

They have provided an Access database named Contacts.mdb and a batch file named InstContacts.bat that uses InstContacts.sql to import the data.

I have installed SQLExpress, but when I run the batch file I get the following:

C:Microsoft Press...data>rem The following command line installs the Contact SQL database

C:Microsoft Press...data>osql -i InstContacts.Sql -E 
[SQL Native Client]Named Pipes Provider: Could not open a connection to SQL Server [2].
[SQL Native Client]Login timeout expired
[SQL Native Client]An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.

View 1 Replies View Related

Connect To External DataBase Via SQLExpress??

Jan 28, 2007

Hi again... I guess this is yet another newbie question (Sorry if its been asked before!)

If I have an IP address for an external SQL DB with valid User & Pass... Can I connect to it using SQLExpress on my machine??

If so can anyone point me towards how to do it, or run through it below (In easy steps as I'm dumb )

View 6 Replies View Related

Linking Website To MySQL Database

Feb 28, 2003

I am currently trying to complete part of my A-level coursework but am stuck.

i am creating a website for a restaurant on which customers can submit information to do with four areas:
---------------------
Bookings
Comments
Job Applications
Pre-order
----------------------

i have used access alot in the past and had no problems creating a running model of my final database.

i have built my website and created the four tables in the alloted MySQL area that came with my website package.

BIG QUESTION:

how do i create the interface for people to submit data and for it to be sent to my database?

i am a complete beginner to MySQL using it for the first time this week so im not sure what i need to do in the slightest to solve this issue

-------------

any help or advice would be VERY VERY gratefull

View 1 Replies View Related

Query A Linked MySQL Database

Jul 2, 2003

We have SQL Server 2000 on a Windows 2000 server and a mySQL database running on a Windows 2000 server.
We have used MyOLEDB driver(OLEDB) to link the mysql database.
How can I access the data stored in a Linked server?

Any help would be appreciated.
Thanks!!

this is our codeˇG
exec sp_addlinkedserver @server='OLEDB_test',
@srvproduct=N'',
@provider=N'MySQLProv',
@datasrc=N'203.xx.xx.xx',
@catalog = N'Store'

exec sp_addlinkedsrvlogin 'OLEDB_test','false',null,'root',''

select * from OLEDB_test.Store.root.Books
or
select * from OLEDB_test.Store..Books

error message:
Can't create OLE DB Provider 'MySQLProv' instanceˇC
OLE DB error trace [Non-interface error: CoCreate of DSO for MySQLProv returned 0x80040154]ˇC


by the wayˇG
1.We Create an ODBC System DSN that points to our MYSql server
2.We use OLEDB for ODBC to create a linked server to mySQL
3.We have got the query to work with openquery
but we can't updateˇBdeleteˇBmodify the data stored in a Linked server

View 1 Replies View Related

Linked Server To A MySQL Database

Feb 25, 2004

Hi,

I've installed MyODBC-3.51.06 and succsesfully created 2 odbc sources to the MySQL database with the ODBC data source administrator. One is a User DSN, the other a system DSN (Q1: what's the difference?) The test in that applet perfoms positively.

Running a dataimport of the tables using the import data option in enterprise manager does work as well.

Now for the part that gives me trouble. I would like to create a linked server using enterprise manager of SQL server 2000 (SQL 8.00.194) but I'm totaly stuck there. So Q2: how to get this set up?

View 2 Replies View Related

How Can I Access To Remote Mysql Database?

May 5, 2008



Hi,

I am using Mysql ODBC 3.51 and/or 5.1 connection . this works fine with DTS But it hangs when I use with SSIS ...
MS Visual Studio is giving message like " MS Visual Studio is Busy"

Which driver should I use for SSIS?

thanks,
J

View 3 Replies View Related

How Do I Connect To MYSQL Database In SSRS

May 21, 2007

I haven't used SSRS much but I need to connect a database in MYSQL for SSRS. I right click on Datasource and do add new datasource but the only option I see is SqlNative client and Oracle client. How do I go about connecting to my database in MYSQL



View 3 Replies View Related

MSSQL - MySql Database Connectivity

Dec 6, 2007

Hi,
A third party development company is creating a third party application for us in PHP and uses a MYSQL database. The app is an extension of our website which is developed in .NET and uses a MSSQL 2005 database. There are some cases where the two databases require connectivity since a few fields need to relate. We are having issues connecting the two databases on the server and after reading some forums have identified it to be a configuration issue.

I was wondering if anyone could be of any help in solving this issue, or lead us in the right direction (i.e. where to begin, forums, etc.). Here is a description and some questions from our developer:

---------------------------
We are trying to get a PHP application (.php pages running on the webserver which is the same physical machine as the MS SQL server) to connect to the database (MS SQL server). In order to facilitate this, php.ini was configured in the following manner:

mssql.secure_connection = ON
extension=php_mssql.dll

We ensured that IIS/Windows was setup properly too:
System32 and php both contain ntwdblib.dll ver 2000.80.194.0
enable pipe name protocol [Default was disable]
enable TCP/IP IP1 [Default was disable]

MS SQL Server is set to Windows AND SQL server authentication (Mixed mode).

When the PHP application attempts to connect to the database by using:
mssql_connect('localhost', '<userid>', '<password>')

produces this error message:
Login failed for user 'MAILIUSR_<computername>'. (severity 14)

Why doe this occur? Why is this IUSR userid being used? the userid we sent in with PHP was a sql userid that we know works (we use it with .NET, and to connect to the database remotely). Also, why is it using the MAIL domain? In anycase, shouldn't this IUSR userid work? it's a valid windows account, and mixed mode authentication is allowed.

-------------------------
Any assistance would be greatly appreciated!

View 2 Replies View Related

Need Help With A MySQL To MSSQL Database Migration...

May 1, 2007

Hello there..... im currently running a mysql database and i want to switch to a mssql database structure... creating the database is not a issue, but inserting values is a problem...

my forum has a lot of data and moving one row at a time is near insanity....

i tried this. ---




Code Snippet

INSERT INTO si_acl_groups ("group_id", "forum_id", "auth_option_id", "auth_role_id", "auth_setting") VALUES
(100, 0, 0, 14, 0),
(96, 0, 15, 0, 1);


but i only get this error. ---

Msg 102, Level 15, State 1, Line 2
Incorrect syntax near ','.

any suggestion...

i was able to dump the mysql database into a .sql file but it just gives the same error when i execute...

please help...

View 15 Replies View Related

Attach MySql Database Via Internet

Sep 23, 2006

Hie !

Please, how to manage (attach,connect to) MySql database located on host server http://www.avanti.si from my home PC with Microsoft SQL Server Management Studio Express? This "http://www.avanti.si:8080MySqlDatabaseName,3306" fail !

Thenks!

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved