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 |
mohinsoft
Starting Member
7 Posts |
Posted - 2008-03-22 : 14:54:30
|
hellomy friendsi want write Select without write filed nameexample mytable(id,name1,family) orginal selected is select id,name1 from mytable but i want write: select field[0],field[1] from my table that field[0] point to id and field[1] point to name1thanxM.O.H.I.N |
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2008-03-22 : 15:13:35
|
you mean select * from ... ?but why would you want to do that??_______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenpSSMS Add-in that does a few things: www.ssmstoolspack.com |
 |
|
mohinsoft
Starting Member
7 Posts |
Posted - 2008-03-22 : 15:30:38
|
my friend i want import special fileds data from excel to my table in sql and i dont know field name in excel therefore i want access to fields in excel without name or access via number of field and dont use from *my code is:insert into mytable(id1,name1,family) ---> {this is in sql} ' select * from OPENROWSET(' 'Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=c:\test1.xls;', 'SELECT *{problem is here} FROM [testsheet$]'{problem is here}--->i dont use * and i dont know field name i want use select field[0],field[1],field[2] from [testsheet$]M.O.H.I.N |
 |
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2008-03-22 : 15:44:14
|
nope.. you can't do what you want in this wayimport your excel into a temporary table and then insert from this temp table to your main table_______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenpSSMS Add-in that does a few things: www.ssmstoolspack.com |
 |
|
|
|
|