On Aug 31, 4:02 am, JCP <J...@discussions.microsoft.com> wrote:
> 1. Because if I do modifications in a table, the columns views doesn't match
> to columns tables.
> If I drop and re-creat with the SP resolve this issue.
>
> 2. With this procedure I can store the views in a table (not temp) If I do a
> mistake or if I'm testing, from table views I can put the original views back
>
> 3. I I want encription, from the table where I keep de views, I can drop the
> existing views and create new encrypted views.
>
> Probably, already exist a sp to do this, but I don't know.
> Do you know any solution to resolve my questions?
>
> I would like to do the same for functions and SP
> Thanks
>
> --
> Jose
>
> "Erland Sommarskog" wrote:
> > JCP (J...@discussions.microsoft.com) writes:
> > > I'm using the store procedure below to drop and recreate all my views.
> > > It works fine if the string is <=4000 char.
> > > I tried to change data type for @text parameter from nvarchar(4000) to
> > > varchar(8000) but the error still occur.
>
> > > Question.
> > > How can I do to refresh (drop and re-recreate) all views including with
> > > strings upper 4000 characters?
> > > What is wrong in my store procedure?
>
> > The problem is that if the definition is more than 4000 characters, it
> > is split over several rows in syscomments.
>
> > But the real question, why do you do this at all? What's wrong with
> > sp_refreshview?
>
> > --
> > Erland Sommarskog, SQL Server MVP, esq...@sommarskog.se
>
> > Books Online for SQL Server 2005 at
> >
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books... > > Books Online for SQL Server 2000 at
> >
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx