PDA

Click to See Complete Forum and Search --> : [RESOLVED] mysql vs microsoft sql


Zeratulsdomain
Jan 10th, 2008, 04:06 PM
How close is the syntax's between these two?

I coded lots of mysql and it all went well...

now I need to code for a microsoft sql enterprise or something...

so using php or vb.net, how close is the syntac? How long do you think it would take someone who knows mysql to learn the MS sql syntax?

wossname
Jan 10th, 2008, 04:10 PM
Pretty close. There's plenty of online documentation for both types anyway.

Not very long I suspect.

timeshifter
Jan 10th, 2008, 04:51 PM
MS SQL is fairly primitive... not a whole ton of functionality for the everyday task. It has one loop (WHILE), and very few string functions... but the basic syntax is pretty easy.

szlamany
Jan 10th, 2008, 06:52 PM
MS SQL is fairly primitive... not a whole ton of functionality for the everyday task. It has one loop (WHILE), and very few string functions... but the basic syntax is pretty easy.Really - are you joking?

Do you code in MS SQL professionally? Commercially?

Arrow_Raider
Jan 10th, 2008, 07:19 PM
ms SQL > mysql

Pino
Jan 11th, 2008, 04:11 AM
Moved To General Developer And Removed Nonsense Posts

Zeratulsdomain
Jan 11th, 2008, 04:15 AM
Well it all seems complicated. With mysql I just put in the host, username and password in MySQL query browser and I could connect to a GUI and send sequel commands easily (and it was also very easy in php, and also doable in vb.net).

Now I dont even know how to connect to this MS SQL db...


In addition the following sites seems have different syntax http://www.functionx.com/sqlserver/

Anyone have any good site to recommend?

szlamany
Jan 11th, 2008, 05:23 AM
If you are using any version of MS SQL 2005 - especially EXPRESS - then download Management Studio from MS. There is a FREE EXPRESS version.

http://www.microsoft.com/downloads/details.aspx?FamilyId=C243A5AE-4BD1-4E3D-94B8-5A0F62BF7796&displaylang=en

This tool does exactly what you just said - enter a server name, un/pw combo and you are managing that server. You can open query windows and type in SQL queries to execute against the server.

You can talk to the DB/server from visual studio - but I would personally recommend against that.

We do all our queries through stored procedures - each one developed in a query window and saved as .SQL text files. Stored in SOURCE SAFE for tracking.

I've probably written 2000 sprocs in the past 6 years - some having a single query and some having thousands of lines of query and logic flow code.

I'm sure there are many differences in concepts, syntax, datatypes - and other areas - from mySql.

Feel free to ask questions and I'm sure we can help you out.

Good luck.

Zeratulsdomain
Jan 11th, 2008, 12:37 PM
tnx for the reply.


If you are using any version of MS SQL 2005 - especially EXPRESS - then download Management Studio from MS. There is a FREE EXPRESS version.

http://www.microsoft.com/downloads/d...displaylang=en
yeah I downloaded Management Studio yesterday, couldnt install it till today for some reason. I can now connect and was able to issue basic queries so far.

You can talk to the DB/server from visual studio - but I would personally recommend against that.

I couldnt even connect the database. I am using the free express version right now, not sure if that has something to do with it. The only other time I did DB stuff in vb.net I was also using a local mdf DB.

Problem I am having right now is that I cannot add a foreign key... Nothing seems to work (I dont need any constraints, just need the FK to work).

Also I might use some stored procedures, but I might not need to because I wont have that many complex queries.

Also will this work with PHP or am I stuck using Visual Basic.net (all I have is express on these machines)?

Also on a side note.... I have a table that can be linked to itself (sometimes the record needs to be linked to other records of the same table). My solution: Added a extra field (bool), if that field is set to true then I know that item is linked to other item(s). From there I have a other table containing the PK of the record and the PK of the other linked record. Both those two items make the PK of that table. From there I can have a item linked to multiple items. Is that the best solution? Seems like it would work, but I never did anything like this and id like to get a opinion.

This is sort of my fist time designing one of these databases on my own and its also definitely my first time using t-SQL.

Zeratulsdomain
Jan 11th, 2008, 12:37 PM
tnx for the reply.


If you are using any version of MS SQL 2005 - especially EXPRESS - then download Management Studio from MS. There is a FREE EXPRESS version.

http://www.microsoft.com/downloads/d...displaylang=en
yeah I downloaded Management Studio yesterday, couldnt install it till today for some reason. I can now connect and was able to issue basic queries so far.

You can talk to the DB/server from visual studio - but I would personally recommend against that.

I couldnt even connect the database. I am using the free vb.net 2008 express version right now, not sure if that has something to do with it. The only other time I did DB stuff in vb.net I was using the full version while using a local mdf DB.

Problem I am having right now is that I cannot add a foreign key... Nothing seems to work (I dont need any constraints, just need the FK to work).

Also I might use some stored procedures, but I might not need to because I wont have that many complex queries.

Also will this work with PHP or am I stuck using Visual Basic.net (all I have is express on these machines)?

Also on a side note.... I have a table that can be linked to itself (sometimes the record needs to be linked to other records of the same table). My solution: Added a extra field (bool), if that field is set to true then I know that item is linked to other item(s). From there I have a other table containing the PK of the record and the PK of the other linked record. Both those two items make the PK of that table. From there I can have a item linked to multiple items. Is that the best solution? Seems like it would work, but I never did anything like this and id like to get a opinion. (edit: and there is also another field in that table that can either be leased or purchased, so I used a bool to identifiy that then have two seperate tables... Is that right? (edit2: exclusive subtype entity))... I am still in design, this is my second day working on this.

This is sort of my fist time designing one of these databases on my own and its also definitely my first time using t-SQL.

Hack
Jan 11th, 2008, 12:45 PM
If you are having a problem connecting, post a question in either the database section or the VB.NET section. Connecting to a backend database is really pretty simple.

As far as the platform is concerned, if PHP allows you connect, and run SQL queries, and I'm pretty certain it does, there is no reason you can't use that.

Zeratulsdomain
Jan 11th, 2008, 12:50 PM
well I can connect right now, just not with vb.net....

but that doesnt matter... I probably wont be that far for another week if not longer (even got to write a business proposal and have it accepted).

The big problem right now is the foreign key problem...

Hack
Jan 11th, 2008, 12:56 PM
What happens when you try to add the Foreign Key?

Zeratulsdomain
Jan 11th, 2008, 01:01 PM
well I was getting errors, but only because I didnt know what I was doing... :P

I was simple not declaring the field and but trying to reference it :P I always have problem with foreign key stuff, just figured it was a MS SQL problem. That was a hour wasted :afrog:

Hack
Jan 11th, 2008, 01:10 PM
Oh, so you are saying that you figured it out, and do have your keys setup, right?

Zeratulsdomain
Jan 11th, 2008, 01:18 PM
yeah its all working, so far I only put up two tables (more as a test, because the schema could change)... but I am still worried I am not designing this as efficiant as possible.... hence my previous qusetion about the design...

I will need to present this before I really start... but I do know the people I am presenting it to do not have any big database experience so I really need to focus on the efficiancy myself.

szlamany
Jan 11th, 2008, 01:25 PM
Also on a side note.... I have a table that can be linked to itself (sometimes the record needs to be linked to other records of the same table). My solution: Added a extra field (bool), if that field is set to true then I know that item is linked to other item(s). From there I have a other table containing the PK of the record and the PK of the other linked record. Both those two items make the PK of that table. From there I can have a item linked to multiple items. Is that the best solution? Seems like it would work, but I never did anything like this and id like to get a opinion.
This thread is getting multi-topic - and you will not get people to look this far down...

At any rate - it would be nice to have "real data" describing this.

You might want to start another post in the DB forum with just that - real data and ask us about the design of the table.

I've got some ideas I can share with you...

Zeratulsdomain
Jan 14th, 2008, 11:57 AM
I made this new thread on that subject BTW: http://vbforums.com/showthread.php?t=504281

also marking this subject as resolved (edit: nm cant)

szlamany
Jan 14th, 2008, 12:12 PM
To mark this thread resolved you either EDIT the first post or using the thread tools dropdown up top