Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. I have an Error message, plz help

I have an Error message, plz help

Scheduled Pinned Locked Moved Database
helpdatabasesysadmin
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    Exceter
    wrote on last edited by
    #1

    Hi, plz, help me with the following, (the code is attached) Trying to insert, I have the following message: (1 row(s) affected) Server: Msg 8152, Level 16, State 9, Procedure Trig_PUD, Line 8 String or binary data would be truncated. The statement has been terminated. the Code is: CREATE TABLE PersonalFile ( IDnum int identity(1,1) not null, PersonalFile varchar(10) not null CONSTRAINT PK_PersonalFile PRIMARY KEY ) CREATE TABLE University ( PersonalFile varchar(10) not null CONSTRAINT PK_UniversityPF PRIMARY KEY REFERENCES PersonFile, University varchar(50) not null ) CREATE TABLE Department ( PersonalFile varchar(10) not null CONSTRAINT PK_DepartmentPF PRIMARY KEY REFERENCES PersonFile, Department varchar(50) not null ) CREATE VIEW PUD AS SELECT P.PersonalFile, U.University, D.Department FROM PersonalFile P, University U, Department D WHERE (P.PersonalFile = U.PersonalFile) and (P.PersonalFile = D.PersonalFile) CREATE TRIGGER Trig_PUD ON PUD INSTEAD OF INSERT AS BEGIN INSERT INTO PersonalFile(PersonalFile) SELECT PersonalFile FROM inserted INSERT INTO University(PersonalFile,University) SELECT University, PersonalFile FROM inserted INSERT INTO Department(PersonalFile, Department) SELECT PersonalFile, Department FROM inserted END insert into PUD(PersonalFile, University, Department) values('123445', 'Univerdity1', 'Department1') Best Regards, exceter.

    E 1 Reply Last reply
    0
    • E Exceter

      Hi, plz, help me with the following, (the code is attached) Trying to insert, I have the following message: (1 row(s) affected) Server: Msg 8152, Level 16, State 9, Procedure Trig_PUD, Line 8 String or binary data would be truncated. The statement has been terminated. the Code is: CREATE TABLE PersonalFile ( IDnum int identity(1,1) not null, PersonalFile varchar(10) not null CONSTRAINT PK_PersonalFile PRIMARY KEY ) CREATE TABLE University ( PersonalFile varchar(10) not null CONSTRAINT PK_UniversityPF PRIMARY KEY REFERENCES PersonFile, University varchar(50) not null ) CREATE TABLE Department ( PersonalFile varchar(10) not null CONSTRAINT PK_DepartmentPF PRIMARY KEY REFERENCES PersonFile, Department varchar(50) not null ) CREATE VIEW PUD AS SELECT P.PersonalFile, U.University, D.Department FROM PersonalFile P, University U, Department D WHERE (P.PersonalFile = U.PersonalFile) and (P.PersonalFile = D.PersonalFile) CREATE TRIGGER Trig_PUD ON PUD INSTEAD OF INSERT AS BEGIN INSERT INTO PersonalFile(PersonalFile) SELECT PersonalFile FROM inserted INSERT INTO University(PersonalFile,University) SELECT University, PersonalFile FROM inserted INSERT INTO Department(PersonalFile, Department) SELECT PersonalFile, Department FROM inserted END insert into PUD(PersonalFile, University, Department) values('123445', 'Univerdity1', 'Department1') Best Regards, exceter.

      E Offline
      E Offline
      Exceter
      wrote on last edited by
      #2

      I found what the mistake was myself. thanx anyway. I hope you will answer my future questions. Best Regards exceter.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups