To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here

HOME News MS SQL Oracle DB2 Access MySQL PHP Scripts Books Links DBA Talk


Go Back   Database Journal Forums > Miscellaneous > General Database Discussions

General Database Discussions Discuss any database topic not covered in any other forum on this site

Reply Post New Thread
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 04-09-2003, 08:06 PM
Kesper Kesper is offline
Junior Member
 
Join Date: Apr 2003
Posts: 1
Simple questions

I have some simple questions but cant seem to find the ansewer to them.

One: How do you change the date type or the datatype Length once the column is already made? With just sql querys.

Two: How do you set a primary key so every record has its own unique number?

Kesper
Reply With Quote
  #2  
Old 04-10-2003, 11:46 AM
rwendel rwendel is offline
Member
 
Join Date: Mar 2003
Location: Jacksonville, Florida
Posts: 52
Someone correct me if needed...

1)

ALTER TABLE <table>
ALTER COLUMN <field> <datatype> <additional params>
Reply With Quote
  #3  
Old 04-22-2003, 12:09 PM
YuckFou YuckFou is offline
Registered User
 
Join Date: Mar 2003
Location: London
Posts: 151
2)
If exist colum with you want make Primary Key of the table ...

ALTER TABLE <table>
ADD [CONSTRAINT <constraint name>]
PRIMARY KEY [CLUSTERED | NONCLUSTERED ] (<colname> [ASC | DESC][,<colname>...])

EXAMPLE:
ALTER TABLE aaa ADD CONSTRAINT aaa_PK PRIMARY KEY (col1)

-----
If not , first you must add column with unique values and than make ALTER TABLE...
Reply With Quote
Reply Post New Thread

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 09:25 AM.


DatabaseJournal Recent Articles


 » Preparing To Upgrade Access Tables to SQL ...

 » Microsoft Windows PowerShell and SQL Serve...

 » New MySQL Enterprise with Query Analyzer B...

 » Quest Software Strengthens Committment to ...

 » Oracle Unveils New Event-Driven Middleware...

Search Database Journal:
 





Acceptable Use Policy

JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers

Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.