Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Data Conversion Question

Status
Not open for further replies.

azwildcat4ever

Computer
Dec 14, 2004
1
<b>Background</b>

I just added a new field Contact_Status_ID to tblContacts

Contact_Status_ID is pulling its value from tblContactStatus

Everything is working fine. I want to write a script which goes into the tblContact and assigns every contact a Contact_Status_ID value = 1 (which is "Active" as seen in Table Model below)

tblContact contains about 20,000 records.

Here is how my code looks while creating a table
Code:
<%
strSQL = "USE database " &_
		 "CREATE TABLE database.tblContactSTatus " &_
		 "(Contact_Status_ID int IDENTITY NOT NULL, " &_
         "Contact_Status nvarchar(25), "  &_
		 "Active bit)"
Response.Write strSQL
Set alterCmd = Server.CreateObject("ADODB.Command")
alterCmd.ActiveConnection = dbconn
alterCmd.CommandText = strSQL
alterCmd.Execute
Set alterCmd = nothing
Response.Write("Done")
%>

tblContactStatus looks like this:
tblContactStatus- Contact_Status_ID -int -
tblContactStatus- Contact_Status - nvarchar -
tblContactStatus- Active - bit -

tblContact looks like this

tblContacts - Contact_ID - int -
tblContacts - Last_Name - - nvarchar -
tblContacts - First_Name - - nvarchar -
tblContacts - Contact_Status_ID - - int -

Data Model for tblContactStatus

Contact_Status_ID Contact_Status Active
1 Active 1
2 Non-Active 1
3 Just-In-Time 1

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor