sql server - SQL Import With Identity Trouble -



sql server - SQL Import With Identity Trouble -

i have database created using sql export tool, see didn't write out primary keys , constraints. unfortunately, it's re-create have data.

i've created blank database construction proper keys in place , trying import info new database using import info wizard in sql 2012. in mappings settings, i've selected enable identity insert. but, maintain running error after error.

i tried utilize sql compare tool in visual studio 2012, thinking generate alter table scripts create primary keys , constraints on database holding data, can seem generate create table scripts. obviously, doing drop table , data.

ultimately, want database keys , constraints , info together. i've exhausted knowledge , not quite sure how proceed @ point.

i'm hoping of guru's have tricks sleeve help me out. help sincerely appreciated in advance.

the "enable insert identity" works me.

perhaps next time import table identity fields can seek import identity field, how so?:

for each table import in "select source tables , views" step of wizard

select table>edit mappings > edit sql >

the code this:

create table [dbo].[mitable] ( [idfield] [int] not null, [anothercolumns] varchar ... )

modify this:

create table [dbo].[mitable] ( [idfield] [int] identity(1,1) not null, [anothercolumns] varchar ... )

don't forget enable insert identity well.

sql sql-server database compare

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -