Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

create table using sql (will implement using asp)

Status
Not open for further replies.

hallm

Programmer
Jun 11, 2000
159
US
I've created a table using Microsoft access that I want to add to my online database (I just can't download and upload it every time I add a table).&nbsp;&nbsp;I was told that I could add this table using sql with an asp page.&nbsp;&nbsp;What would be the sql statement to create the following table?<br><br>Table name&nbsp;&nbsp;login<br><br>Fields<br><br>loginID&nbsp;&nbsp;&nbsp;&nbsp;autonumber&nbsp;&nbsp;&nbsp;&nbsp;indexed (no duplicates)<br>name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;text&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fieldsize&nbsp;&nbsp;&nbsp;50<br>level&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;text&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fieldsize&nbsp;&nbsp;&nbsp;50<br>username&nbsp;&nbsp;&nbsp;text&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fieldsize&nbsp;&nbsp;&nbsp;50<br>password&nbsp;&nbsp;&nbsp;text&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fieldsize&nbsp;&nbsp;&nbsp;50<br>
 
CREATE TABLE login(loginID COUNTER CONSTRAINT PriKey PRIMARY KEY , name TEXT(50),level TEXT(50) , username TEXT(50) , password TEXT(50) ) ;

Just paste the above SQL into the SQL window
of a new query. I took the liberty of making
loginID the primary key. When you save it, it
will have a new symbol, indicating that it is a
Data Definition query.

You may want to check out the link below for some
naming conventions that will make your life easier.



Hope this helps.

Keith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top