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 2000 Forums
 SQL Server Development (2000)
 comma separated file

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

Go to Top of Page

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.......
Go to Top of Page

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.
Go to Top of Page

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...
Go to Top of Page

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
Go to Top of Page

sqldba2k6
Posting Yak Master

176 Posts

Posted - 2007-05-15 : 21:26:33
I can't get permissions....
Go to Top of Page

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

Go to Top of Page

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.
Go to Top of Page

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
Go to Top of Page
   

- Advertisement -