exec('insert into AgentBranches ([LocationCode]) values (''CO') select * from AgentBranches where ID = scope_identity()')>
UPDATE [cman].[dbo].[dd_tables] > SET [insert_command] = exec('insert into AgentBranches ([LocationCode]) values (''CO'') select * from AgentBranches where ID = scope_identity()') > WHERE table_name = 'AgentBranches' >>My problem is, what do I surround the new string with? When I use single quotes I get an error about missing quote.
UPDATE [cman].[dbo].[dd_tables] > SET [insert_command] = replace(cast([insert_command] as varchar(500)), 'CO'')', 'CO'''')') > WHERE table_name = 'AgentBranches'Hi Frank