SQL script line breaks causing errors on execution

I am using SQL Server 2008 R2 and sql scripts to export data (11000+ rows) out of one db into another due to firewall and port closures but most of the INSERT commands are broken over multiple lines and to go through them all would take hours to correct.

INSERT [dbo].[Publications] ([PublicationID], [Title], [Author1], [Author2], [Author3], [Journal], [PubYear], [Volume], [Issue], [Pages], [Number], [Abstract], [LanguageID], [BUPP], [ISSN], [CortextID], [Content1], [Content2], [PDFFile], [FullTitle], [Suboxone], [KeySuboxone], [DateCreated], [CreatedBy], [DateModified], [ModifiedBy], [Live], [Deleted]) VALUES (2, N'Myocardial Infarction associated with methadone and/or dihydrocodeine.', N'Backmund M Meyer K, Zwehl W, Nagengast O & Eichenlaub D', NULL, NULL, N'European Addiction Research', 2001, N'7', N'1', N'37-9', NULL, N'Abstract
Chest pain and myocardial infarction occurring in young people with angiographically normal coronary arteries is well documented. Opiates have a cardioprotective effect and are used in acute heart attacks. We described a 22-year-old opioid addicted male patient who suffered a myocardial infarction following the consumption of methadone and dihydrocodeine.

', 29, NULL, N'0163-4356', NULL, NULL, NULL, NULL, N'Myocardial Infarction associated with methadone and/or dihydrocodeine.', NULL, NULL, NULL, NULL, NULL, NULL, 1, 0)

Open in new window


Is there an easier way for me to correct this mistake so that my sql script does not continuously error?
swgdesignAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

the_endjinnCommented:
What is the error you are getting on execution?
0
the_endjinnCommented:
Also, a backslash \ is the line continuation character for TSQL if that is what you are after.

INSERT [dbo].[Publications] ([Publication\
ID], [Title], [Author1], [Author2]

Open in new window

0
swgdesignAuthor Commented:
Neither of those was what I was after; I actually needed to replace the erroneous carriage returns in my db table with spaces. So, I did a find and replace on my column replacing char(10) and char(13) with spaces.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
swgdesignAuthor Commented:
Found the solution myself and found out that replacing char(10) and char(13) with ' ' solved the data issue
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2008

From novice to tech pro — start learning today.