解决microsoft sql server error:15138的方法

sql server 2005因架构无法删除用户错误15138的解决方法 主要介绍了Microsoft SQL Server错误: 15138删除对于用户失败,数据库主体在该数据库中拥有架构,无法删除问题的解决方法,需要的朋友可以参考下 立即下载

When you drop a user in Microsoft SQL Server, an error occurs:
 
1. Drop failed for User 'fastnet(就是要删除的user名)'.  (Microsoft.SqlServer.Smo)


2. An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)


3. The database principal owns a schema in the database, and cannot be dropped. (.Net SqlClient Data Provider)
(Microsoft SQL Server, Error: 15138)

找了半天,这个msdn的方法最好

http://social.msdn.microsoft.com/Forums/en-US/sqlsecurity/thread/67ce8ae7-d47c-4515-9929-92d2a516934a

步骤很简单

假设你要删除某一数据库 的其中一个user 不是login的user用户,而是database的user 因为有schema的限制,所以你不能随便删除,删除了就会出现15138的问题,就是上面显示的。。要删除怎么办咧。。步骤如下

1、打开 数据库 选择某一个database,到 Security-》Users  *记住是database下的某一个数据库

     我这里要删除的是fastnet这个user

1

2、查看fastnet的属性,properties 看到他的schema

3、打开这个数据库的Shema ,

2  

4、 打开fastnet的 properties-》search-》Browes 查看shema

选择一个跟fastnet不同名的owner 这才是修改了 fastnet的 owner。。不然根本删不了的。。。

我就把fastnet的owner 改成了db_securityadmin这个哦。。。你再ok 回到主界面

3

最后delete fastnet用户就ok啦。。。哈哈

我可是自己截图自己 写的哦。。。居然都是英文的方法,还是自己试一试比较有用。。。

哈哈 不错不错。。

LT8711/LT8712 Type-C转HDMI设计方案|替代LT8711/LT8712芯片|GSV2201可完全替代兼容LT8711/LT8712 LT8711UX是一款高性能C/DP1.2型至HDMI2.0转换器,用于将USB Type-C源或DP1.2源连接到HDMI2.0接收器。该LT8711UX集成了一个DP1.2兼容的接收器,和一个HDMI2.0兼容的发射器。此外,还包括两个CC控制器,用于CC通信,以实现DP Alt模式和功率传输功能,一个用于上游Type-C端口和另一个用于下游端口。 阅读详情

相关推荐

告别卡顿!用U盘给你的MacBook Pro 2015+来一次macOS Monterey的‘大扫除’式安装

每次系统升级后,老款MacBook Pro用户最常抱怨的就是"怎么比之前更卡了?"——这不是错觉。系统迭代过程中积累的缓存文件、残留配置和隐形服务,就像房间角落堆积的灰尘,拖慢了整台机器的响应速度。而通过U盘进行的macOS Monterey全新安装,本质上是一次彻底的"数字大扫除":它不仅替换系统文件,还会重建所有索引、清理磁盘碎片,甚至能解决某些玄学般的卡顿问题。对于2015款及之后的MacBook Pro用户,这种安装方式能让老设备重获新生。

weixin_28731223的博客 312

SQL Server删除用户失败的解决方法

