More Questions About Porting From MySQL To MS SQL

Aug 2, 2006

1) In several tables, in my MySQL version, I created columns using
something like the following:

`ab_timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update
CURRENT_TIMESTAMP,

This allowed me to ensure that when a record is either added or edited,
the value in the field is set to the current date and time. I.E.,
ab_timestamp is given the current date and time when a record is
created, and then it is updated to the date and time at which the
record is updated. I learned the hard way that MS SQL does not like
"on update CURRENT_TIMESTAMP". So, it looks like MS SQL will allow me
to initialize ab_timestamp to the current date and time, but not
automatically update it to the date and time at which the record is
updated. I have plenty of code to port that depends on the behaviour
supported by MySQL. DO I have to modify all that code, or is there a
way to get MS SQL to provide it? (Yes, I know 'timestamp' is
deprecated in MS SQL and that I should use datetime instead, and in
fact have already done so.)

2) I began with a single SQL script that creates all the tables, views,
functions and triggers the database needs. On trying to get MS SQL to
accept it, I encountered a number of error messages saying that CREATE
FUNCTION and CREATE VIEW need to be the first statement in a script.
Why? I know I can work around this odd constraint by putting each
function and view (and IIRC trigger) into its own script, but that
seems like a make work effort imposed for some unknown reason by MS
SQL, unless there is another way to get around it.

3) I see, in the documentation for CREATE FUNCTION, functions are not
allowed to use a timestamp for either a parameter or a return value.
This is in reference to a pair of scalar functions I am using which
need to manipulate date and time values. For the purpose of
clarification, is this documentation refering to all date/time data
types, or only the deprecated timestamp type? As examples, consider
one function that needs to return the most recent date in a date column
in a specific table, or another function that computes a date from a
date and an offset (e.g. if called with the value returned by the first
function as the first argument and '-7' as the second, returns the date
of the day that is a week earlier than that date). These two functions
are frequently used in the SQL code I'm trying to port and I really
don't want to complicate so many of those statements if I don't have
to.

Thanks

Ted

View 2 Replies


ADVERTISEMENT

Questions About Keys - Porting Code From MySQL To MS-SQL

Aug 2, 2006

Understand, I have developed a number of applications using RDBMS,including MySQL, PostgreSQL and MS Access, but this is my firstexperience with MS SQL. I'd bet my bottom dollar that MS SQL supportswhat I need, but I just haven't found where it is explained in anydetail in the documentation I have. The pages I have found strike meas a little too terse for my needs.In MySQL, I used statements like:PRIMARY KEY (`ic_contact_id`),KEY `ic_planner_id_k_tmp` (`ic_rep_code`)at the end of the SQL statement that creates a table. The primary keyhad to be unique but the other did not. Defining the non-unique keypaid huge dividends in the performance of certain queries, sometimesleading to orders of magnitude improvement compared to when the KEY wasnot defined (a few seconds vs tens of minutes). In joins, these keysrelate to primary keys in other tables that function as lookup tables.Otherwise, their primary role is for aggregation functions (max, min,&c.) in relation to group by clauses. The performance improvementsfrom having the KEYs defined are greatest in the latter.I have learned the hard way that MS SQL seems to like my primary keyclauses but not my KEY clauses. I don't know, and at present don'tcare, if this is because MySQL supports my KEYs as an extension to thestandard, or if it is a matter of the two RDBMS interpreting thestandard differently, or something else. What I need to know right nowis how do I obtain in MS SQL the same benefit as the MySQL KEY providedto me.A second question is that, in studying the documentation for the createtable statement, I saw reference to clustered vs non-clustered keys (atleast I assume they relate to keys since they immediately follow, andare indented from, the primary key and unique keywords). What exactlyis clustered and why? BTW, my primary understanding of "clustering"derives from work with numerical taxonomy and biogeography, but I'dwager that is something completely different from any clustering donein an RDBMS.I'll appreciate any clarification you can provide.Thanks,Ted

View 4 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

Porting Lab Question

Jul 15, 1998

Hello from Microsoft SQL Server 7.0 Porting Lab. Anyone have any 7.0 questions for the Microsoft people while I`m here?

