Quantcast
Channel: SQL Server Migration forum
Viewing all 1700 articles
Browse latest View live

The entity type Identity User Login string requires a primary key to be defined

$
0
0

I tried to add migrations for a composite key in ApplicationDbContext

 public DbSet<Company> Companies { get; set; }
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Company>()
                .HasKey(c => new { c.ID, c.IssuerCode });
        }

I don't know if this is correct, when I try to Add-Migration, it runs, or tries to create a migrations but then stops with a message - 

The entity type 'IdentityUserLogin<string>' requires a primary key to be defined

I am in a new project and updated the appsettings.json file in my mvc core project, connection string to a existing database.

I had Identity selected in the new project and the old database has all the tables for identity. The table in question I assume is dbo.AspNetUserLogins has keys pK and FK so I suspect the problem isn't in the database? 

Can someone point me to the issue



In Migrating from a simple MS Access table to Azure I get Invalid object name sys.server_principals

$
0
0

Hi, I've been asked to migrate an Access db from Access 2010 to SQL on Azure. Starting small, I created a simple Name and Address Table in Access2010 in an accdb file. Then I created a db in azure so I would have somewhere to migrate to. I installed the latest SSMA and followed a couple guides found online as well as the internal SSMA guide. 

While doing the "Convert, Load and Migrate", the "Convert selected objects" step works.

In doing the "Load converted objects into the target database" I get the message:

One of the internal SQL statements failed.
Invalid object name 'sys.server_principals'.

Where does that come from and how do i get past it?

Thanks!

Will


SSMA - Data Migration of a table from Oracle to SQL Server yields "Errors: Arithmetic operation resulted in an overflow."

$
0
0

Hello,

Below is the datatype mapping for Oracle and SQL Server for the table.

ORACLE:

SQL> desc PMIS.EMP_ACC_HISTORY
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 EMP_ID                                    NOT NULL VARCHAR2(5)
 PROP_NO                                   NOT NULL VARCHAR2(30)
 MR_NO                                     NOT NULL VARCHAR2(15)
 CM_NO                                              VARCHAR2(15)
 REMARKS                                            VARCHAR2(2000)
 USER_ID                                   NOT NULL VARCHAR2(15)
 L_UPDATE                                  NOT NULL DATE
 ACC_DATE                                           DATE
 ACC_TAG                                   NOT NULL NUMBER(38)
 XLS_REMARKS                                        VARCHAR2(2000)
 ACKNOWLEDGE                                        NUMBER(38)
 LUP_BY                                             VARCHAR2(15)
 YEAR_BACK                                          VARCHAR2(4)
 LUP_DATE                                           DATE

SQL SERVER:

EXEC SP_COLUMNS EMP_ACC_HISTORY
GO

COLUMN_NAMETYPE_NAMEPRECISIONLENGTH
EMP_IDvarchar55
PROP_NOvarchar3030
MR_NOvarchar 1515
CM_NOvarchar 1515
REMARKSvarchar20002000
USER_IDvarchar1515
L_UPDATEdatetime21938
ACC_DATEdatetime21938
ACC_TAGnumeric3840
XLS_REMARKSvarchar20002000
ACKNOWLEDGEnumeric3840
LUP_BYvarchar1515
YEAR_BACKvarchar44
LUP_DATEdatetime21938

What could be causing this "Errors: Arithmetic operation resulted in an overflow." error? I already tried to change the datatypes for the numbers and dates, to no avail.

SSMA console - converting sequences.

$
0
0

Hi folks.

I'm trying to add to my SSMA XML console script some sequences.  Didn't find anything specific about sequences neither online nor in the sample files; the most significant example I found was this:

<!-- Example 4: Convert Schema  for a specific  object(say Table)
         (with only a few optional attributes & write-summary-report-to with a file name) --><!--<convert-schema object-name="$OracleSchemaName$.TestTbl"
                    object-type="Tables"
                    write-summary-report-to="$SummaryReports$\ConvertSchemaReport1.xml"
                    report-errors="true" />-->

Kind of intutive, I just have to modify the object name and its type, right?  Maybe like this: 

<convert-schema object-name="lil2019.USERDEF_COLUMN_NO_SEQ"
                    object-type="sequences" />

But then I got this error:

[2019-07-04 15:42:05]  MESSAGE generic Microsoft SSMA for Oracle v8.2.0
[2019-07-04 15:42:06] FATALERR Invalid xml file: c:\Users\martlean\Documents\Demandes\convert_oracle_sql\migrationv7\ssmaproj\Ora_to_Sql.xml. Schema Validation failed at line number 117 and position 21: attribute 'object-type' is invalid - Value 'sequences' is not valid with the datatype 'MetabaseObjectCategories'
(The message might not be 100% correct, I tried to translate it from french)