在删除SQL Server用户时,有时会报错:Microsoft SQL Server错误: 15138删除对于用户失败,数据库主体在该数据库中拥有架构,无法删除。删除 对于 用户“*****”失败。 (Microsoft.SqlServer.Smo) 。下面将为您介绍两种的解决方法。 其他信息: 执行 Transact-SQL 语句或批处理时发生了异常。 (Microsoft.SqlServ...

weixin_30882895的博客 1495

芯片设计中的复位艺术——从异步复位同步释放到复位树构建

本文深入探讨了芯片设计中复位策略的核心技术与工程实践。重点解析了异步复位同步释放这一黄金方案的原理与优势,它通过复位同步器解决了异步复位释放时的时序风险。文章进一步阐述了如何构建稳健的复位树以应对大规模SoC设计,并分析了多时钟域与低功耗场景下的复位设计挑战,为提升芯片可靠性提供了系统性的方法论。

neovim7hacker的博客 489

Microsoft SQL Server错误: 15138删除对于用户失败,数据库主体在该数据库中拥有架构,无法删除。解决方法

Microsoft SQL Server错误: 15138删除对于用户失败,数据库主体在该数据库中拥有架构,无法删除。解决方法删除 对于 用户“*****”失败。  (Microsoft.SqlServer.Smo)有关帮助信息,请单击: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.15

wonsoft的专栏 1万+

攻防世界 web高手进阶区 9分题 Web_python_flask_sql_injection

继续ctf的旅程,开始攻防世界web高手进阶区的9分题,本文是Web_python_flask_sql_injection的writeup

闵行小鱼塘 1477

一个严谨的STM32串口DMA发送&接收(1.5Mbps波特率)机制

本文描述串口DMA收/发机制设计,及STM32串口DMA收/发实现。

只要思想不滑坡,想法总比问题多。 5万+

SQL刪除数据库用户

SQL删除数据库用户

moyiying2001的博客 2769

YOLO26 数据标注工具:LabelImg、Label Studio实战指南:主流标注工具的安装配置与使用技巧,高效完成目标检测数据标注

本文介绍了目标检测中数据标注的核心地位与常用工具。数据标注质量直接影响模型性能,需要关注准确性、一致性等维度。文章详细讲解了边界框、类别标签等基本概念,并对比了LabelImg、Label Studio等主流标注工具的特点。重点介绍了LabelImg的轻量级、易用性等优势,以及Label Studio的协作功能,为不同规模项目提供标注工具选择建议。

本博客聚焦 YOLOv11 全流程落地,涵盖架构优化、数据集处理、训练技巧与多场景部署,兼及国产数据库、Java 开发与 AI 模型应用,内容兼顾理论与工程实践,为开发者提供系统干货,助力高效提升技术能力。 1178

解决“the database principal owns a schema in the database and cannot be dropped“问题

解决"the database principal owns a schema in the database and cannot be dropped"问题; 这个提示就是说明要删除的用户名下存在架构,可以执行以下两步来解决这一问题: **首先**查询该用户名下的架构: SELECT s.name FROM sys.schemas s WHERE s.principal_id= USER_ID('entradeRead2'); entradeRead2就是要删除的用户名 **然后**执行

qq_37233070的博客 2011

硬核实战!Python爬虫从0到1完整版:爬取知乎热榜+回答内容(数据去重+Excel一键导出+避坑指南,零基础友好)

✔️ 适用人群:Python爬虫零基础、想练手实战爬虫、需要爬取知乎内容做数据分析、办公/学习素材整理的同学爬取知乎热榜全量数据(排名+标题+热榜链接+热度值) →自动跟进爬取每个热榜问题的回答内容(回答者昵称+赞同数+评论数+回答正文+发布时间) →数据清洗+智能去重→一键导出格式化Excel文件,所有功能一站式完成入门级难度,无复杂反爬破解、无分布式/代理池,纯requests请求+静态解析,新手能看懂、能运行、能修改;爬取速度快,热榜+回答全程仅需几十秒。

专注于Python爬虫开发,分享爬虫技巧、项目实战与反爬经验,使用Scrapy、BeautifulSoup等工具,解决数据抓取难题。 1462

OBC_开环扫频波特图拟合操作流程(结合 Simulink)

摘要: 本文详细介绍了基于Simulink的开环扫频波特图测试与拟合流程,适用于电源/控制系统(如LLC/PFC)的小信号分析。主要内容包括:1)前期准备(测试点选择、信号范围设定);2)Simulink建模方法(信号注入、数据记录);3)两种扫频方式(逐频正弦/Chirp扫频)的实现;4)MATLAB数据处理(FFT分析、传递函数拟合);5)线性分析工具使用技巧。重点强调了激励信号幅值控制、稳态数据采集及模型验证方法,并提供完整MATLAB脚本示例。该流程可有效获取系统频域特性,为控制器设计提供可靠依据。

Sumerking的博客 234