View 1 Replies View Related

Porting From MSSQL 6.5 To 7

Nov 18, 1998

I's any problem with porting app. from 6.5 to 7?

The whole app is in MSSQL
& client made by ASP

Thanx

View 1 Replies View Related

Porting DTS Error - Urgent

Aug 15, 2000

Hey everyone - I get the following error when I try to open up a DTS package that I ported from one machine to another as a file. The error is:

Error Source: Microsoft Data Transformation Services (DTS) Package

Error Description: The parameter is incorrect.

Does anyone know what this error is and how to get the package to open? I really don't want to have to rewrite the package if I can avoid. Any help would be greatly appreciated.

View 1 Replies View Related

Porting An Access Db To SQL Server

Mar 6, 2004

I have a MS Access DB that needs to be moved to SQL Server. I have no clue how to do this or even what the issues and considerations are.

Can anyone provide a link to any resources where I can educate myself? Or offer any advice or "lessons learned".

I anticipate using the same Access DB as a front end since the forms are all set up as we like.

Thanks in advance

Don

View 5 Replies View Related

Porting Access To SQL Down The Line

Mar 17, 2004

I have started a new site using a CMS which can be either Access or MS SQL. For ease of install and cost factors the site is currently running as an Access dbase driven site. If traffic numbers and content grow and Access dbase blows out to, lets say 500meg will I see a major degradation in performance and will it be possible at a later data to somehow export the Access dbase data into MS SQL dbase format. I'm assuming I'd have to engage a fairly competent developer but before I get into the trap of growing a large site, I'd like confirmation that I'd be able to extract all of the data and get it into a more robust solution as and when required. phew!

View 8 Replies View Related

Porting From Oracle To SQL Server

Jul 23, 2005

Has any body done the porting from oracle to sql server, what were theissues in porting the data bases?Also suggest some resources which can be helpful in the porting projectTIAGolu

View 4 Replies View Related

Securing Databases From Porting

Jul 23, 2005

I have a situation where I have an app that uses a sql server (msde)database. The app will be used in environments where no one should beable to manipulate the data except the developers (app admins) - noteven site database admins. When the application and msde is installed,a default instance of the database gets attached to msde or built byscript. by default, a built in server acct and approle acct exist tosecure the data accordingly with passwords concealed. What can be doneto keep someone from copying the mdf and ldf files to another machinewhere they have admin rights and manipulating data?Thanks.

View 1 Replies View Related

Porting Data To Another Sql Server

Jun 27, 2007

Hi,



Currently, I need to move the 2 database from a MSsql server to another new MSsql server.

How do I do it?

View 4 Replies View Related

Porting Access Database

Nov 21, 2006

I am still pursuing my studies. I have been recently assigned a project for building Database Application for my college's library. And there was no better option to implement it with VB.NET 2.0 & SQL Server 2005.
VB.NET 2005 & SQL Server Express 2005 are the resources at my disposal.

The problem is that the college already has a Library Management System in place, built in VB6.0 with Access. I have been asked to pepare the application from scratch. But the database obviously cannot be left out.

Now, can anyone suggest me an efficient way to port the Access database to SQL Server express. Also, the databse has been desinged poorly & is not properly normalized.
Can I port it to SQL Server Express with some slight modifications to its structure without any loss of data??????

View 8 Replies View Related

Question About Porting Data Into A New Database.

Aug 2, 2007

We rewrote one of our legacy C#/asp.net applications that accesses a sql server 2000 database. The new database schema looks very similar to the old one. The major difference is that some of the atributes in the database tables are different. But pretty much we are using the same tables, plus or minus a few.
We need to import the old data into the new database. I have never had to undertake this type of thing before as I am not a DBA, but a developer. I feel a little scared about this whole process. My boss is open to us hiring a contractor to help with the process.
My biggest concern is the referential integrity of the database.
Can someone help me out. Does this sound like something that can be easily done or should I ask for some help.
Ralph