So, the example uses the value TABLES for a table but its not SEQUENCES for a sequence?  What would be the right value (or syntax) for converting sequences with the console?  Is there somewhere a full list of accepted values for object-types? 


Access Object Collector error: I have Office 365 64 bit. I have SSMA 8.2 and I am using SQL Server 2017.

$
0
0

Access Object Collector error: Database
     Retrieving the COM class factory for component with CLSID {CD7791B9-43FD-42C5-AE42-8DD2811F0419} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)). Please make sure that you are using the correct version of SQL Server Migration Assistant. If you have 32-bit Microsoft Access installed, then you will need to use 32-bit version of the Migration Assistant. In order to use 64-bit version of Migration Assistant, you will need to install 64-bit Microsoft Access components available at https://go.microsoft.com/fwlink/?linkid=834402.
     An error occurred while loading database content. 

I get this error and I'm sure I have the access version installed.  No clue why I get this error.  Please help me.  Thanks.  

Move partition DB with large number of file-group to another disk.

$
0
0

Hello,

We are in transition with a vendor to handover SQL server from their domain to our domain. While doing the health check, I found they have one 1 DB with 2200 file-group (Partition DB) and it's on C drive. DB is only 60 GB big. Now, i wanted to move the DB from C drive to dedicated SQL data drive. What would be the best way to move partition DB with such a large number of file-group? Any immediate response will be greatly appreciated.

SQL Server Data Migration

$
0
0

Hi,

In My project, i have requirement that migrate the old data into SQL database. Old Data from Access DB or from SQL DB. Have to migrate the data based on the current application structure.

In my project, we have more than one attachments for each primary record. On old system attachments are captured and save in physical folder in server. But in current system, attachments are saved in sql server database column with datatype as varchar(max)

Now my requirement is i have migrate those attachments to database. I have a .Net application which can convert the physical file into base64 string to save into the database.

From client we received the attachments which is 100+ GB in size. now i have to migrate these attachments into database. 

i have many doubts here

1. how much size sql need to for this 100+ GB files, We have Separate SQL server

2. Will it affect the application performance, how to optimize 

currently our application in running in production. Have to look for minimal changes which can be done at sql server side not in application. Need to consider this point

Thanks


SSMA to Sybase v6 Ext Pack Download

$
0
0

Hi

Does anyone have a link to:
SSMA for Sybase.6.0.0.ExtPack.exe

We are being forced by a vendor to use v6 of the tool (really have no choice) but really need the extension pack download.

Does anyone have it or can link it to me?

Many, many thanks if you can!


Migrated the SQL server 2014 to 2016.But the agent is not running even manually started ,after some inter-well it got stopped running

$
0
0

Migrated the SQL server 2014 to 2016.

But the agent is not running even manually started ,after some inter-well it got stopped running.We have changed the runningstatus to Automatic.

I have changed the AgentXps to 1 ,but agent is abruptly stopped working.

Below is the error i have.Please help me to resolve the issue.

2019-07-15 19:28:19 - ? [100] Microsoft SQLServerAgent version 13.0.4001.0 (X64 unicode retail build) : Process ID 16064

2019-07-15 19:28:19 - ? [495] The SQL Server Agent startup service account is PARADISE\administrator.

2019-07-15 19:28:19 - ! [150] SQL Server does not accept the connection (error: 0). Waiting for Sql Server to allow connections. Operation attempted was: Verify Connection On Start.

2019-07-15 19:28:49 - ! [150] SQL Server does not accept the connection (error: 0). Waiting for Sql Server to allow connections. Operation attempted was: Verify Connection On Start.

2019-07-15 19:29:19 - ! [150] SQL Server does not accept the connection (error: 0). Waiting for Sql Server to allow connections. Operation attempted was: Verify Connection On Start.

2019-07-15 19:29:49 - ! [150] SQL Server does not accept the connection (error: 0). Waiting for Sql Server to allow connections. Operation attempted was: Verify Connection On Start.

2019-07-15 19:30:19 - ! [150] SQL Server does not accept the connection (error: 0). Waiting for Sql Server to allow connections. Operation attempted was: Verify Connection On Start.

2019-07-15 19:30:19 - ! [000] Unable to connect to server '(local)'; SQLServerAgent cannot start

