Solved

Need help with an error message

Posted on 2008-10-17
3
229 Views
Last Modified: 2012-05-05
Here is the output from my messages panel when I run this query.  When I double click on the error message, it would highlight the GO right before my Delete statement.  Can anyone see what's wrong here?
GO
DELETE FROM [CtsiMembershipProduction].[dbo].CtsiApplication
      WHERE [CtsiMembershipProduction].[dbo].CtsiApplication.Id IS NULL


(201 row(s) affected)

(205 row(s) affected)

(205 row(s) affected)

(224 row(s) affected)

(224 row(s) affected)

(221 row(s) affected)

(221 row(s) affected)

(493 row(s) affected)

(493 row(s) affected)

(431 row(s) affected)
Msg 207, Level 16, State 1, Line 0
Invalid column name 'Research Interest 1'.

--And now we're ready to put it all into one big table
SELECT a.Id
	,a.MembershipLevel
	,a.ProfessionalOrganizations
	,a.Department
	,a.Gender
	,a.Ethnicity
	,a.Race
	,a.YearOfBirth
	,a.Title_id
	,a.EmailAddress
	,a.LastName
	,a.Firstname
	,a.PhoneNumber
	,a.Institution
	,a.MailingAddress
	,a.OfficeAddress
	,a.TitleOther
	,a.PhdTraineeCount
	,a.MscTraineeCount
	,a.InstitutionOther
	,a.MembershipReasonOther
	,a.RaceOther
	,a.MailingAddressLine1
	,a.MailingAddressLine2
	,a.MailingAddressCity
	,a.MailingAddressState
	,a.MailingAddressZip
	,a.CommunityOrganization
	,C.[Degree 1]
	,D.[Membership Reason 1]
	,E.[Membership Service Requirement 1]
	,F.parentId as RchChildId--child Rch id
INTO CtsiApplication
	FROM dbo.Applications a 
		INNER JOIN dbo.Temp B on a.Id = B.tempId
		FULL JOIN dbo.CtsiDegree C on a.Id = C.ApplicationId
		FULL JOIN dbo.CtsiReasons D on a.Id = D.ApplicationId
		FULL JOIN dbo.CtsiRequirement E on a.Id = E.ApplicationId
		INNER JOIN dbo.CtsiRschInterest F on a.Id = F.ApplicationId
ORDER BY a.Id
 
GO
DELETE FROM [CtsiMembershipProduction].[dbo].CtsiApplication
      WHERE [CtsiMembershipProduction].[dbo].CtsiApplication.Id IS NULL
 
--some other code before this
 
--Add the 4 Interest fields
ALTER TABLE CtsiApplication ADD [Research Interest 1] VARCHAR(50)
ALTER TABLE CtsiApplication ADD [Research Interest 2] VARCHAR(50)
ALTER TABLE CtsiApplication ADD [Research Interest 3] VARCHAR(50)
ALTER TABLE CtsiApplication ADD [Research Interest 4] VARCHAR(50)

Open in new window

0
Comment
Question by:lapucca
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 60

Expert Comment

by:Kevin Cross
ID: 22740965
Try running your different pieces of code separate and see if error is really with DELETE statement or not.

Try adding a GO statement underneath the DELETE statement as well.  This will allow the rest of the code to run even if there is an error here, again so you can verify what is really not working.
0
 

Author Comment

by:lapucca
ID: 22745464
Yes, I removed the Delete code and the code is now running.  I still Can't see that would cause the error though.
0
 
LVL 60

Accepted Solution

by:
Kevin Cross earned 500 total points
ID: 22746876
Did you run the delete code by itself?  Do you get the error?

If you did and you don't get the error, did you try adding GO after the DELETE statement in code above?
0

Featured Post

Is Your Team Achieving Their Full Potential?

74% of employees feel they are not achieving their full potential. With Linux Academy, not only will you strengthen your team's core competencies but also their knowledge of of the newest IT topics.

With new material every week, we'll make sure that you stay ahead of the game.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question