View 2 Replies View Related

Strange Error While Porting From Xp To 2003!

Mar 30, 2005

 hi,
     i got the application(from my first post) working in win2003. but this application was made in webmatrix, i.e it had only 2 files, the .aspx file and the web.config file. so i decided to convert this code to a vs.net web application project. i did that and got it working on my xp box.
i copied the app folder on 2003, made that folder as an app in iis 6 of win 2003 and tried to run it, and got the following error:-  
 
Server Error in '/emrtd' Application.


Cannot open database requested in login 'ASPState'. Login fails. Login failed for user 'HPSISandeshD'.
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: Cannot open database requested in login 'ASPState'. Login fails. Login failed for user 'HPSISandeshD'.Source Error:



An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace:



[SqlException: Cannot open database requested in login 'ASPState'. Login fails.
Login failed for user 'HPSISandeshD'.]
System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) +472
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) +372
System.Data.SqlClient.SqlConnection.Open() +384
System.Web.SessionState.SqlStateConnection..ctor(String sqlconnectionstring) +92

[HttpException (0x80004005): Unable to connect to SQL Server session database.]
System.Web.SessionState.SqlStateConnection..ctor(String sqlconnectionstring) +191
System.Web.SessionState.SqlStateClientManager.GetConnection(Boolean& usePooling) +98
System.Web.SessionState.SqlStateClientManager.SetAsyncWorker(String id, SessionStateItem item, Byte[] buf, Int32 length, Boolean inStorage) +44
System.Web.SessionState.SqlStateClientManager.System.Web.SessionState.IStateClientManager.Set(String id, SessionStateItem item, Boolean inStorage) +147
System.Web.SessionState.SessionStateModule.OnReleaseState(Object source, EventArgs eventArgs) +465
System.Web.SyncEventExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute() +60
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +87



Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032
 
 
please help on this, why is this happening?

View 2 Replies View Related

Porting Database Object Changes From QA To Production

Mar 2, 2004

Can anyone help me in this issue:
How do we replicate database changes (like tables) from QA to production without losing Production data.
We already tried using the DTS export but it is dropping the destination tables before export which will result in data loss in the destination database.

View 3 Replies View Related

Configuration File For Porting From One Environment To Another

Oct 2, 2007



Hi,

I'm using connection managers for all the connections i have in my packages in one project. However, if i change from one environment to another, i have to go to each connection manager in each package just to set the connection.

is there a faster way to change them like a configuration file lookup or something?

cherriesh

View 4 Replies View Related

Problem During Data Porting Using Linked Server

Feb 4, 2005

Hi All,

I have problems while using the Linked Server in MS SQL Server 2000 for data porting.

The Scenario :

I have about 900 hundred tables created in SQL Server database. These tables are freshly created and has no records.

I have created a Linked Server with a DSN connecting to a Sybase database from which the data has to be ported to the newly created tables in SQL Server.

The database creation as well as data porting is done by a Delphi application by executing the scripts in several .sql files.

I have shown an example script below which does the data porting.

INSERT INTO TEST_DATA (COL1,COL2,COL3)
SELECT COL1,COL2,COL3 FROM [LINK_SYBASEDB]..[DBA].[TEST_DATA]


The Issue :

I often get the below error which stops the data porting process ( the error is logged in the Errorlog by the Delphi application )


