MdotButler
Programmer
I have a stored procedure which executes the following sequence of command.
The above code is raising the follwing error which I can't seem to get around.
If I cut the alter statements out of the code and execute them in QA with the table already defined it works as expected. Can anyone shed some light on why I am getting the error in the procedure?
TIA
Mark
Code:
DROP TABLE wk_file
CREATE TABLE [dbo].[wk_file] ([wk_data] char(1000) NULL)
DECLARE @bulk_insert varchar (500)
SET @bulk_insert='BULK INSERT wk_file FROM "C:\provlist.seq" WITH (TABLOCK)'
EXEC (@bulk_insert)
ALTER TABLE wk_file ADD wk_provid char(11) NULL DEFAULT ' '
ALTER TABLE wk_file ADD wk_lstupd char(08) NULL DEFAULT ' '
The above code is raising the follwing error which I can't seem to get around.
Code:
Server: Msg 207, Level 16, State 1, Procedure mxw_provlist, Line 40
Invalid column name 'wk_provid'.
If I cut the alter statements out of the code and execute them in QA with the table already defined it works as expected. Can anyone shed some light on why I am getting the error in the procedure?
TIA
Mark