Skip to main content
nikos101
Inspiring
August 17, 2009
Question

Is it possible to apend the id to the text being inserted.

  • August 17, 2009
  • 1 reply
  • 804 views

In ms sql if I have a primary key column of type int and auto increment 1 and another column called text.

When I do an insert is it possible to apend the id to the text being inserted.

ie

Insert in myTable values ('text' + the id of the current rows primary key )

thanks

This topic has been closed for replies.

1 reply

Inspiring
August 17, 2009

You must first convert the number to a string.  Different db's have different ways of doing that.

You might have to insert the record first and then update it.