小编Mik*_*Mik的帖子

在 Powershell 中使用 Backup-SqlDatabase 时出现“TypeData 错误”错误

由于错误,我无法运行 Backup-SqlDatabase。我得到以下信息:

PS C:\Users\Mik> Backup-SqlDatabase
Backup-SqlDatabase : The 'Backup-SqlDatabase' command was found in the module 'SqlServer', but the module could not be
loaded. For more information, run 'Import-Module SqlServer'.
At line:1 char:1
+ Backup-SqlDatabase
+ ~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Backup-SqlDatabase:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CouldNotAutoloadMatchingModule
Run Code Online (Sandbox Code Playgroud)

我按照建议运行 Import-Module 并得到:

PS C:\Users\Mik> Import-Module SqlServer
Import-Module : The following error occurred while loading the extended type data file: Error in TypeData
"Microsoft.SqlServer.Management.Smo.NamedSmoObject": The member DefaultKeyPropertySet is already present.
Error in TypeData …
Run Code Online (Sandbox Code Playgroud)

sql-server powershell sqlps

4
推荐指数
1
解决办法
6679
查看次数

标签 统计

powershell ×1

sql-server ×1

sqlps ×1