So I have a huge script file that will inset loads and loads of data into my database, here is a sample.
INSERT INTO [dbo].[SysCountry] ([country_id], [country_name]) VALUES (NEWID(), 'Argentina');
INSERT INTO [dbo].[SysCountry] ([country_id], [country_name]) VALUES (NEWID(), 'Armenia');
INSERT INTO [dbo].[SysCountry] ([country_id], [country_name]) VALUES (NEWID(), 'Aruba');
No I have 100s if not 1000s of NEWID() tags, however I need to re-use a alot of these ID's. So I want to replace all NEWID() with an actual random GUID. So the output would look like.
INSERT INTO [dbo].[SysCountry] ([country_id], [country_name]) VALUES ('42FF2BE3-D2A7-4FD1-AAA9-6AA0FDBDDD28', 'Argentina');
INSERT INTO [dbo].[SysCountry] ([country_id], [country_name]) VALUES ('59FF040C-5102-41D8-9F8B-782B42983F0E', 'Armenia');
INSERT INTO [dbo].[SysCountry] ([country_id], [country_name]) VALUES ('7589B5F1-21C0-4EF8-897E-B8C7FF8EDFA9', 'Aruba');
I am using Notepad++ to write this, so maybe if you know a Regex I can use in the Find and Replace would be great. Or if you know another way.
Thanks, Ben