SQL Server : Alter View error - no column name specified -
i trying alter view - trying provide complete new definition of select
statement runs.
my sql statement looks (i've changed cols privacy reasons):
alter view dbo.vwviewnamehere select h.batch, h.batch_name collate latin1_general_ci_as, h.serial_from, h.serial_to, h.batch_description (select batch, ltrim(rtrim(name)) collate latin1_general_ci_as batch_name, aa serial_from, bb serial_to, convert(varchar(99), batch) + ' - ' + ltrim(rtrim(name)) collate latin1_general_ci_as batch_description [ipaddress].database.dbo.tablename) h full outer join dbo.othertablename b (nolock) on ltrim(rtrim(b.batch_name)) = h.batch_name collate latin1_general_ci_as , h.serial_from = b.start_serial , h.serial_to = b.end_serial (b.batch_id null)
i've confirmed select runs correctly when run alter view statement message:
msg 4511, level 16, state 1, procedure vwviewnamehere_notimportedyet, line 3
create view or function failed because no column name specified column 2.
i ran create view
statement take backup of view definition , created no error.
you did not specify name column 2, message says. specify name:
h.batch_name collate latin1_general_ci_as batch_name
Comments
Post a Comment