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 |
|
avmreddy17
Posting Yak Master
180 Posts |
Posted - 2007-10-09 : 17:41:14
|
| Hi,I have a table T1 with three Cols.Code VARCHAR(10),INISetting TEXT,TSystem VARCHAR(10).Right now I are storing the INI Files directly in the database.I would like to move this to text files in to a SAN box and just store the Pointers in the IniSetting Column and name the text filessome thing like Code.txtWhen I do a SELECT Code , INISetting , TSystem FROM T1.I want to read the Contents as is from the Text files stored in the SAN Box?.Can some one help me with this.ThanksVenu |
|
|
rmiao
Master Smack Fu Yak Hacker
7266 Posts |
Posted - 2007-10-09 : 22:00:10
|
| You can get file path and name with select statement, then open file with dos command. |
 |
|
|
avmreddy17
Posting Yak Master
180 Posts |
Posted - 2007-10-09 : 23:08:05
|
| Currently, my INSetting Column ( TEXT Column ) has data like the format shown below. When I BCP the data out to a text file, Is it possible that I can have the same format as is. When I BCP'ed out all the data is comming in the single line. [FixDispatcher]PrimaryMachine=XX.XX.XX.XXPort=5012FirmID = 001TargetSystem=BOMSSecondaryMachine=XX.XX.XX.XXSecondaryPort=5012[DQK]Enabled = 1LCV = 10ECV = 10BCV = 10[OPTMDS_IP_SETTINGS]ABCDEF:P:XX.XX.XX.XX:7002ABCDEF:B:XX.XX.XX.XX:7002GHIJKL:P:XX.XX.XX.XX:7003GHIJKL:B:XX.XX.XX.XX:7003MNOPQR:P:XX.XX.XX.XX:7004MNOPQR:B:XX.XX.XX.XX:7004STUVWXYZ:P:XX.XX.XX.XX:7005STUVWXYZ:B:XX.XX.XX.XX:7005[MDS_IP_SETTINGS]XX.XX.XX.XX:7000XX.XX.XX.XX:7000XX.XX.XX.XX:7000XX.XX.XX.XX:7000XX.XX.XX.XX:7000[HDSDATA]Address = XX.XX.XX.XXport = 7001[FTPDownload]servername=XX.X.X.XXusername=ctospassword=zxcvbnmtargetversionfilename=version.inisourceversionfilepath=Firm215/version.initargetexefilename=CTSWS.exesourceexefilepath=Firm215/CTSWS.exebytestoread=2048autoclose=1checkversion=1Thanks |
 |
|
|
rmiao
Master Smack Fu Yak Hacker
7266 Posts |
Posted - 2007-10-09 : 23:29:15
|
| Don't think you'll get same format in bcp. |
 |
|
|
avmreddy17
Posting Yak Master
180 Posts |
Posted - 2007-10-10 : 00:00:31
|
| rmaio,I am using filesystemObject and got the required format.if I move all the INI Setting from a table to text file , Is it possible to read the text file from a Particular location in the Select Statement. Some kind of function where you pass the location of the file and it reads in the same format as give above.Thanks |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2007-10-10 : 00:16:33
|
| You can probably access a Text File using OPENROWSETSee Books Online for details.Kristen |
 |
|
|
|
|
|