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 |
|
shapper
Constraint Violating Yak Guru
450 Posts |
Posted - 2007-09-25 : 08:01:03
|
| Hello,Can a SELECT return records and give that table a name?So instead of, in my C# code, the tables in the dataset get an index (0,1,2, ...) will get a name (TableA, TableB, ...)Thanks,Miguel |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-09-25 : 08:12:50
|
| Not sure if you want thisSelect table_name from information_schema.tablesMadhivananFailing to plan is Planning to fail |
 |
|
|
aravindt77
Posting Yak Master
120 Posts |
Posted - 2007-09-25 : 08:16:24
|
| Hi,SELECT col1, col2....., '<Table Name>' AS TableName fROM [TABLE]ARD |
 |
|
|
DonAtWork
Master Smack Fu Yak Hacker
2167 Posts |
Posted - 2007-09-25 : 12:48:13
|
| He wants it in the C# code. You can name the tables in C#. Look at your data adapter, or whatever you are using. Its there in the help file.[Signature]For fast help, follow this link:http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspxLearn SQLhttp://www.sql-tutorial.net/ http://www.firstsql.com/tutor.htm http://www.w3schools.com/sql/default.asp |
 |
|
|
shapper
Constraint Violating Yak Guru
450 Posts |
Posted - 2007-09-25 : 13:06:08
|
| I wanted in SQL not in C#.I know how to do it in C#.Thanks,Miguel |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2007-09-25 : 13:09:27
|
| You need to make your problem more clear then.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
 |
|
|
|
|
|
|
|