General information
Forum:
Microsoft SQL Server
>If the a large VFP data with compound key have already been upsized and now resides in MSSQL but I want to create a new Identity column to use as primary key how can I assign the values for existing records? In VFP I could issue something like:
>
>REPLACE ALL newcolumn WITH RECNO()
Try...
declare @NewKey INT
set @NewKey = 1
UPDATE MyTable
SET NewField = @NewKey
,@NewKey = @NeyKey + 1
BOb
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only