D:DBPortTEST_DATA.SQL
[OLE/DB provider returned message: [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed]


NOTE : This error is NOT COMING CONSISTENTLY.Often I get this error and sometimes all the data is ported without this error.

It will be great if any of you can help me to resolve this issue.

Thanks in advance !!!

regards,

Hari Haran Arulmozhi

View 1 Replies View Related

Porting An Existant Application From Ms Access To Sql Server

Jan 9, 2007

My database knowledge are with MySql and Oracle, but recently I was asked to evaluate the migration of an existing (and maybe more) from ms access to sql server. My question is simple, if all of the sql are hard coded into the code ... how well this sql will work, I mean is the sql between access and sql server are plug'n'play ? However in any case, I always rewiew all of the sql.

View 2 Replies View Related

Porting Database Functions From WM 5 Pocket PC To WIN32

Apr 21, 2008

Hi all,

I'm working on porting a solution running under WM 5 Pocket PC to Win32 but I got some problems with type definitions like CEOID, CEGUID... I saw that these types are defined in windbase.h (EDB definition added to preprocessors) ) which includes types and definitions usefull for database managment. Anyway this header file is not present in C:Program FilesMicrosoft Platform SDK for Windows Server 2003 R2Include, so I was wondering which is the header file I can use instead of it. Thanks

View 5 Replies View Related

Trouble Porting A Trivially Simple Function - With Declared Variables

Aug 4, 2006

Here is one such function:CREATE FUNCTION my_max_market_date () RETURNS datetimeBEGINDECLARE @mmmd AS datetime;SELECT max(h_market_date) INTO @mmmd FROM holdings_tmp;RETURN @mmmd;ENDOne change I had to make, relative to what I had working in MySQL, wasto insert 'AS' between my variable and its type. Without 'AS', MS SQLinsisted in telling me that datetime is not valid for a cursor; and Iam not using a cursor here. The purpose of this function is tosimplify a number of SQL statements that depend on obtaining the mostrecent datetime value in column h_market_date in the holdings_tmptable.The present problem is that MS SQL doesn't seem to want to allow me toplace that value in my variable '@mmmd'. I could do this easily inMySQL. Why is MS SQL giving me grief over something that should be sosimple. I have not yet found anything in the documentation for SELECTthat could explain what's wrong here. :-(Any ideas?ThanksTed

View 6 Replies View Related

Equivalent To MySQL's Password() Function? (was MySQL To SQL Server And Password())

Mar 3, 2005

I have an internal Project Management and Scheduling app that I wrote internally for my company. It was written to use MySQL running on a Debian server, but I am going to move it to SQL Server 2000 and integrate it with our Accounting software. The part I am having trouble with is the user login portion. I previously used this:


PHP Code:




 $sql = "SELECT * FROM users WHERE username = "$username" AND user_password = password("$password")"; 






Apparently the password() function is not available when accessing SQL Server via ODBC. Is there an equivalent function I could use isntead so the passwords arent plaintext in the database? I only have 15 people using the system so a blank pwd reset wouldn't be too much trouble.

View 7 Replies View Related

SQL License Questions And Other Questions &&>&&>&&>&&>

Mar 3, 2006

1.    Is it legal  and OK to use a MSDN SQL copy on a production environment or is it strickly for test environments ??

2.   If I own a legal copy of SQL 7 with 5 cals, can I legally use SQL MSDE and have more than 5 people access my SQL server or am I also limited to 5 users as my original ??

 Sorry I am a newbie at this SQL thing.

View 1 Replies View Related

Porting VB 6 Data Controls To Use SqlDatasource Controls - Please Help!!!!

May 9, 2007

Hi,  I am porting a massive VB6 project to ASP.net 2005.  Most of the code is fine, however because the original developers used lots of data controls and my own time restrictions I thought to replicate the functionality by using Sqldatasource controls instead. 
 These data controls are bound to DBtruegrids.   The project has has lots of code like...
 AdodcOrders.Recordset.RecordCount > 0 or  If AdodcOrders.Recordset.EOF  or  AdodcOrders.Recordset.MoveNext()  or
AdodcDetail.Recordset!FieldName
The problem is the sqldatasource control doesn't have a recordset/dataset property which I can access and manipulate, or does it?  What should I do to get round these?  The project has thousands of lines like this in so its not feasible to rewrite it (although if I could I would!).
 Any suggestions please gratefully appreciated.
many thanks
mike

View 1 Replies View Related

Sql And Mysql

May 14, 2007

Hello,I'd noticed when looking at the prices of hosting ASP websites that it was much cheaper if you useda mysql database instead of mssql so this is the way that I coded everything.  I've been using the logincontrol too though so does this mean... 1) that I *need* a mssql database?2) that this database will take up my 1 allocated mssql database with the webhost?3) can I use mysql in the same website; it seems to be working ok with the developer server... Many thanks folks,Adam 

