How can I store the result of a SQL query in a CSV file using Squirrel?
Version 3.0.3. It's a fairly large result-set, around 3 million rows. ...
Version 3.0.3. It's a fairly large result-set, around 3 million rows. ...
Good afternoon everybody, I am in a bit over my head and facing some tight deadlines, so hopefully someone can offer some advice. My starting point will be a table in a SQL Server database, two of whose fields are x,y coordinates obtained from a gps unit. I will be responsible for geocoding (getting physical street address) these loca...
What is the best way to access sql server from python is it DB-API ? Also could someone provide a such code using the DB-API how to connect to sql server from python and excute query ? ...
I have a SQL Server 2008 database with records like the following 001 CAT 1 2 3 002 DOG 3 3 1 003 DOG 2 1 1 004 DOG 2 1 3 005 CAT 1 3 4 I want to take 1 row for each unique value in column 2 (cat and dog) so this would get me (one possible answer): 001 CAT 1 2 3 002 DOG 3 3 1 Column 1 is the PK and is a string. Column 2 is a stri...
Is it possible to work with the returned datasets from a stored procedure? Basically I have a stored procedure (lets call it SP_1) and it calls another stored procedure (lets call it SP_2). SP_2 has 5 or so select statements. What I want to do is handle each select statement within SP_1. Basically to manipulate the data or whatever, but ...
Total newbie here, regarding sqlite, so don't flame too hard :) I have a table: index name length L breadth B height H 1 M-1234 10 5 2 2 M-2345 20 10 3 3 .... How do I put some tabular data (let' say ten x,y values) corresponding to index 1, then another table to index 2, and...
I am trying to execute this code in C#.NET to turn an SQL table into a string with proper JSON; json.AppendFormat("Places: [{{\"AvgDate\": \"{0}\"},\"MarkerID\": \"{1}\"}]", reader["AvgDate"], reader["MarkerID"]); However it won't let me use the comma separation between the {0} and {1} indexes. The following works fine; json.AppendFo...
I am trying to develop a website with C# ASP.net MVC. It's my first time using Visual Studio, C# and ASP.net so I have lots to learn but so far so good. So far... I started a C# ASP.net MVC project and added a database by going to the Database Explorer and clicking "add connection". I then did some standard CRUD controllers and views. I...
... for strings, it's easy... LENGTH(attribute), but for ints, LENGTH always returns "4" for ints, "8" for bigints, etc etc. So given a statement like this: create table EMPLOYEE (employeeno bigint NOT NULL PRIMARY KEY); How could I add a CHECK clause that'll check to see whether an inserted employeeno is exactly 6 digits? ...
Hello, I can't get SqlCacheDependency to work with a simple stored proc (SQL Server 2008): create proc dbo.spGetPeteTest as set ANSI_NULLS ON set ANSI_PADDING ON set ANSI_WARNINGS ON set CONCAT_NULL_YIELDS_NULL ON set QUOTED_IDENTIFIER ON set NUMERIC_ROUNDABORT OFF set ARITHABORT ON select Id, Artist, Album from dbo.PeteTest And h...
I have a webhosting at Godaddy with MS-SQL, I have a table called Product with 3 columns (Id, Title, Details) I want to implement Freetext or Contains function to search multiple words. When I execute the query: Select * from Product where freetext(Title,'Car Honda') It answers me "Cannot use a CONTAINS or FREETEXT predicate on table...
Hello, I have a table called "Tasks". This table has the following fields ID TypeID Description How do I find all of the tasks that have more than one task of a TypeID? I do not have a TypeID to query with. Rather, I just want to list that tasks that have a TypeID that is used across multiple tasks. I'm not sure how to do this. ...
I have a table columns Id and EmployeeID. The table data has the following peculiarity: in some parts (where the Id is consecutive), the same EmployeeID can sometimes be found, for example Id | EmployeeID --------------- 1 | 1 2 | 1 3 | 2 4 | 5 5 | 1 6 | 1 I want to build a query to find blocks of data co...
I have a proc where I generate small html doc with a link and send it out via xp_smtp_sendmail proc. Link is generated based on query results and is long. This works in most cases. However, sometimes the link gets broken due to spaces being inserted into querystring variable names, i.e. &Na me=John. This might vary between email client...
Say I have a select statement that goes.. select * from animals That gives a a query result of all the columns in the table. Now, if the 42nd column of the table animals is is_parent, and I want to return that in my results, just after gender, so I can see it more easily. But I also want all the other columns. select is_parent, * fr...
Ok. I want to use parameterized queries to avoid dealing with embedded double or single quotes (" or ') in my data. As a simple example, what would the VBA code look like for the parameterized verion of this? Dim qstr as String Dim possiblyDangerousString as String qstr = "SELECT MyTable.LastName from MyTable WHERE MyTable.LastName ...
Hi, I've been working out this query now for a while and I thought I had it where I wanted it, but apparently not. There are two records in the database (orders). The query should return two different rows, but instead returns two rows that have exactly the same values. I think it may be something to do with the GROUP BY or derived tab...
Suppose I have 90 seconds. If I want to display the result in terms of minutes and second, I do it by using select Time= '0' + CAST( 90/60 as varchar(2)) + ':' + CAST( 90%60 as varchar(2)) The output is Time 01:30 I have appended 0(zero) because if you do a select getdate() the output will be yyyy-mm-dd hh:mm:ss:ms What is the...
Hello all, I need some help with a SQL query. Here is what I need to do. I'm lost on a few aspects as outlined below. I've four relevant tables: Table A has the price per unit for all resources. I can look up the price using a resource id. Table B has the funds available to a given user. Table C has the resource production info...
Hi all i have the following code: Now what this code does is it gets the results from an SQL query and inserts them in a predefined cell which i specify in the code...what i want it to do,.,,is to insert the result of the query in a cell that the user chooses when he clicks on a button which i assign the macro below. So the flow would be...