TinyTDS Adapter default configuration: Consider using `SET ANSI DEFAULTS` ?

2017-03-03 Thread Tim Tilberg
Yesterday I was using Sequel to export some data from MS SQL Server using a bunch of sprocs. Within these sprocs were statements that create temp tables and I kept coming across: column does not allow nulls. INSERT fails.

Re: TinyTDS Adapter default configuration: Consider using `SET ANSI DEFAULTS` ?

2017-03-10 Thread Tim Tilberg
Sorry, I must have edited this little bit out: SSMS is the primary interface most people interact with SQL Server from -- so to me it would make sense to have behavior similar to what you'd find when running queries in SSMS. On Friday, March 10, 2017 at 12:04:02 PM UTC-6, Tim Tilberg wrote

Re: TinyTDS Adapter default configuration: Consider using `SET ANSI DEFAULTS` ?

2017-03-10 Thread Tim Tilberg
se SQL Server at work and have been learning Ruby the last year or two on the side. I'm starting to use it at work a lot to automate various tasks. I've really enjoyed using Sequel! On Friday, March 3, 2017 at 12:24:06 PM UTC-6, Jeremy Evans wrote: > > On Friday, March 3, 2017 at 10:18:30 A

Re: `many_to_one :model` results in a non-functioning Sequel::Model

2018-01-04 Thread Tim Tilberg
, and very much appreciated! On Thursday, January 4, 2018 at 9:28:03 AM UTC-6, Jeremy Evans wrote: > > On Thursday, January 4, 2018 at 7:23:11 AM UTC-8, Tim Tilberg wrote: >> >> I fear the answer to this question will simply be "Don't use the class >> name `Model`" -- I

`many_to_one :model` results in a non-functioning Sequel::Model

2018-01-04 Thread Tim Tilberg
I am working on a module that interacts with components of an existing database with tables: `Brand`, `Model`, `Submodel` and came across an issue while defining an association. Generally speaking, my models look like this: module COC class Brand < Sequel::Model one_to_many :models

Configure bin/sequel to use Pry as default?

2019-01-18 Thread Tim Tilberg
Hi Jeremy, would you be open to a way to configure Pry as a default `sequel` shell? I don't know what the best way to accomplish that would be, but in my copies of the gem, I usually replace IRB with Pry in `bin/sequel`. I was thinking either a configuration file somewhere, or env var, or just

Re: Configure bin/sequel to use Pry as default?

2019-01-18 Thread Tim Tilberg
wrote: >> >> On Friday, January 18, 2019 at 9:33:52 AM UTC-8, Tim Tilberg wrote: >>> >>> Hi Jeremy, would you be open to a way to configure Pry as a default >>> `sequel` shell? I don't know what the best way to accomplish that would be, >>> but in my copies o

Re: TinyTDS Adapter unexpectedly uses `varchar` instead of `nvarchar` for migrations

2019-11-21 Thread Tim Tilberg
you feel. Thanks! High five! On Tue, Nov 19, 2019 at 11:09 PM Jeremy Evans wrote: > On Tuesday, November 19, 2019 at 7:47:24 PM UTC-8, Tim Tilberg wrote: >> >> Tonight I noticed a small detail that surprised me a little bit, and I >> wanted to discuss whether it should b

Re: TinyTDS Adapter unexpectedly uses `varchar` instead of `nvarchar` for migrations

2019-11-21 Thread Tim Tilberg
on how you feel. Thanks! High five! (Reposting the deleted original because it included my email signature) On Tuesday, November 19, 2019 at 11:09:08 PM UTC-6, Jeremy Evans wrote: > > On Tuesday, November 19, 2019 at 7:47:24 PM UTC-8, Tim Tilberg wrote: >> >> Tonight I noti

TinyTDS Adapter unexpectedly uses `varchar` instead of `nvarchar` for migrations

2019-11-19 Thread Tim Tilberg
Tonight I noticed a small detail that surprised me a little bit, and I wanted to discuss whether it should be changed: When doing migrations against SQL Server using the TinyTDS adapter, the default `String` column datatype is `varchar` instead of `nvarchar`. There are several reasons this

Re: OPENQUERY causes "TinyTds::Error: Incorrect syntax near"

2020-07-10 Thread Tim Tilberg
ely* > > *@db["SET ANSI_NULLS ON;SET ANSI_WARNINGS ON;"].all* > > then execute my query > > *@db["SELECT * FROM OPENQUERY([SQL02.DEV <http://sql02.dev/>] , 'SELECT > @@version')"].all* > > > Thanks again! > > > > On Friday, Jul

Re: OPENQUERY causes "TinyTds::Error: Incorrect syntax near"

2020-07-10 Thread Tim Tilberg
Try executing `SET QUOTED_IDENTIFIERS ON` before running this query. Recent versions of Sequel included the `ansi` connection option, which causes Sequel to behave more like most other clients -- this is one of the settings it affects. If this doesn't do the trick, SQL Server uses `[]` for

Re: Are nested function calls supported in Virutal Row Blocks?

2022-02-24 Thread Tim Tilberg
Thanks for the tip! You are always Jeremy-on-the-spot! Thank you for your contributions! On Thursday, February 24, 2022 at 7:30:10 PM UTC-6 Jeremy Evans wrote: > On Thu, Feb 24, 2022 at 3:47 PM Tim Tilberg wrote: > >> Today I was scripting out some DB maintenance tasks o

Are nested function calls supported in Virutal Row Blocks?

2022-02-24 Thread Tim Tilberg
Today I was scripting out some DB maintenance tasks on SQL Server, and was leveraging a query similar to: SELECT DISTINCT create_ts FROM #{table} WHERE create_ts < DATEADD(MONTH, -2, GETDATE()) I initially thought "Hey, what does this look like with virtual row blocks, avoiding interpolation?

SQL Server index table hints using Sequel DS api?

2023-01-25 Thread Tim Tilberg
I've spent a lot of time today trying to find this out on my own but have not made progress. I'm using SQL Server and tinytds. My query optimizer is choosing a poor index for reasons yet unknown and I need to specify a table hint until this is otherwise resolved. The query I'm trying to

Re: SQL Server index table hints using Sequel DS api?

2023-01-25 Thread Tim Tilberg
Ah, thanks Jeremy! I couldn't figure out how to use `.from` without `[quoting]`. Thanks for your help, as always! On Wednesday, January 25, 2023 at 5:28:16 PM UTC-6 Jeremy Evans wrote: > On Wed, Jan 25, 2023 at 3:16 PM Tim Tilberg wrote: > >> I've spent a lot of time today tr