Solved

The multi-part identifier could not be bound??

Posted on 2011-02-18
5
623 Views
Last Modified: 2012-05-11
I am getting this error when running this update query. Can someone help me to figure out why?

ERROR: The multi-part identifier could not be bound.

Session("FileName") = File.FileName
                              
'test = (Session("FileName"))   NOT WORK
'test = "FileName.txt"   NOT WORK
test = 3   WORKS


Thanks

 Table
Session("FileName") = File.FileName
					
					'test = (Session("FileName"))
					'test = "FileName.txt"
					test = 3
					
					sSQL = "update RegWorkDetail set IsItemComplete = 1, UpFName = " & test & " where SGID = " & Session("strSGID") & " and RWID = " & Request.QueryString("RWID")
					oConn.Execute(sSQL)

Open in new window

0
Comment
Question by:Ahelbling
  • 2
  • 2
5 Comments
 
LVL 15

Accepted Solution

by:
derekkromm earned 500 total points
ID: 34928631
you need to put quotes around strings in the sql

so ...UpFName = '" & test & "' where
0
 

Author Comment

by:Ahelbling
ID: 34928651
Thanks!
0
 
LVL 51

Expert Comment

by:HainKurt
ID: 34928667
sSQL = "update RegWorkDetail set IsItemComplete = 1, UpFName = " & test & " where SGID = " & Session("strSGID") & " and RWID = " & Request.QueryString("RWID")
-->
sSQL = "update RegWorkDetail set IsItemComplete = 1, UpFName = '" & test & "' where SGID = '" & Session("strSGID") & "' and RWID = '" & Request.QueryString("RWID") & "'"

assuming Request.QueryString("RWID") & Session("strSGID") are also strings...
0
 
LVL 15

Expert Comment

by:derekkromm
ID: 34928709
Also, something to keep in mind is that if the string contains a ' it'll cause issues. So in general, you'll want to replace any ' with '' prior to concatenating the string.
0
 

Author Comment

by:Ahelbling
ID: 34928854
Got it = thanks
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

810 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