Re: Executing a huge sql script
Konrad Hambrick <[email protected]>
| Newsgroups | gmane.comp.db.tds.freetds |
|---|---|
| Message-ID | <062444D47005FD4EA08C8A9FFDE44B405B6CF7F0@exchange1.hostedexchange.local> |
Not to mention that each Developer can have a distinct $HOME/.freetds.conf file ... -- kjh > -----Original Message----- > From: [email protected] [mailto:[email protected]] On > Behalf Of David Chang > Sent: Monday, November 18, 2013 7:31 PM > To: [email protected] > Subject: Re: [freetds] Executing a huge sql script > > Chris, > > What configuration items are you trying to mix in the freetds.conf > file? Could you provide an example? > > I thought there were just three basic items you needed to connect to a > server: > > [SERVER_LABEL] > host = <hostname> > port = <TCP port> > tds version = <version number> > > In addition, the tds version can be put in the [global] section so you > don't have to specify it for every server. As for multiple users, so > long as you create a unique SERVER_LABEL and put all the configuration > in there, you are insulated from the the other servers as well as the > [global] section. > > DC > > On 11/18/2013 4:41 PM, Chris Kings-Lynne wrote: > > Using freetds.conf is horrible. It mixes together code-level configuration with system > root-level static files. It doesn't work when you have dozens of developers sharing a > single Vagrant environment definition, but different SQL servers. It doesn't work when > you are stamping out lots of instances in the cloud, etc. I have resorted to using > TDSPORT and TDSHOST, but I'm not yet 100% sure of what exactly the scope of setting the > environment variable is, will it conflict with multiple different database connections, > all set to only connect on demand, etc. > > > > I'm firing up a dev linux VM now to look at adding host and port settings, which I'll > try to do over time. I also need to do my own build of freetds anyway so my developers > can actually have error messages in PHP as per my first mail to this list :( > > > > Chris > > > > -----Original Message----- > > From: [email protected] [mailto:[email protected]] On > Behalf Of James K. Lowden > > Sent: Monday, 18 November 2013 1:18 PM > > To: [email protected] > > Subject: Re: [freetds] Executing a huge sql script > > > > On Sun, 17 Nov 2013 00:14:30 +0000 > > Chris Kings-Lynne <[email protected]> wrote: > > > >> Are there any plans to add host and port CLI options to bsqldb? It's > >> a severe pain having to use service definitions :( > > Hmm? Why is it more difficult to specify hostname & port once in freetds.conf than it > is to specify every time on the command line? > > > > A little-known feature: if the argument to -S is not found in freetds.conf, it is passed > to DNS for resolution. On my system, > > > > $ grep willow ~/.freetds.conf > > $ TDSDUMPCONFIG=stdout bsqldb -S willow \ < /dev/null | sed -ne '/willow/p; > /Final/,/port/p' > > config.c:170:Getting connection information for [willow]. > > config.c:468:Looking for section willow. > > config.c:288:[willow] not found. > > config.c:468:Looking for section willow. > > config.c:288:[willow] not found. > > config.c:1060:Looking for server willow.... > > config.c:195:Failed to find [willow] in configuration files; trying 'SYBASE' instead. > > config.c:209:Final connection parameters: > > config.c:210: server_name = willow > > config.c:211: server_host_name = willow > > config.c:212: ip_addr = 192.168.5.17 > > config.c:213: instance_name = MSSQLSERVER > > config.c:214: port = 1433 > > bsqldb: Msg 20009, Level 9 (OS error 61: Connection refused)Unable to > > connect: Adaptive Server is unavailable or does not exist > > > > You can control the port with TDSPORT. Or, you know, it's open source. > > > > --jkl > > > >> -----Original Message----- > >> From: [email protected] > >> [mailto:[email protected]] On Behalf Of James K. > >> Lowden Sent: Saturday, 16 November 2013 11:13 PM To: > >> [email protected] Subject: Re: [freetds] Executing a huge sql > >> script > >> > >> On Wed, 13 Nov 2013 01:19:45 +0000 > >> Chris Kings-Lynne <[email protected]> wrote: > >> > >>> I'm trying to execute a huge sql script via tsql and although it can > >>> execute from management studio, tsql just fails halfway though. > >>> There's no error, nothing. It just finishes its 10th set of 1000 > >>> inserts (with GO between) and simply chooses not to continue on with > >>> the next lot, in the same file. > >> I don't recommend tsql for that purpose; that's not its intended use. > >> tsql is primarily a diagnostic tool for testing the tds library > >> independent of the client libraries. That's why it has a bunch of > >> weird options for bypassing the configuration files, for instance. > >> > >> I can't think of a reason offhand it would fail, though. > >> > >> I recommend bsqldb for non-interactive use. The 'b' stands for > >> "batch". bsqldb will definitely report any errors and messages from > >> the server, and will exit if a server message carries a serverity > > >> 10. > >> > >> If that doesn't solve your issue, you'll need a TDSDUMP log. > >> > >> HTH. > >> > >> --jkl