Beginner Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherBeginner Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old February 7th, 2002, 01:37 PM
cool dragon's Avatar
cool dragon cool dragon is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2000
Location: England
Posts: 51 cool dragon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 32 sec
Reputation Power: 8
Question MySQL - MS SQL Server data types?

Hi

I am modelling a design in MySQL and MS SQL Server 2000 Personal Edition.

I have never really used the MS offering and I just started looking/reading up about it and have the following question regarding data type equivalents.

What is the MS SQL Equivalent of the following (from MySQL):

----

xxx INT NOT NULL AUTO_INCREMENT PRIMARY KEY,

VARCHAR(200),

LONGTEXT,

----

Thanks.

Mak.

Reply With Quote
  #2  
Old February 18th, 2002, 02:02 PM
Shiju Rajan's Avatar
Shiju Rajan Shiju Rajan is offline
.Net Developer
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2000
Location: London
Posts: 987 Shiju Rajan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 26 m 22 sec
Reputation Power: 9
Send a message via MSN to Shiju Rajan Send a message via Yahoo to Shiju Rajan

<<
xxx INT NOT NULL AUTO_INCREMENT PRIMARY KEY,

VARCHAR(200),

LONGTEXT,
>>


i think you cannot have auto incement directly in the create statement.

but you can have this:

xxx INT NOT NULL PRIMARY KEY,

you can use same varchar type in MSSQL:


VARCHAR(200),


You may use the "text" or "ntext" datatype in MSSQL instead of long text.

TEXT,

for auto increment number ,you need to create a "sequane" in sql and insert that while you issue sql statement.
__________________
SR -
webshiju.com
www.lizratechnologies.com

"The fear of the LORD is the beginning of knowledge..."

Reply With Quote
  #3  
Old February 27th, 2002, 04:12 PM
andrewl41 andrewl41 is offline
Coder Extraordinaire
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2002
Location: London
Posts: 35 andrewl41 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 47 sec
Reputation Power: 7
Try this for creating an auto incrementing PK

INT NOT NULL IDENTITY PRIMARY KEY

Optionaly you can chane the seep and increment thus:

INT NOT NULL IDENTITY(seed, increment) PRIMARY KEY

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherBeginner Programming > MySQL - MS SQL Server data types?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway