sql server index 2012

how to move selected column in the  table from one server to another server with out droping constrains and indexes in sql server 2012.
kowsika deviAsked:
Who is Participating?
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.

Pawan KumarDatabase ExpertCommented:
Do you want to remove the column from the table. If yes it is not possible with dropping depending object like constrains and indexes in SQL Server.
kowsika deviAuthor Commented:
hi jj
all the tables  with selected columns copied on to a different database with the 'Select * Into...' clause from one server to another. But this statement does not transfer constraints and indexes. How do we transfer the constraints and indexes to the destination server.
Pawan KumarDatabase ExpertCommented:
Generate Scripts is the answer-

Go to  SSMS -> Choose your database -> tasks-> Generate scripts -> Next
-> Script Check Constraints to true
-> Script Indexes  to true
-> ScriptDependencies to true
-> Select the tables you need
-> next -> next ->

read more from here
Get Blueprints for Increased Customer Retention

The IT Service Excellence Tool Kit has best practices to keep your clients happy and business booming. Inside, you’ll find everything you need to increase client satisfaction and retention, become more competitive, and increase your overall success.

kowsika deviAuthor Commented:
i need selected columns alone if i use the generate scripts it comes all the column in the specified table jj. iam doing now trunctate table and selecting the columns  and inserting .  like this

if OBJECT_ID(N'LGen_ArbitrationExpenses_D', N'U') is not null
    Truncate Table LGen_ArbitrationExpenses_D;

 Insert into  LGen_ArbitrationExpenses_D  (Pk_Id,Amount,CrtdBy,CrtdDt,ExpenseDt,ExpenseType,Hdr_Fk,HearingDate,LnNo,LnNo_Fk,LstModDt,MediaName,PublicationAgainst,PublicationDt)
 select Pk_Id,Amount,CrtdBy,CrtdDt,ExpenseDt,ExpenseType,Hdr_Fk,HearingDate,LnNo,LnNo_Fk,LstModDt,MediaName,PublicationAgainst,PublicationDt  
 from [\sql12].SHRICITYUNO.dbo.LGen_ArbitrationExpenses_D  with(nolock)


is tere any way to do simple and common script jj.
Pawan KumarDatabase ExpertCommented:
No other way other than Generate Script. You can do a generate script and then remove tun unnecessary columns from the script by using find and delete.

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
kowsika deviAuthor Commented:
mmm k jj thanku
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

From novice to tech pro — start learning today.