Select to view content in your preferred language

How I can shift non-spatial tables into enterperise geodatabase without changing primary key and foreignkeys in sql server?

09-25-2017 08:33 AM
Occasional Contributor

Hello everyone, i have two database in sql server 2012. One is enzerprise geodatabase and another is a simple attribute datase. Now i need to shift all the tables of attribute db to geodatabase. I have tried in several ways without changing the Key fields, but i am facing some troubles regarding OBJECTID, Date data type and primary keys and foreign key are not generating. How I can shift all the tables data and schema together?

Already I have shifted tables but there are no pk and fk inside and I cannot avoiding making OBJECTID instead of ID fields (only if I just drag and drop table into geodatabase in arcgis- but those table has not any id will make a objectid). The other problem is no tables now has Date type. I know about datetime2 data type and now i am making newly inside geodatabase new tables, but is it the only solution?



0 Kudos
1 Reply
MVP Regular Contributor

Try using 'Generate Scripts' followed by 'SQL Server Import and Export Wizard'...

SQL Server Data Import – How To Preserve Primary Keys and Identity Fields | Williamsport Web Develop... 

How to import tables without losing indexes and keys in SQL Server 2008 - Stack Overflow 

This is actually a question for the Microsoft Forums more than an Esri forum...

0 Kudos