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 2005 Forums
 Transact-SQL (2005)
 Create View with all the column Names

Author  Topic 

doran_doran
Posting Yak Master

179 Posts

Posted - 2009-11-03 : 15:13:19
IS creating view with
"Select * from Salestable"
or
"Select Id, SalesDate, SalePersonID, Total from SalesTable" be same?
or
DECLARE @str varchar(max)

SELECT @str = COALESCE(@str + ', ', '')+COLUMN_NAME
FROM INFORMATION_SCHEMA.Columns
WHERE TABLE_NAME = 'astronautcpddata'

SELECT @str

The reason I am asking is that I will be creating web services and will be using views, sp, etc. I know view does not take parameter therefore the last suggestion would not work. Please suggest.

Thanks

X002548
Not Just a Number

15586 Posts

Posted - 2009-11-03 : 15:16:48
so you are trying to create a view on the fly?

Explain what you're trying to do



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

doran_doran
Posting Yak Master

179 Posts

Posted - 2009-11-03 : 15:34:54
Brett, I think your previous post ([url]http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=135294[/url]) is sufficient for now. Thanks.
Go to Top of Page
   

- Advertisement -