jaguar4u
asked on
How to read from text file in SQL Server 2005
Dear Experts,
For some reason i have to read line by line from a text file and insert that text into a trigger at a specific time everyday. Is this is possible? then How? any special privileges are required for sql user? the file path and name is fixed....
Kind Regards,
For some reason i have to read line by line from a text file and insert that text into a trigger at a specific time everyday. Is this is possible? then How? any special privileges are required for sql user? the file path and name is fixed....
Kind Regards,
Specific privileges are always required, you need a username and password and permission to access that database. Normally you will get that info from your database administrator.
ASKER
But how to read from a text file in SQL Server 2005?
I already have a username/password for database but do i need any store procedure to execute from msdb to process the text files?
I already have a username/password for database but do i need any store procedure to execute from msdb to process the text files?
Normally you have to write an external program to open the text file and send the lines to the database. I don't believe it will do it by itself.
ASKER
We can do it either by using OPENQUERY or SSIS package, but i don't have the syntax to do it using OPENROWSET....
You need to click on "Request Attention" above and get some other people and maybe some other zones for your question. I haven't used either of those packages.
Need more information to understand your problem
Are you asking to open the file to read content and insrt into database table or use the file content to create a trigger over a table?
Are you asking to open the file to read content and insrt into database table or use the file content to create a trigger over a table?
ASKER
i need to open the file to read content and insrt into database table, the contents are plain text with fixed length.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I've requested that this question be closed as follows:
Accepted answer: 0 points for jaguar4u's comment http:/Q_27410665.html#37013639
for the following reason:
Problem solved
Accepted answer: 0 points for jaguar4u's comment http:/Q_27410665.html#37013639
for the following reason:
Problem solved
ASKER
I have already found a solution and added to the question. Hence the problem is solved now so no need for question to be up.
I don't know what is the procedure of closing a question if found the answer...
Kind Regards,
Asim
I don't know what is the procedure of closing a question if found the answer...
Kind Regards,
Asim
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you for further clarification, i will use table variables and openrowset.
ASKER
There are mutiple solutions to the questioin.
ASKER
Problem can be solved with multiple solutions
ASKER
I accept what ever is suggested by community