I'm trying to create the stored procedues that the starter kit creates by default. I added my addtional columns and now get this error message;
System.Data.SqlClient.SqlException: Ambiguous column name 'FirstName'. Ambiguous column name 'LastName'. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) ........
Here is the stored procedure. When I delete FirstName and LastName it works just fine.
create procedure {databaseOwner}{objectQualifier}P4YS_GetContactMgr
@ModuleId int,
@ContactId int
as
select ModuleId,
ContactId,
Content,
CreatedByUser,
CreatedDate,
FirstName,
LastName,
PrimaryPhone,
SecondaryPhone,
Address,
Address2,
City,
State,
ZipCode,
Country
from {objectQualifier}P4YS_ContactMgr with (nolock)
left outer join {objectQualifier}Users on {objectQualifier}P4YS_ContactMgr.CreatedByUser = {objectQualifier}Users.UserId
where ModuleId = @ModuleId
and ContactId = @ContactId
On the P4YS_GetContactMgrs Stored Procedure I get an error "System.Data.SqlClient.SqlException: Incorrect syntax near the keyword 'as'. "
Here is that procedure:
create procedure {databaseOwner}{objectQualifier}P4YS_GetContactMgrs
@ModuleId int,
as
select ModuleId,
ContactId,
Content,
CreatedByUser,
CreatedDate,
FirstName,
LastName,
PrimaryPhone,
SecondaryPhone,
Address,
Address2,
City,
State,
ZipCode,
Country
from {objectQualifier}P4YS_ContactMgr with (nolock)
left outer join {objectQualifier}Users on {objectQualifier}P4YS_ContactMgr.CreatedByUser = {objectQualifier}Users.UserId
where ModuleId = @ModuleId
The other stored procedures Select, Add, Update, Delete all worked just fine.