2019-07-15 19:30:19 - ! [165] ODBC Error: 0, Data source name not found and no default driver specified [SQLSTATE IM002]

2019-07-15 19:30:19 - ! [165] ODBC Error: 0, Data source name not found and no default driver specified [SQLSTATE IM002]

2019-07-15 19:30:19 - ! [165] ODBC Error: 0, Data source name not found and no default driver specified [SQLSTATE IM002]

2019-07-15 19:30:19 - ! [165] ODBC Error: 0, Data source name not found and no default driver specified [SQLSTATE IM002]

2019-07-15 19:30:19 - ! [165] ODBC Error: 0, Data source name not found and no default driver specified [SQLSTATE IM002]

2019-07-15 19:30:19 - ! [382] Logon to server '(local)' failed (DisableAgentXPs)

2019-07-15 19:30:19 - ? [098] SQLServerAgent terminated (normally)

SQL Server Agent Getting stopped abnormally..in 2016

$
0
0

Hi All,

SQL Agent getting Stopped abnormally even starts manually in SQLserver 2016.

I have enabled all agentxp's and Check the Service accounts ..But i could not able to get the Solution.

Please help me on this.

Temporal Table Migration from VM to Azure SQL

$
0
0
I recently migrated my SQL 2019 database from a VM into Azure SQL.
I used the MS Data Migration tool, but unfortunately, it wouldn't migrate data from Temporal Tables.

So. I just used the tool to create the table schemas and then used SSIS to move the data.  

Since my existing history table had data in it, I wanted to keep the SysStartDate and SysEndDate fields.  In order to do this, I had to disable SYSTEM_VERSIONING in my Azure SQL database as well as DROP the PERIOD on the table.

The data migration was a success so I re-created my PERIOD on the table but when I tried to enable SYSTEM_VERSIONING with a specified history table, I get the following error:

>Msg 13573, Level 16, State 0, Line 34<br>
Setting SYSTEM_VERSIONING to ON failed because history table 'xxxxxHistory'<br> contains overlapping records.

I find this odd because the existing tables were originally joined as a temporal table so I don't understand why there would be a conflict now.

    ALTER TABLE xxx.xxx 
    ADD PERIOD FOR SYSTEM_TIME(SysStartTime, SysEndTime)

    ALTER TABLE xxx.xxx 
    SET (SYSTEM_VERSIONING = ON (HISTORY_TABLE=xxx.xxxHistory))

I expect to get a successful temporal table. Instead, I get the following error: 

>Msg 13573, Level 16, State 0, Line 34<br>
Setting SYSTEM_VERSIONING to ON failed because history table 'xxxxxHistory'<br> contains overlapping records.

I ran the following query to identify the overlaps but I don't get any:

    SELECT 
    xxxxKeyNumeric
    ,SysStartTime
    ,SysEndTime
    FROM 
    xxxx.xxxxhistory o
    WHERE EXISTS
    (
        SELECT 
   
    FROM 
    xxxx.xxxxhistory o2
        WHERE 
    o2.xxxxKeyNumeric = o.xxxxKeyNumeric
    AND o2.SysStartTime <= o.SysEndTime
    AND o.SysStartTime <= o2.SysEndTime
    AND o2.xxxxPK != o.xxxxPK
    )
    ORDER BY 
    o.xxxxKeyNumeric, 
    o.SysStartTime

Temporal Table Migration from VM to Azure SQL

$
0
0
I recently migrated my SQL 2019 database from a VM into Azure SQL.
I used the MS Data Migration tool, but unfortunately, it wouldn't migrate data from Temporal Tables.

So. I just used the tool to create the table schemas and then used SSIS to move the data.  

Since my existing history table had data in it, I wanted to keep the SysStartDate and SysEndDate fields.  In order to do this, I had to disable SYSTEM_VERSIONING in my Azure SQL database as well as DROP the PERIOD on the table.

The data migration was a success so I re-created my PERIOD on the table but when I tried to enable SYSTEM_VERSIONING with a specified history table, I get the following error:

>Msg 13573, Level 16, State 0, Line 34<br>
Setting SYSTEM_VERSIONING to ON failed because history table 'xxxxxHistory'<br> contains overlapping records.

I find this odd because the existing tables were originally joined as a temporal table so I don't understand why there would be a conflict now.

    ALTER TABLE xxx.xxx 
    ADD PERIOD FOR SYSTEM_TIME(SysStartTime, SysEndTime)

    ALTER TABLE xxx.xxx 
    SET (SYSTEM_VERSIONING = ON (HISTORY_TABLE=xxx.xxxHistory))

I expect to get a successful temporal table. Instead, I get the following error: 

>Msg 13573, Level 16, State 0, Line 34<br>
Setting SYSTEM_VERSIONING to ON failed because history table 'xxxxxHistory'<br> contains overlapping records.

I ran the following query to identify the overlaps but I don't get any:

    SELECT 
    xxxxKeyNumeric
    ,SysStartTime
    ,SysEndTime
    FROM 
    xxxx.xxxxhistory o
    WHERE EXISTS
    (
        SELECT 
   
    FROM 
    xxxx.xxxxhistory o2
        WHERE 
    o2.xxxxKeyNumeric = o.xxxxKeyNumeric
    AND o2.SysStartTime <= o.SysEndTime
    AND o.SysStartTime <= o2.SysEndTime
    AND o2.xxxxPK != o.xxxxPK
    )
    ORDER BY 
    o.xxxxKeyNumeric, 
    o.SysStartTime

SQL server upgrade

$
0
0

hi Guys,

Now i am running my production system on SQL server 2014 standard edition.

size almost 10TB

planning to upgrade to 2016 or 2017 or 2019 enterprise edition

two things i needed suggestion, first is, which should i prefer to go for 2016 or 2017 or 2019 and why like stability or feedback.

second thing is, cost is not a big issue but still require additional cost differences for each of them.

i would really appreciate if info can be shared with experience or findings


SQL Server DBA

Can not resolve the collation conflict between "Latin1_General_CI_AS" and "SQL_Latin1_General_CP1_CI_AS" in the equal to operation

$
0
0

Hi,

We have upgraded from SQL Server 2008 to SQL Server 2017. But one of the application is getting below error-

Can not resolve the collation conflict between "Latin1_General_CI_AS" and "SQL_Latin1_General_CP1_CI_AS" in the equal to operation.

Please let us know the reason of the issue and solution for this.

Regards

Arif

Does Microsoft has any tool to migrate data from DB2 AS400 to SQL server 2012(Not SSIS)

$
0
0
Does Microsoft has any tool similar to SSMA for DB2 AS400.

SQL Server BPA Best Practice Advisor

SSDT database project error: SQL71561 Unresolved reference to database objects(references to other database objects that are hard coded)

$
0
0

Hi,

We are in the process of migrating 2005 dbs to 2012 and have created database projects in SSDT and have imported the databases

Upon importing the projects fail to build due to numerous errors stating Unresolved reference to database objects(these objects refer to other database objects that are hard coded in the current project code)

I have tried adding references(by generating a dacpac file through SQLPackage command line variable) and by adding the database reference(there are a lot of posts suggesting these)

But none of these solutions resolve my reference issue.

Even the below post was close to a solution but that dint work for me:

http://social.msdn.microsoft.com/Forums/sqlserver/en-US/9188b21a-c864-4edd-81f3-8befb436c363/sql71561-sql71501-errors-containshas-an-unresolved-reference-to-object?forum=ssdt

For example i get an error for this simple code for a project called Referring_Database

Create view vw_view_name

AS

select column_name from Referred_Database.dbo.referred_table

I have  added Referred_Database both through .dacpac file or explicitly as a database reference but still its showing the below error

SQL71561: View: [dbo].[vw_view_name] has an unresolved reference to object [Referred_Database].[dbo].[referred_table]

Even if we were to rewrite or remove the three part qualifier how will i go ahead as removing the database name will affect my view definition

Is there any solution to resolve this reference issue?

Thanks,

Raja

SSMA Poor Performance

$
0
0

Hi

Currently trying to migrate Sybase to SQL.

It's unbelievably slow to do this but we are not seeing any single component stressed.  The disks are bumbling around at 14MB/s (should be easily able to get to 200MB) the RAM is busy but that's just SQL and Sybase on the same box but when we scale them back we still have 64GB RAM available.  The CPU is around 20-30% in use, using sometimes 4 cores out of the 8 available.  Network seems to be using 200Mb/s when there is 40Gb available (and it should be doing this locally so no idea why the NIC is being used!)

Using latest 8.2.

Any ideas on how to improve performance and at least stress the box?

Thanks in advance.

MSDTC

$
0
0
HI, If I upgrade a mssql 2012 to 2014, the msdct running is upgraded too, or i have to do samething else

SQL Server Identity column jumps 358320 to 359195

$
0
0

We are using SQL server 2014. We have one table in that one column has Identity Column. It has jumped suddenly 358320 to  359195. We don't know what should do and we could not found figured out for this issue. Please give me answer ASAP.

Viewing all 1700 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>