View 5 Replies View Related

MySQL DB

Nov 29, 2001

Has anyone ever connected to a MySQL DB? If so, did you encounter difficulties? Did you do it through DTS? Can you give me some specifics?

DenverDBA

View 1 Replies View Related

MySQL

Apr 27, 2004

puuuuuuuuuuuuuuuleeeeeeeeeeze

Sorry....

View 6 Replies View Related

MySQL -&> SQL

Feb 19, 2007

Can anybody see what is wrong with this?

create table transaction
(txn_id int not null IDENTITY(1,1),
txn_date datetime not null,
account_id int not null,
/*txn_type_cd enum('DBT','CDT')*/check(txn_type_cd('DBT','CDT')),
amount double(10,2) not null,
teller_emp_id smallint ,
execution_branch_id smallint ,
funds_avail_date datetime,
constraint fk_t_account_id foreign key (account_id)
references account (account_id),
constraint fk_teller_emp_id foreign key (teller_emp_id)
references employee (emp_id),
constraint fk_exec_branch_id foreign key (execution_branch_id)
references branch (branch_id),
constraint pk_transaction primary key (txn_id)

I'm getting an error when I try and run in, but I can't see what it is!

Incorrect syntax near the keyword 'transaction'.

The code has been generated as mysql, and I am attempting to change it to SQL.

Thank you!

View 3 Replies View Related

Vs MySQL

Jan 9, 2006

HiHow is SQL Server 2000 better than MySQL? I need to convince my boss as weare contemplating doing a website with either SQL Server 2000 or MySQL asbackend.ThanksRegards

View 4 Replies View Related

Mysql And ASP

Jul 20, 2005

Hi all, i've just set up an mysql server on my computer and now i want toconnect to a mysql database with an ASP page but i can't find the correctconnection string. I always get an error that the datasource can not befound.ConnString ="Driver={MySQL};SERVER=mysqlhost;DATABASE=myDB;UID= userID;PASSWORD=pasword"What's wrong with it?

View 1 Replies View Related

Mysql And C++

Jul 20, 2005

hellosomeone could tell me how could I insert SQL statement in a C++ code ?If you know online documents easy to read about this subject, it will bevery welcome(in english or in french)..Thanks

View 1 Replies View Related

Uso Del Top En El Mysql

Jul 20, 2005

hola! alguno sabe como uso el top en el mysql??? debo hacer lasiguiente consulta y no le gusta al mysqlSELECT TOP 10 * From ControlDeCaja WHERE CodUsuario = "xxx"alguien sabe? Gracias de todas maneras!!

View 1 Replies View Related

MySQL

Jan 31, 2006

Is SQL Server Express the same as MySQL?

View 1 Replies View Related

MySQL To Sql Server 05

Oct 5, 2006

im trying to convert this table for a friend 1 CREATE TABLE adminmessage (
2 adminmessageid INT UNSIGNED NOT NULL AUTO_INCREMENT,
3 varname varchar(250) NOT NULL DEFAULT '',
4 dismissable SMALLINT UNSIGNED NOT NULL DEFAULT '0',
5 script varchar(50) NOT NULL DEFAULT '',
6 action varchar(20) NOT NULL DEFAULT '',
7 execurl mediumtext NOT NULL,
8 method enum('get','post') NOT NULL DEFAULT 'post',
9 dateline INT UNSIGNED NOT NULL DEFAULT '0',
10 status enum('undone','done','dismissed') NOT NULL default 'undone',
11 statususerid INT UNSIGNED NOT NULL DEFAULT '0',
12 PRIMARY KEY (adminmessageid),
13 KEY script_action (script, action),
14 KEY varname (varname)
15 )
  and was wondering how to do it when mssql doesn't have enums :(

View 1 Replies View Related







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