Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention. Check out this how-to article for more information.
create procedure sp_getviewmetadata @db_name varchar(20), @view_name varchar(20), @owner varchar(20) as declare @text varchar(1024) declare @text_line varchar(1024) declare @lines_count int declare @i int select @text = "", @i = 1 select @lines_count = count(c.text) from syscomments c, sysobjects o, sysusers u where o.id = c.id and o.uid = u.uid and o.name = @view_name and u.name = @owner create table #viewquery ( sqlquery text ) while (@i <= @lines_count) begin select @text_line = c.text from syscomments c, sysobjects o, sysusers u where o.id = c.id and o.uid = u.uid and o.name = @view_name and u.name = @owner and colid = @i if @i = 1 insert into #viewquery select @text_line else update #viewquery set sqlquery = sqlquery + convert(text, @text_line) select @i = @i + 1 end select #viewquery.sqlquery from #viewquery
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.