26

I have some Stored procedure with "SalesTraining" schema. I want to change all SalesTraining schemas to "Sales". Is there any better way than recreating the stored procedures? thnx

enter image description here

Mikael Eriksson
  • 22,175
  • 5
  • 59
  • 103

1 Answers1

41

You can use ALTER SCHEMA (Transact-SQL) if you are on SQL Server 2005 or later.

ALTER SCHEMA Sales TRANSFER SalesTraining.MainSP;
Martin Smith
  • 84,644
  • 15
  • 245
  • 333
Mikael Eriksson
  • 22,175
  • 5
  • 59
  • 103