sql插入查询错误 [英] sql insert query error

查看:76
本文介绍了sql插入查询错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,



hello ,

CREATE TABLE [dbo].[tb_mst_Attachement](
    [MessageId_int] [int] NULL,
    [Document_nvarchar] [nvarchar](50) ,
    [ImagePath] [nvarchar](max)
)


CREATE TABLE [dbo].[tb_mst_Message](
    [MessageId_int] [int] IDENTITY(1,1) NOT NULL,
    [Subject_nvarchar] [nvarchar](max) COLLATE Latin1_General_CI_AI NULL,
    [Message_nvarchar] [nvarchar](max) COLLATE Latin1_General_CI_AI NULL,
    [IsAttachment] [int] NULL,
)


insert into tb_mst_Message ( SenderId_int, ReceiverId_int, Subject_nvarchar )values (101,202,'hii')

insert into tb_mst_Attachement values((select max(MessageId_int) from tb_mst_Message),'hi','how r u')



in my最后一个querry有一个错误,所以请告诉我为此目的正确的querry



谢谢&问候

Srishti


in my last querry there is an error so plz tell me correct querry for this purpose

Thanks & Regards
Srishti

推荐答案

人们在回答时讨论问题而不发布答案是什么?您需要阅读错误消息,它们意味着他们所说的内容。您命名的列不存在。错误是正确的。
What is it with people discussing questions and not posting answers when they answer ? You need to read your error messages, they mean what they say. The columns you are naming, do not exist. The error is correct.


这篇关于sql插入查询错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