Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2003
    Location
    SA
    Posts
    25

    Unanswered: Very weird issue

    Hi
    I hope I dont sound to daft when I ask the following question.
    This my SelectInsert code which generates insert statements for the data for a table. Its for creating scripts for the data of the table.

    SELECT 'INSERT INTO TableA(Name, Comments, Contact,Description, Country_ID,Tel1, Fax, Email_Address, Addr1, Addr2, City, County, Postal_Code) values
    ('''+ Surname + ''', '''+ rtrim(convert(varchar(100),Comments)) + ''','''+ Contact1 + ' ' + Contact2 + ''', '''+ 'Customer' + ''', '''+ '2' + ''', ''' + rtrim(Telephone) + ''', ''' + Fax + ''', ''' + Email_Address + ''',
    ''' + rtrim(Address1) + ''', ''' + rtrim(Address2) + ''', ''' + rtrim(Address3) + ''', ''' + rtrim(Address4) + ''',
    '''+ Postcode + ''');'
    FROM TableB

    When I run this sql statement, only the first 9 field get populated with data.
    My question is that can one only include 9 fields for such sql statement. Is there a deafult number fields that can be inserted in such code. Cos when I remove fields after the 9 th field, all the data gets inserted.

    Any clues or suggestions wouls be greatly appreciated.
    Ta
    Nimisha

  2. #2
    Join Date
    Apr 2003
    Posts
    18

    Re: Very weird issue

    Hi Nimisha,

    Its working fine at my end.

    Cheers
    gola
    Originally posted by Nimisha
    Hi
    I hope I dont sound to daft when I ask the following question.
    This my SelectInsert code which generates insert statements for the data for a table. Its for creating scripts for the data of the table.

    SELECT 'INSERT INTO TableA(Name, Comments, Contact,Description, Country_ID,Tel1, Fax, Email_Address, Addr1, Addr2, City, County, Postal_Code) values
    ('''+ Surname + ''', '''+ rtrim(convert(varchar(100),Comments)) + ''','''+ Contact1 + ' ' + Contact2 + ''', '''+ 'Customer' + ''', '''+ '2' + ''', ''' + rtrim(Telephone) + ''', ''' + Fax + ''', ''' + Email_Address + ''',
    ''' + rtrim(Address1) + ''', ''' + rtrim(Address2) + ''', ''' + rtrim(Address3) + ''', ''' + rtrim(Address4) + ''',
    '''+ Postcode + ''');'
    FROM TableB

    When I run this sql statement, only the first 9 field get populated with data.
    My question is that can one only include 9 fields for such sql statement. Is there a deafult number fields that can be inserted in such code. Cos when I remove fields after the 9 th field, all the data gets inserted.

    Any clues or suggestions wouls be greatly appreciated.
    Ta
    Nimisha

  3. #3
    Join Date
    Mar 2003
    Location
    SA
    Posts
    25

    Re: Very weird issue

    Originally posted by golamunjal
    Hi Nimisha,

    Its working fine at my end.

    Cheers
    gola
    Hi

    The issue was that I needede to change the column size in the Query analyzer which was set to its default value of 256 characters.
    Ta
    Nimisha

Posting Permissions

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