SQLServer2005/在被引用表 'tab2' 中没有与外键 'fk_tab12tab2' 中的引用列列表匹配的主键或候选键。

osgearth2.10 demo功能介绍 osgearth-2.10 demo: 说明: 1、运行环境win7 x64 旗舰版,CPU i5-6400 8核,8G内存; 2、括号内是对应demo的测试参数(.earth); 3、配置OSG_FILE_PATH; 4、参数命令行可以查看各个demo需要的输入参数; 5、前缀说明:gui界面程序、cmd控制台程序、non功能未知; 6、程序后括号里的non表示不需要通过命令行输入参数; 示例: 1、gui:osgearth_3pv(simple.earth):相机与地球的投影关系,Range表示相机 阅读详情

                      SQLServer2005/在被引用表 'tab2' 中没有与外键 'fk_tab12tab2' 中的引用列列表匹配的主键或候选键。

  这个原因是由于表2被引用的的字段不是候选键或者不是主键,说白了就是确保它是唯一的;

 CREATE TABLE tab1
( id int,
  name varchar(30)
  );
 
     CREATE TABLE tab2
  (
      name2 VARCHAR(30) 
  );
 

--将表tab2的字段name2作为tab1的外键,

  ALTER TABLE tab1 ADD CONSTRAINT fk_tab12tab2  FOREIGN KEY (name) REFERENCES tab2(name2);

 

--错误信息

/*消息 1776,级别 16,状态 0,第 1 行
在被引用表 'tab2' 中没有与外键 'fk_tab12tab2' 中的引用列列表匹配的主键或候选键。
消息 1750,级别 16,状态 0,第 1 行
无法创建约束。请参阅前面的错误消息。
*/

 

//将字段name2作为主键,如果按照如下方式建立表,那么结果通过。
  CREATE TABLE tab2
  (
      name2 VARCHAR(30) PRIMARY KEY
  );

 

--命令已成功完成。

 

//将字段name2设为唯一,

   CREATE TABLE tab2
  (
      name2 VARCHAR(30)  UNIQUE
  );

 

那么结果也是通过的。

--命令已成功完成。

 

 

 

如果要删除约束:

ALTER TABLE tab1 DROP CONSTRAINT fk_tab12tab2

SAP FICO实操:如何修改已发生业务数据的成本中心公司代码(附RKACOR06程序运行指南) 本文详细解析了SAP FICO系统中使用RKACOR06程序修改已发生业务数据的成本中心和公司代码的实操方法。通过实战案例分享,提供从前期准备到后期验证的全流程指南,帮助企业应对组织架构重组或财务核算体系调整时的数据迁移挑战,特别适用于跨公司代码的成本中心划转场景。 阅读详情

相关推荐

从零开始,用MATLAB/Simulink手把手搭建一个无刷直流电机(BLDC)的控制模型

本文详细介绍了如何使用MATLAB/Simulink从零开始搭建无刷直流电机(BLDC)控制模型。通过可视化建模方法,避开繁琐的数学推导,直接构建三相逆变器、电机本体参数化模型、霍尔传感器与换相逻辑实现,以及速度闭环控制设计。文章还提供了PID控制器整定、抗饱和处理和系统调试的实用技巧,帮助工程师快速掌握BLDC控制系统的仿真与实现。

weixin_27741699的博客 254

SQL期末复习

1.在被引用表中没有与外键中的引用列列表匹配的主键或候选键。解释 我的情况是由于在引用表中设置外键时,引用的列在被引用表中没有设置唯一性。外键通过将列加入另一个表中的唯一键来工作,该唯一键必须定义为某种形式的唯一索引,无论时主键还是其它唯一索引。 ...

肥仔的博客 2029

思科模拟器实战:MQTT协议实现物联网设备通信全流程解析

本文详细解析了如何在思科模拟器中利用MQTT协议实现物联网设备通信的全流程。通过搭建网络拓扑、配置MQTT Broker与客户端,并编写发布/订阅逻辑,手把手指导读者完成一个“开关控制电灯”的经典物联网场景实验,帮助零成本掌握物联网通信核心。

weixin_29294975的博客 382

在被引用表中没有与外键 中的引用列列表匹配的主键或候选键?

在运行SQL语句时,出现了上述错误,可能的原因之一是主键前后定义的不一致。比如说在一个表里你用学号作为主键,但在另一个表中,你的表级约束条件却写的姓名作为外码,这里只需要把两者改为一致就好啦。...

CXY_YXC的博客 2万+

CUDA系列-Stream-1

This section describes static aspects of the CUSW_UNIT_STREAM unit’s architecture.和stream相关的其它Unit主要有Channel,Sync,Memmgr A CUDA stream is a software FIFO queue that allows commands like kernel launch and memcpy to be enqueued in it. The enqueued commands

weixin_43360707的博客 734

【python】epub的电子书繁体字与简体字转换

中文繁体与简体转换

xiexianyou666的博客 3089

操作数据表常遇问题

操作数据表常遇问题 创建外键约束失败 创建外键约束时提示:在被引用表中没有与外键 ‘FKEY_ID’ 中的引用列列表匹配的主键或候选键。无法创建约束。 这是因为要引用作为外键的列不是被引用表的主键,非主键的字段不能被引用做为外键。 数据库被使用导致无法删除 删除数据库时提示:无法删除数据库,因为该数据库当前正在使用。 这是因为使用该数据时建立了连接,用后没有关闭连接,可以通过use建立其他数据库的...

wuke666666的博客 597

串级PID 位置环+速度环

串级PID 位置环+速度环

weixin_62775618的博客 9109

【已解决】在被引用表 ‘*‘ 中没有与外键 ‘FK__***‘ 中的引用列列表匹配的

在被引用表 ' 中没有与外键 ' 中的引用列列表匹配的主键或候选键。解决方案:被引用表的主键设置一下就行了。假如S表有SNO SPJ也有SNO,我SPJ的SNO要参照S的SNO,那么S表的SNO必须是主键。

执念斩长河 8345

多传感器标定:如何统一摄像头、雷达与IMU坐标?

多传感器标定:如何统一摄像头、雷达与IMU坐标?​ ,人工智能,计算机视觉,大模型,AI,本文详细阐述多传感器标定中统一摄像头、雷达与 IMU 坐标的方法。先介绍传感器坐标系统、坐标统一必要性及变换数学基础,再分述摄像头与雷达、IMU 与摄像头、IMU 与雷达的标定原理、步骤、参数计算及结果验证,还讲解了多传感器坐标统一的整体流程,分析了标定常见问题及解决办法,介绍了常用标定工具,结合实际案例说明应用,探讨了标定精度的影响因素、提升方法及发展趋势,为相关领域提供了全面的多传感器标定指导。​

不踩坑,不知道坑有多深;不总结,踩过的坑白踩。 12万+

PCL 基于强度的双边滤波【2026最新版】

基于强度信息的双边滤波代码实现、滤波前后点云未出现变化的原因以及获取带有强度pcd点云的方法。本文由优快云点云侠原创,博客长期更新,本文最近一次更新时间为:2026年5月24日。

点云侠的博客 29万+

消息 1776,级别 16,状态 0,第 1 行 在被引用表 '产品类别' 中没有与外键 'FK_leibie1' 中的引用列列表匹配的主键或候选键。 消息 1750,级别 16,状态 0,第 1 行

首先将参照列设置为唯一

zhangge360的专栏 1万+

innovus:Patch Wire(补丁线)

1)选中wire ,shift+A使用Edit Route功能,F3打开edit route对话框。线道Create Patch Wire,设置好层次和宽度。在修补一些min area的drc时,会有一些danling wire的drc冒出来,为了避免这些假错,可以使用工具patch wire功能。2)沿着选中的wire画线即可。如下图,patch wire和regular wire是能看出区别的。我正在「拾陆楼」和朋友们讨论有趣的话题,你⼀起来吧?

m0_61544122的博客 1963

在被引用表 'Student' 中没有与外键 'FK_S' 中的引用列列表匹配的主键或候选键。

sql server 在被引用表 ‘Student’ 中没有与外键 ‘FK_S’ 中的引用列列表匹配的主键或候选键。 问题原因: 可能的原因之一是主键前后定义的不一致。 或者主表没有主键 需要添加或者修改主键 删除原主键 alter table [table_name] drop primary key; 添加主键 alter table [table_name] add primary key([column_name],……); ALTER TABLE Student ALTER COLUMN

sinat_37430673的博客 1万+

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

sqlserver中 在被引用表 'A' 中没有与外键 'c2' 中的引用列列表匹配的主键或候选键

代码如下: create table ddd (     name varchar(10) not null,     age int not null,     constraint cc primary key(name,age) ) create table ccc (     gender  varchar(20) not null,     id varch

liningzheng的博客 8649

深度学习工具包 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")

在被引用表 '职工' 中没有与外键 'FK__部门__部门号__2D27B809' 中的引用列列表匹配的主键或候选键

执行语句: create table 职工 ( 职工号 smallint not null, 姓名 char(10), 年龄 smallint check(年龄<60 or 年龄=60), 职务 char(20), 工资 smallint, 部门号 char(20) not null , primary key(职工号) ); create table 部门 ( 部门号 char(20...

qq_30901083的博客 3437

锂电池充电器电路设计 里面有电路

锂电池充电器电路设计 里面有电路 3.7V升压到5V电路设计。

mysql外键定义不正确,关于sql:mysql外键约束格式错误

我有两个表,table1是具有列ID的父表,而table2是具有列IDFromTable1的父表(不是实际名称),当我在IDFromTable1中将FK放在table1中的ID上时 >我收到错误Foreign key constraint is incorrectly formed error。 如果要删除table1记录,我想删除表2记录。 谢谢你的帮助让我知道是否需要其他信息。 我是my...

weixin_36076151的博客 1401

MySQL添加外键报错:列不匹配

MySQL添加外键报错:列不匹配 报错信息 referencing column ‘xx’ and referenced column ‘xx’ in foreign key constraint ‘xx’ are incompatible 原本想将下面两个表的两个字段做外键关联,在使用Navicat过程中报不匹配的错时很蒙逼,明明类型、长度、小数点都一致 解决思路:不要停留在两者相同的表象上,单击当前行,查看详细信息 可以发现字符集和排序规则并不一致,修改一致即可插入 同理,可以从数据

weixin_43313277的博客 4003
上一篇: Qt Creator 使用QTableView来显示MySQL数据库的表
下一篇: 运行第一个Hibernate注意事项
rorger
博客等级 码龄16年 62粉丝 89原创
评论 3
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值