I get the following error
Missing or empty object or column name. For SELECT INTO statements, make sure each column has a name. For other statements, find empty aliases. Aliases defined as "" or [] are not allowed. Add a name or single space as the alias name.
for request below:
CREATE PROC [dbo].[Sp_Table1] @ctlg_ipt_event_id int AS SET NOCOUNT ON DECLARE @current_status NCHAR(1), @ready_status_code NCHAR(1) DECLARE @current_action NCHAR(1), @ready_action_code NCHAR(1), @done_action_code NCHAR(1) DECLARE @pst_user_id int SELECT @current_status = status_code ,@current_action = action_code ,@pst_user_id = last_mod_user_id FROM merch_ctlg_ipt_event WHERE ctlg_ipt_event_id = @ctlg_ipt_event_id Select @ready_status_code = 'o' , @ready_action_code = 'a' , @done_action_code = 'b' IF @current_status <> @ready_status_code OR @current_action <> @ready_action_code BEGIN RETURN END BEGIN TRAN declare @rows int ,@err int ,@i int ,@name nvarchar(50) --COLLATE SQL_AltDiction_Pref_CP850_CI_AS ,@resolved_View_Name_category_id int ,@xref_value int ,@availability_start_date datetime ,@availability_end_date datetime ,@status_code int ,@last_mod_user_id int ,@CT datetime ,@supplier_id int ,@View_Name_id int select @i = 1 ,@CT = current_timestamp Select Distinct mc.name, mc.resolved_View_Name_category_id, mc.xref_value, mc.availability_start_date, mc.availability_end_date, mc.status_code, CASE WHEN mc.last_mod_user_id = 42 THEN @pst_user_id ELSE mc.last_mod_user_id END as last_mod_user_id, CURRENT_tsp ,IDENTITY(int,1,1) as rn ,si.supplier_id ,si.View_Name_id into
Could you help me?
source share