×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Data Conversion Question

Data Conversion Question

Data Conversion Question

(OP)
<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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources