I need to write a procedure to collect data from several remote servers, I use linkedservers and OPENQUERY to gather data from servers, but sometimes I lose connection to some servers or I simply can’t connect them (e.g. remote server is offline)- and OPENQUERY results in time-outs in these cases. So I …
Tag: sql
sql runs fast in ssms slow in asp.net
I have been having this problem for a couple of weeks now. The problem is that the query takes 4-5 minutes to run on the website and at most 2 or 3 seconds to run in ssms. Also I found that after I make a change to this query like adding the customerId variable it will start running quickly on
Rails Nested SQL Queries
I have a database model Position(lat,lon) which holds latitudes and longitudes. I have a controller action called show_close_by which recieves a position in degrees (my_lat, my_lon), a tolerance (in …
Altering column size in SQL Server
How to change the column size of the salary column in the employee table from numeric(18,0) to numeric(22,5) Answer
How to use “like” and “not like” in SQL MSAccess for the same field? [closed]
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed 5 y…
How to write an “exclusive” query in SQL?
I am going over a past paper for a database course I am taking and I am stuck on an SQL question Here is the schema provided Country(name, capital, area), name is the key People(country, population, children, adult) where country refers to the name in Country, population is the total population, and children …
How to sort values in columns and update table?
I’m completely new to sql and can’t do that myself. So I need your help. I want to sort values in column and then save changes. But I don’t know how to do that. Table looks like that: Id | Name | …
Mysql queries giving error after upgrading
why this simple query not working. I know it was OK before I upgraded my mysql version. i know there are some syntax changes in new version that I done. but this is simple query no join, but not working. Please help me. EDIT: Upgraded from mysql4 to mysql5 and error is ‘syntax error’ Answer I thin…
Create a trigger that inserts values into a new table when a column is updated
I’ve been looking at some previous answers on triggers on here but can’t find what I need exactly but I’m sure my question has been asked/answered before. I’m trying to keep track of any changes to …
MS Access – execute a saved query by name in VBA
How do I execute a saved query in MS Access 2007 in VBA? I do not want to copy and paste the SQL into VBA. I rather just execute the name of the query. This doesn’t work … VBA can’t find the query. Answer You can do it the following way: OR