SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: MS SQL Server

  1. #1
    SitePoint Wizard
    Join Date
    Apr 2000
    Posts
    1,483
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    I am trying to insert records into an SQLServer database from an ASP page. I have the code to update existing records, but the code for Inserting doesn't work.
    I am trying to insert using the INSERT INTO SQL Statement.
    When I run the query, there is an error that x is invalid data for the field. If I try to insert numbers that works fine. Also, if I make it with numbers then UPDATE it so that it uses letters it also works fine. The data type is nvarchar.
    Sorry if that sounds a bit confusing...I am a bit confused myself!!
    Thanks in advance!


  2. #2
    SitePoint Wizard edshuck's Avatar
    Join Date
    Jul 2000
    Posts
    1,200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi

    i do not know anything about ms sql but in the mysql commands, when i am doing an update to a cell i usually try

    update tablename
    set colname='newdata'
    where otheruniquecolname='existingdata';

    the caution here is that on one occasion, and you only mess this up once, i did not use the where limiter and changed one column for 350 rows of data.

    if you have MySql by duBois this command string is shown on page 70. it is most useful and very unforgiving.

    sorry i do not know ms sql but hope this helps.

    peace and best to all - ed

  3. #3
    SitePoint Wizard
    Join Date
    Apr 2000
    Posts
    1,483
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Come on...surely someone must know???

  4. #4
    SitePoint Member
    Join Date
    Jul 2000
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    James, can you send the script (both insert and update) to me or post it in this thread? I'll try to take a look at it.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •