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.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2003-12-12 : 08:32:05
|
| sireesha writes "how can we return entire column data a of a query using funtionsex:create function func(@tname nvarchar(128))returns nvarchar(128)asbeginselect column_name from information_schema.columnswhere table_name = @tnamereturn column_name --return entire column valuesend " |
|
|
ehorn
Master Smack Fu Yak Hacker
1632 Posts |
Posted - 2003-12-12 : 09:05:57
|
| [code]create function dbo.func (@tname nvarchar(128))returns @t table (tablename nvarchar(128), columnname nvarchar(128) )asbegin insert into @t select @tname,column_name from information_schema.columns where table_name = @tnamereturn endgoselect * from dbo.func('TABLES')godrop function dbo.func[/code] |
 |
|
|
|
|
|