Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2012 Forums
 Other SQL Server 2012 Topics
 cut and paste code from Word into ms sql server

Author  Topic 

bluesky
Starting Member

4 Posts

Posted - 2014-08-02 : 21:01:10
Is it possible to type code into a Word document and cut and paste it into ms sql server later? Will it work?
Thanks in advance for any responses.

MichaelJSQL
Constraint Violating Yak Guru

252 Posts

Posted - 2014-08-03 : 16:58:04
Yes, but the benefit of using SSMS is that it has autocomplete, templates, syntax check etc. However; if you type well formed SQL in a word doc and cut/paste - it will work
Go to Top of Page

bluesky
Starting Member

4 Posts

Posted - 2014-08-03 : 23:25:29
Thank you!
Go to Top of Page

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2014-08-03 : 23:26:33
If your word doc contains t-sql code that you want to eventually execute in sql server then you have to be careful about word replacing some characters with more high level ascii equivalents. like longer hyphens and slanted quotes. this often happens when the word document is for deployment instructions for example. The developer takes some valid t-sql and pastes it into a word doc. Then word does it's own stupid character replacement. then some unsuspecting DBA copies the code from the document and pastes it into a query window and gets syntax errors.

Be One with the Optimizer
TG
Go to Top of Page
   

- Advertisement -