| Author |
Topic |
|
sqldba2k6
Posting Yak Master
176 Posts |
Posted - 2007-05-15 : 10:57:23
|
| Please help me in writing a sql scripts which it should pull the comma seperated text file.. from one single table.. |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-05-15 : 11:21:36
|
please check out BCP, BULK INSERT, DTS etc. KH |
 |
|
|
sqldba2k6
Posting Yak Master
176 Posts |
Posted - 2007-05-15 : 13:04:43
|
| I want to write a sql query.Without using BCP,Bulk Insert,DTS....... |
 |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2007-05-15 : 13:21:13
|
| t-sql has no means to access anything external to sql server except things like bulk inser if you consider that t-sql.You will need to use something - I would suggest bcp via xp_cmdshell as the easiest to create a file.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
sqldba2k6
Posting Yak Master
176 Posts |
Posted - 2007-05-15 : 19:33:30
|
| Nr it would be easy bcp but unfortunately i have restrictions on access permissions..Do yu have any other alternative suggestions... |
 |
|
|
Jeff Moden
Aged Yak Warrior
652 Posts |
Posted - 2007-05-15 : 19:53:47
|
| Ask for the "Bulk Insert Administrators" role and use BULK INSERT.--Jeff Moden |
 |
|
|
sqldba2k6
Posting Yak Master
176 Posts |
Posted - 2007-05-15 : 21:26:33
|
| I can't get permissions.... |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-05-15 : 22:01:22
|
quote: Originally posted by sqldba2k6 I can't get permissions....
You do have select permission to the table ? Write a front end application to do it KH |
 |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2007-05-16 : 06:01:39
|
| First ask if your application can have permission on the file and database.You need to find out what you are alowed to do as it sounds like access to the file system is restricted so this will not be possible.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
Jeff Moden
Aged Yak Warrior
652 Posts |
Posted - 2007-05-17 : 01:17:49
|
| If you can't get BULK INSERT ADMINISTRATORS permissions, you definately won't be able to get the SA privs required to use xp_CmdShell. You can try OPENDATASOURCE. Look that up in BOL. If that doesn't work, a batch job using BCP (from the command prompt) might just do the trick for you... still might need some extra privs but I don't think so.My real thought is they give you a task and then tie you up with duct tape so you can't do the task... I'd say your next job is to find a new one.--Jeff Moden |
 |
|
|
|