Forum Replies Created

Viewing 2 posts - 46 through 47 (of 47 total)

  • RE: GENERATE INSERT QUERY

    Hi

    don't use double codes. use single codes. You have not mentioned concatination symbol (+) for each field.

    select 'insert into sam(Id,Name,type,Email,Versionnumber)

    values(' + ''''+id+''+','+''''+Name+''''+','+ ''''+type+''''+','+''''+Email+''''+','+''''+Versionnumber+''''+ ')'

    from sam

    Thanks

    Siva Kumar J

  • RE: GENERATE INSERT QUERY

    Hi

    -- created sample table.

    create table product

    (cust varchar(25),

    product varchar(20),

    qty int)

    -- inserting sample record

    insert into product (cust,product,qty) values('KATE','SODA',6)

    -- script to generate dynamic script

    select 'insert into Product (cust,product,qty) values('+

    ''''+cust+'''' +','+''''+ product+''''+','+convert(varchar(10),qty)+')'...

Viewing 2 posts - 46 through 47 (of 47 total)