I have an Identity (AutoNumber) column in SQL that I need to use in an UPDATE statement, but I can't figure out how to use it combined with other text. This has been simplified.
Table1(ID, Col1)
Code:
INSERT INTO Table1 (Col1) Values ('temp'); UPDATE Table1 Set Col1='Display.aspx?ID=@@IDENTITY'
This works fine if I just Set Col1=@@IDENTITY. If the Identity is 5 then I'd like for Col1 to show Display.aspx?ID=5. Anyone know how to do this?
Table1(ID, Col1)
Code:
INSERT INTO Table1 (Col1) Values ('temp'); UPDATE Table1 Set Col1='Display.aspx?ID=@@IDENTITY'
This works fine if I just Set Col1=@@IDENTITY. If the Identity is 5 then I'd like for Col1 to show Display.aspx?ID=5. Anyone know how to do this?