SQL Server 2012

Out IT dept built a new SQL server. I have quite a few SQL statements that I need to move to the new server.  How can I do this?
pstreAsked:
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.

Tom ChadaraviciusSenior DeveloperCommented:
Use SQL Management Studio, or Navicat for SQL server.
You say, "quite a few" - export from the old server and import into the new server.
Aneesh RetnakaranDatabase AdministratorCommented:
I am assuming you are planning to move the databases from old server to a new server. Before you start, you need to gather the login credentials, then find out what applications are using those databases and make a plan to change the connection strings, then you move the databases either taking the databases  offline, the copying the database files over and attaching them or thru a backup restore method.
Better you do this on test server first
pstreAuthor Commented:
Aneesh, I wasn't asking about the databases or the login credentials.  I am asking about SQL statements
Acronis True Image 2019 just released!

Create a reliable backup. Make sure you always have dependable copies of your data so you can restore your entire system or individual files.

Neil RussellTechnical Development LeadCommented:
As SQL Statements are pure ascii text, copy them to text files on disk on the old server and paste them from those files to the new server.

OR Do you mean that you have SQL Peocedures and/or functions compiled on the old server that you sould like to move to the new server?

More info would help us to answer.
pstreAuthor Commented:
I figured it out -- I just selected several statements at one time and did a copy and then pasted onto the other server.

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
Vikas GargAssociate Principal EngineerCommented:
HI,

If you want to copy the stored procedure / Views / functions you can right click on database and click on generate script.

Then select relevant objects and your script will be generated which you can save and run on the destination server.
pstreAuthor Commented:
I figured it out -- didn't understand the 2 answers others had given.  I selected several statements at one time, right clicked and selected copy.  I then went to the new SQL server and "pasted"
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

From novice to tech pro — start learning today.