I am new to working with servers and need some help on a project that has been given to me.
I have a linux box that collects data in a comma separated file. I need to transfer the data to a remote sqlexpress server.
I have been working on this for a little while and know that the server has ASP and ASP.NET installed, also working is ODBC.
I can connect to the server using tsql command from the freetds package as follows
tsql -H server -p port -U user -P password
I am trying to automate the process so that there does not need to be any interaction selecting the file and transferring the data.
I have been trying to write a script to accomplish this but have had no success. This is what i have.
#!/usr/bin/env bash
Tsql_auth='tsql -H server -p port -U user -P password'
Tsql_insert='INESRT INTO Route_1 VALUES('
Tsql_end=') go'
$Tsql_auth
$Tsql_Insert 1,1,1,1,'Fri Aug 28 14:18:29 2009' $Tsql_end
Here is the way the test file is written
1,1,1,1,'Fri Aug 28 14:18:21 2009'
1,2,3,4,'Fri Aug 28 14:18:23 2009'
1,3,4,8,'Fri Aug 28 14:18:25 2009'
1,4,6,14,'Fri Aug 28 14:18:27 2009'
1,5,7,21,'Fri Aug 28 14:18:29 2009'
1,6,11,32,'Fri Aug 28 14:18:31 2009'
Any help that can be offered would be greatly appreciated.