similar to: SQL Server - lost connection

Displaying 20 results from an estimated 90000 matches similar to: "SQL Server - lost connection"

2007 Dec 17
1
script/console connection works, but Rails app fails with SQL Server
Greetings, I have an application that connects to a remote SQL Server database using DBI/ODBC. If I run the application via the Rails console, I am able to retrieve data and work with the database just fine. If, however I try to access it via the Web application itself, I get the following error: DBI::DatabaseError (S1000 (0) [unixODBC][FreeTDS][SQL Server]Unable to connect to data source):
2008 Aug 01
1
Escaping SQL when using connection.execute?
Hi all, Here''s the situation: I''m writing a Rails app that connect to a SQL Server DB via the ODBC adapter. As an outside, non-negotiable requirement, and writes to the DB must be performed using stored procedures. (I know, I know... it sucks). When constructing the query string, how do I go about escaping the parameters I want to insert. My first thought was Rail''s
2007 Aug 15
1
can someone explain sql server performance differences?
Friends, I was wondering if any Rails/SQL Server experts could offer some help in regards to a question I had. Lately I have been getting some "timeout expired" errors in rails for some of my find_by_sql queries. When I load these pages, they often take upwards of 2-4 minutes and eventually they throw a timeout exception. When I run the exact same query in SQL Enterprise Manager, the
2007 May 26
0
What to used? Windows Authentication/SQL Server Authenticn
I just want to ask if we connect to SQL server what will be used? Windows authentication or SQL Server Authentication? I had tried Windows authentication and I was connected, however I don''t know where and how to create tables. In SQL Server Authentication it needs login name and password. I''m confused what info I will use here either my log-in name and password using my
2007 Sep 26
1
Ruby on Rails | MS SQL Server 2005 | Configuration
Request: Full description of mechanims required to intergrate current Ruby / Ruby on Rails with MS SQL Server 2005 Environment: * Ruby 1.8.6-25 (ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32]) * Rails 1.2.3 * ruby-dbi 0.1.1 (installed dbi,dbd_ADO) * OS: Windows XP Professional sp4 * MS SQL Server Express 2005 installed on local machine Background: I have used various settings for the
2006 Dec 29
4
Strange HABTM behavior against SQL Server (AR 1.14.4)
All, Win XP SQL Server 2000 Rails 1.1.6 (AR 1.14.4) I have two objects (Job and Warning) in a HABTM relationship. Below are the pertinent sections of the model files and the schema for the join table. job.rb: class Job < ActiveRecord::Base has_and_belongs_to_many :warnings, :foreign_key => ''JobReferenceNumber'' set_table_name :JobData set_primary_key
2006 Oct 19
3
Selecting datetime values from SQL Server (year < 1970)
All, Rails 1.1.6. Any AR find() call that generates a SELECT * type query against a table with a DATETIME column in SQL Server whose value occurs before 1970 will fail, because of the coercion of SQL Server datetime types to Time values in Ruby. See sqlserver_adapter.rb line 490 (record[col] = record[col].to_time if record[col].is_a? DBI::Timestamp) If I remove the coercion (just commenting
2007 Dec 19
0
Rails and SQL Server 2005, NULL String Settings
Has anyone had problems with SQL Server 2005 inserting a " " character into html text fields bound to null strings? What ANSI NULL/Padding settings are people using with rails and SQL Server? Thank You, Kevin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to
2006 Sep 07
0
Need help with accessing MS SQL Server from Mac OS X
I am trying to get access to a Microsoft SQL Server 2k installation on my network. To this point I''m not having any luck. I''ve followed the instructions at http://wiki.rubyonrails.com/rails/pages/HowtoConnectToMicrosoftSQLServerFromRailsOnOSX up to the point where you run the iodbctest where I get an error. The errors are: iODBC Demonstration program This program shows an
2008 Feb 20
0
Unicode Support for MS SQL Server
In order to coerce Rails 1.2.x into supporting Unicode values for an attribute in a model, I found I had to do the following: 1) Change the underlying column type from varchar to nvarchar. 2) Prepend any quoted values going into nvarchar columns with a capital-letter-N, e. g. ''unicode'' becomes N''unicode'' In order to accomplish this, I modified
2007 Dec 13
3
run sql query ?
hi i''ve got one action which i want it to perform a sql update query. how can i just run a sql query within my rails app? e.g. def @sql = "update ...... from mytable" execute @sql redirect_to :action => ''list'' end any ideas? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message
2006 Nov 06
2
Eager Finder SQL
Hi, I just uploaded a Rails plugin that allows you to specify custom SQL when doing a find with associations (AKA eager loading). One of the problems I encountered when implementing the Chacha Underground (http://underground.chacha.com) was being able to use queries provided by the DBA to efficiently get all the informaion I needed to render a page. In some cases, I needed to go two or three
2008 Oct 29
2
SQL in rails
Hi all...... please give me an example that use SQL in models to handel data in the data base. with "sql.execute" or any other possible way.. thankx --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to
2006 Nov 12
2
Model-less SQL results
I''m trying to get some stats from my database about my model, and I''m not sure how to go about it. If I have a model ''foo'' that has an attribute ''color'' and I want to get some counts on this I could use the sql: SELECT color, COUNT(*) AS count FROM items GROUP BY status which would return something like: +--------+-------+ | color |
2006 Sep 25
1
ActiveRecord instead of direct sql execution
Hi all, I have 2 tables and a standard one-to-many association. How do I substitute the following sql with ActiveRecord calls so that it uses just one sql statement: update geo_entities set terminal_id = 3 where id = 10 or id = 23 or id = 87; Thank you! Regards, Yuri Leikind --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to
2006 Oct 23
1
find method use without sql in mind
I have a class Day with field date that represents a my sql date type, YYYY-MM-DD. The Ruby type Date class has method, cweek, that returns the calendar week that corresponds to a particular date. Ruby knows cweek, but MySQL has no knowledge of this value. How do I run a find on class Day, (Day.find :all ... ) with condition [date.cweek = ?, week]? This is not a sql search but a Ruby
2009 Mar 03
2
Passing an SQL fragment in AR save
I have a basic model class TestTime with no customization. class TestTime < ActiveRecord::Base end I would like to pass the following SQL fragment as part of an AR save call to TestTime objects. How and where would I do this in the model? "set c_time=current_time" (current_time is an SQL method, not a variable). -- Posted via http://www.ruby-forum.com/.
2008 Jul 18
2
ActiveRecord: SQL IN operator
I want to use an array in the :conditions of an ActiveRecord Find so that a SQL IN statement is created. However, I also want to specify a greater than condition on a timestamp column too. From the Docs: An array may be used in the hash to use the SQL IN operator: Student.find(:all, :conditions => { :grade => [9,11,12] }) How do I modify this so that it also contains the timestamp
2008 Jan 01
2
Easiest defense against SQL injection in object creation?
I''ve been scouring the web for suggested Rails defenses against SQL injection, but I haven''t found much on the object creation part. Certainly using attr_protected, etc., is a good way to prevent unwanted fields from being modified on the new object (if you''re passing a hash as creation parameters), but what about escaping the POSTed info before saving? Couldn''t
2008 Jul 08
6
Show SQL request without issuing it
Hi all, I saw that some object.save is causing the SQL request to crash, but I don''t see the SQL request in the logs (only ruby code that''s showing an error during the .save method). Is there any way to show the SQL request before it''s issued to the database ? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received