This is a follow up question to this question:
SQL drop table and re-create and keep data
I got a table in a Graph db (inside SQL Server) for which I need to change one of its columns' name and type. Sql server said I need to drop and recreate the table for that. I used the accepted answer of the linked question to generate a query to do that. However, there is another column with a name: [$node_id_D17E19B333A445E99513686DEC9E2929]
which is used by the graph db, and the generated query is giving the error:
Invalid column name '$node_id_D17E19B333A445E99513686DEC9E2929'.
Like I said, this column already exist with this name.. How can I run the query to drop and recreate the table with the new other column's name?
An example of a line with the error:
INSERT [dbo].[ConfigsTbl] ([$node_id_D17E19B333A445E99513686DEC9E2929], [ID], [Key], [Value], [Group], [Permissions]) VALUES (N'{"type":"node","schema":"dbo","table":"ConfigsTbl","id":1512}', 1513, N'SomeId', N'SomeIdValue', 0, 3)
GO
Addition:
There is still the problem with the name, but it seems that the whole reason for telling that I need to drop and recreate the table is because the column is in the middle of the scheme. If I try to add the new column as the last one and only remove the old one from the middle there is no problem and I don't need to drop the table in that case. And yet, I do want to keep the order of the column. Hoping this information helps to understand what might cause it.