Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
fresher1234
Starting Member
6 Posts |
Posted - 2010-10-26 : 13:08:41
|
| Hi,I am new to this forum.I am getting following error when execute this queryALTER VIEW [dbo].[V_ProductList]AS SELECT loanApp.dbo.Product.productId as productId, loanApp.dbo.Product.loanAppId as loanAppId, a.decode1 AS productType, loanApp.dbo.Product.amount as amount, loanApp.dbo.Product.securedInd as securedInd, b.decode1 AS purpose,tb1.borrowerFROM loanApp.dbo.Product LEFT OUTER JOIN loanApp.dbo.CodeDecode AS a ON a.tableName = 'PRODTYPE' AND a.code1 = loanApp.dbo.Product.productType LEFT OUTER JOIN loanApp.dbo.CodeDecode AS b ON b.tableName = 'PRPOFCRDT' AND b.code1 = loanApp.dbo.Product.purpose INNER JOIN (select productId,d.decode1 as borrower FROM loanApp.dbo.CustomerProductRel as f INNER JOIN loanApp.dbo.CodeDecode as d ON d.tableName='PRODROLE' AND d.code1=f.roleCode) as tbl ON loanApp.dbo.Product.productId=tb1.productId ;Error:Msg 4104, Level 16, State 1, Procedure V_ProductList, Line 2The multi-part identifier "tb1.productId" could not be bound.Msg 4104, Level 16, State 1, Procedure V_ProductList, Line 2The multi-part identifier "tb1.borrower" could not be bound. |
|
|
Kristen
Test
22859 Posts |
Posted - 2010-10-26 : 13:10:32
|
| You have alias tbL rather than tb"ONE" |
 |
|
|
fresher1234
Starting Member
6 Posts |
Posted - 2010-10-26 : 13:15:43
|
| Thanks for the reply. It solved that error. I am getting one more error.Msg 208, Level 16, State 6, Procedure V_ProductList, Line 2Invalid object name 'dbo.V_ProductList'.I do have that view under database name loanAppif i give loanApp.[dbo].[V_ProductList] i am getting this errorMsg 166, Level 15, State 1, Line 1'CREATE/ALTER VIEW' does not allow specifying the database name as a prefix to the object name. |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2010-10-26 : 13:26:31
|
| If it doesn't exist in the current database use CREATE rather than ALTERIf you want to create it in a different database switch to that database firstOtherwise post the syntax that is giving the error |
 |
|
|
fresher1234
Starting Member
6 Posts |
Posted - 2010-10-26 : 13:32:41
|
| I deleted existing view and created new one. It solved the problem. Thank you so much. |
 |
|
|
|
|
|
|
|