Link to home
Start Free TrialLog in
Avatar of amillyard
amillyardFlag for United Kingdom of Great Britain and Northern Ireland

asked on

updating sql db table, getting blanks in column data



running a test (via the executute option within vs 2008 pro) -- provides the following feedback:

Running [BackOffice].[CopyNewLeadtoDIP] ( @Title_ID = 1, @FirstNameApp1 = test, @LastNameApp1 = test, @TelHomeApp1 = 123, @TelWorkApp1 = 123, @TelMobileApp1 = 123, @EmailApp1 = test, @Address1Current = test, @Address2Current = test, @Address3Current = test, @TownCurrent = 1, @CountyCurrent = 1, @PostCodeCurrent = test, @CountryCurrent = 1, @AssignedStaffMember = 45, @MasterAccount_ID = 260934 ).

(1 row(s) affected)
(0 row(s) returned)
@RETURN_VALUE = 0
Finished running [BackOffice].[CopyNewLeadtoDIP].


where am I going wrong.

your time and efforts with this enquiry are much apprieated
ALTER PROCEDURE BackOffice.CopyNewLeadtoDIP
 
@Title_ID						int,
@FirstNameApp1					nvarchar(50),
@LastNameApp1					nvarchar(50),
@TelHomeApp1					nvarchar(50),
@TelWorkApp1					nvarchar(50),
@TelMobileApp1					nvarchar(50),
@EmailApp1						nvarchar(50),
@Address1Current				nvarchar(50),
@Address2Current				nvarchar(50),
@Address3Current				nvarchar(50),
@TownCurrent					int,
@CountyCurrent					int,
@PostCodeCurrent				nvarchar(10),
@CountryCurrent					int,
@AssignedStaffMember			int,
@MasterAccount_ID				int
 
AS
BEGIN
 
UPDATE DIPApplication SET TitleApp1 = s.Title_ID,
					      FirstNameApp1 = s.FirstName,
					      LastNameApp1 = s.LastName,
					      TelHomeApp1 = s.LandlineHome,
					      TelWorkApp1 = s.LandlineWork,
					      TelMobileApp1 = s.Mobile,
					      EmailApp1 = s.EmailAddress,
					      Address1Current = s.Address1,
					      Address2Current = s.Address2,
					      Address3Current = s.Address3,
					      TownCurrent = s.Town_ID,
					      CountyCurrent = s.County_ID,
					      PostCodeCurrent = s.PostCode,
					      CountryCurrent = s.Country_ID,
					      AssignedStaffMember = s.AssignedStaffMember
 
				   FROM DIPApplication t
					
				   INNER JOIN MasterAccounts s ON s.MasterAccount_ID = t.MasterAccount_ID
									     
				   WHERE t.MasterAccount_ID = @MasterAccount_ID
									  
END

Open in new window

SOLUTION
Avatar of Ashish Patel
Ashish Patel
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of amillyard

ASKER

the db cell has literally a 'blank' -- normally when the cell has not been used or updated yet -- there is a 'null' entry visible -- whereas when this stored procedure operates the data entry then looks blank (i.e. no text at all)
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of Aneesh
Aneesh
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Novice_Novice:

my expectation is 1 of 2

1: using the 'execute' mode within vs -- I should at teh very least get the initial variables (manually entered in order to get the stored procedure to operate)

2: used in the live environment -- should be updating with other content from other db table
asvforce:

I thoguht I had to pass those variables across -- my objective is to 'copy' a few columns from table a to table b  -- the record hook / identifier is the MasterAccount_ID which is consistent in both tables

should I have writtent the script differnetly?
Novice_Novice:  confirming that all tables within db have a primary key set, normally use   tablename_ID  format for the primary key
Further clarity:

MasterAccounts table has some basic infomation in it.

As DIPApplication table gets created -- this tables needs to copy a few columns from MasterAccounts table.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Novice_Novice:  apologies -- row  (been up all night working)
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial