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
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
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