The database principal owns a schema in the database, and cannot be dropped. (.Net SqlClient Data Pr

解决microsoft sql server error:15138的方法 http://blog.youkuaiyun.com/gray13/article/details/4458523

白马酒凉 742

Apollo 9.0 速度非线性规划算法 – piecewise jerk speed nonlinear optimizer Ⅰ

二次规划的速度规划算法(PiecewiseJerkSpeedOptimizer)的存在两个问题: 这里以一张图来说明上面的问题,假设存在一个实际限速区间(或曲率很大需要降速的区间)[S1, S2],PiecewiseJerkSpeedOptimizer的做法是根据动态规划的st曲线(黑色),找到具体的时间区间[T1, T2],然后对区间[T1, T2]内所有的点施加约束或惩罚。但是二次规划平滑后的曲线(黄色)发生了变化,那么限速区间[S1, S2]对应的时间区间[T1, T2]也发生了变化,所以实际应该是对

WaiNgai 334

SQL Server中删除用户时报错,提示:The database principal owns a schema in the database, and cannot be dropped(转载...

Description of the problem: When you tried to drop a user, you got this message: Error: 15138 The database principal owns a schema in the database, and cannot be dropped. Cause: That mea...

502

NTscan扫描工具

ntscan是一个扫描器,可以扫描没有密码和弱密码的共享,先到配置文件中填写猜测的用户名和密码,扫描过程中右侧出现的是扫描日志。

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

删除sql server用户时报15138错误

问题在删除sql server中某数据库下的用户时报15138错误,见下图 解决可用下述sql代码检查该用户的架构信息,然后逐一修正SELECT s.name FROM sys.schemas s WHERE s.principal_id = USER_ID('hzladmin');从上图可知,这7个架构都存在问题,逐一打开修正即可。按如下所示修正(双击打开架构),修改架构所有者:

HyperWang的专栏 6898

RU DOS版、EFI版32bit/64bit BIOS常用工具

DOS版、EFI版的RU工具,可用来查看IO、MEM、PCI、SMBIOS等资源。亲测在EFI SHELL下可用。

an exception occured while executing a transact-sql statement or batch

本来想从外部导入.mdf文件,结果出现这个报错。 我的原因是因为没有正确连接服务器,可以写一个“新建查询”,里面写脚本代码,然后运行一下看看是否正常运行。一定要试一下,我本来以为自己连接正常,结果试了一下报错无法启动T-SQL调试。未能连接到计算机"."。 ...

PinkAir的博客 2583

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

Transact-SQL statement or batch.

http://blog.sina.com.cn/s/blog_6e8c9a130100q84k.html 附加数据库时报错 错误信息如下 An exception occurred while executing a Transact-SQL statement or batch. 详细信息 TITLE: Microsoft SQL Serve

ccycyy的专栏 5002

Msg 15138 The database principal owns a schema in the database, and cannot be dropped.

删除用户报错:   Msg 15138, Level16, State 1, Line 1 The database principal owns a schemain the database, and cannot be dropped.   解决办法(SSMS):   1.找到用户拥有的Schema     2.在Schema中找到db_owner将Schema Ow

Kevin's Blog SQL讨论群21426959 Dynamics AX 438084988 3335

错误: 15138删除对于用户失败,数据库主体在该数据库中拥有架构,无法删除。解决方法(转)

错误: 15138删除对于用户失败,数据库主体在该数据库中拥有架构,无法删除。解决方法(转)

p15097962069的博客 261

sql server 2008出现 数据库主体在该数据库中拥有架构,无法删除。 (Microsoft SQL Server,错误: 15138)

在用sql server 2008做数据挖掘时,出现用户无法访问的问题,所以给相应的数据库添加一个登入用户zhang,并赋予相应的权限。在调试时,发现还是存在问题,故想删除这个用户zhang,并新建一个用户。出现错误提示:数据库主体在该数据库中拥有架构,无法删除。 (Microsoft SQL Server,错误: 15138).文章将给出具体的操作步骤和操作图。

张某人ER的技术博客 ==学习&&分享== 9193

因架构问题而无法删除用户的解决方法

问题现象: 在删除数据库用户(不是登录名)时报错,提示该用户在数据库中拥有架构,无法删除,错误:15138 解决方法: 1.用如下语句找出runhe这个用户拥有的所有架构 SELECT s.name FROM sys.schemas s WHERE s.principal_id = USER_ID('runhe');其中user_id的参数就是你要删除的用户名字。 2.然...

weixin_30908707的博客 206

MSMSQL:An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer...

BUG产生背景: 在将以前分离的下来的*.mdf即*.ldf恢复到数据时候,MSSQLServer总是出现如下错误提示! BUG提示信息: TITLE: Microsoft SQL Server Management Studio ------------------------------ Failed to retrieve data for this r...

dianbiaosao3462的博客 1254

sqlserver2008出现数据库主体在该数据库中拥有架构,无法删除的解决方案

当要删除数据库中的某个用户名的时候会报错 出现数据库主体在该数据库中拥有架构,无法删除的解决方案(MicrosoftSQLServer,错误:15138) 和sql server2000不同 第一:这就需要首先删除架构,之后再删除 当前数据库--》安全性--》用户,删除对应的用户 第二:执行sql命令,之后手动删除 ALTER AUTHORIZATION ON SCHE

飞哥的专栏 1万+

Drop Failed for User - Error MSSQLSERVER 15421

In a SQL Server 2005 database, I was having a hard time deleting a user I had created.I kept getting this error:The database principal owns a database role and cannot be dropped.  Msg 15421.

大勇的专栏 1562

SQLServer2008R2 附加数据库时报错 An exception occurred while executing a Transact-SQL statement or batch....

附加数据库时报错 错误信息如下 An exception occurred while executing a Transact-SQL statement or batch. 详细信息 TITLE: Microsoft SQL Server Management Studio------------------------------ Attach database failed for Ser...

weixin_30662849的博客 1329
上一篇: C#版杨辉三角形 write和writeline啊。。。
下一篇: 2010和2009年软件设计师考试大纲对比
gray13
博客等级 码龄18年 23粉丝 20原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值