Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 dynamic views

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-08-17 : 00:30:17
AK writes "
I've created a view of all tables in a database beginning with 'DB'. The view is created using a stored procedure with the database name passed as a parameter.

Fieldnames and Tablenames are extracted from sysobjects and syscolumns and joined using a common variable. Using this info. the code is created as string @sql and submitted using exec 'sp_executesql @sql'. @sql is therefore limited to nvarchar(4000).

1) Is there a better way of doing this?
2) I have now reached the 4000 limit - what can I do?

Please explain in laymans terms as I'm new to this goddam thing.

AK

"
   

- Advertisement -