All SQL
   11 tags on

All SQL

  • All Sites

2 answers

SQL Server procedure returning no results

OK, so I have the following procedure in my SQL Server 2005 Database. I am trying to figure out why it is giving me no results. The user attempting to access it is an administrator, but I have also …

4 answers

Store image in database and retrieve it

My code for inserting image in database is as follows: MemoryStream ms =new MemoryStream(); byte[] PhotoByte=null; PhotoByte=ms.ToArray(); pictureBox1.Image.Save(ms, ImageFormat.Jpeg); PhotoByte ...

3 answers

Merge two tables, inheriting values from one to another

I have two tables that I would like to display as a single result, using UNION or other technique. The ID field relates both tables. The second table has one field missing, so that missing value ...

50 secs ago
1 answer

Paste VBA recordset into excel?

If I had an SQL recordset returned to me in VBA is there an easy way I can just paste the values to the spreadsheet without having to loop through etc?

1 min ago
3 answers

How to copy complete structure of a table without BACK-UP

How can someone copy a table structure without using backup? jcho360> show create table actor\G *************************** 1. row *************************** Table: …

0 answers

getting a Must Declare Scalar Variable when it is already defined

I receive the following error: Must declare Scalar Variable @PaymentTermID Problem is, @PaymentTermID should be defined already in the Update parameters. The 2 functions for onrowdatabound and …

2 mins ago
3 answers

Is this the optimum query for what I'm trying to do in MySQL?

I'm running a number of queries that merge constantly-changing data into a master table and one of the queries (below) seems to be running quite slowly. The set up is as follows: products table and …

1 answer

Receiving erroneous “The SELECT permission was denied on the object …” along with “The cursor was not declared.”

Alright.. this is particularly tricky considering the SELECT permission denied error and the difficulty of wading through all of the "You need to grant select permissions on your table..." responses. …

0 answers

Is it safe and recommended to make a one to many relation within the same table?

I'm using SQL SERVER 2008 R2, and Visual Studio .NET 4 C# I have the famous USERS table. Consider its design: UserID Username Password UsertypeID -- this is a foreign key, linked to 'UserTypes' ...

2 answers

homebrew mysql os lion - CMake Error at cmake/do_abi_check.cmake:78

I recently upgraded from snow leopard to lion. I've got the latest version of Homebrew running (e.g. I ran 'brew update'). I'm trying to install mysql but I get the error below. Googling for how to …

1 answer

Submitting Dates between Date Range - mySQL

In teaching myself php and mySQL a year or two ago, I created a movie database for the theater I work at, to help automate the more mundane web updates that need to be done weekly. So far this only …

5 mins ago
7 answers

How do you query an int column for any value?

How can you query a column for any value in that column? Sometimes I would query for actual value (like 1, 2...) so I can't not have a condition either. Is there a wild card? select int_col ...

6 mins ago
1 answer

My SQL 5.6.4 . In DATETIME column milliseconds is not getting stored

beginning from MySQL 5.6.4 , milliseconds support is provided for date columns like DATETIME etc... I just create one table like below to check if its working create table testdata(startime ...

6 mins ago
0 answers

DropDownList Substring to Populate Textbox for Stored Procedure

My Asp.net page has multiple textboxes and DropDownLists that populate from a selection in the Gridview. My problem is multiple, I have a keyfield in the gridview that is a uniqueidentifier used to …

2 answers

Last time Row was updated

Whats the best trigger for recording the last time a row is updated or inserted using a date column? I tried this, but it is not working: CREATE TRIGGER trUpdate ON Tablename FOR INSERT, UPDATE AS …

7 mins ago
2 answers

UNION ALL takes too long

I have clustered data on multiple tables, generally they looks like this: CREATE TABLE 2012_03_09 ( guid_key integer, property_key integer, instance_id_key integer, time_stamp ...

2 answers

Error getting a INT out of a database

This is my function. In tblAlgemeen is a AlgemeenID. But it's a INT public function GetAllNews() { $conn = new mysqli("localhost","root","root","SquareNews"); $sql = "SELECT * FROM …

10 mins ago
1 answer

Local network speed appears to be being limited

I have a dedicated server setup that has just started causing us issues. Our immediate problem, is that last week, could log into an admin page of one of our websites just fine, now we can't. It does …

1 answer

CakePHP X hasMany Y, find X that has Y.name = “value1” AND at the same time has Y.name = “value2”

So my model association is as follows: Person hasMany Award Person columns: id, name Award columns: id, person_id, name So people can have many awards, but I want to retrieve only those specific …

10 mins ago
1 answer

mcrypt/mysql syntax error on login page

I've got such code as an auth file for my CMS on login page: //$login=true; $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB); $iv = mcrypt_create_iv($iv_size, ...

11 mins ago
0 answers

get_long_lat_pt equivalent in mysql

Oracle provides get_long_lat_pt(lon,lat) to get a point in which can be used to analyse Geo spatial queries . For eg. SELECT * FROM places WHERE SDO_CONTAINS("place", get_long_lat_pt(11.551563, …

0 answers

Selecting data from row above and below selected row in query…Possible?

How can I select all 'ITEM #' lines, concatinate with the line below and conditionally concatinate the line above if it has and "X" in it? Possible? I also want to be able to select say all items ...

12 mins ago
0 answers

How do I resolve Postgresql error, “ERROR: PL/Perl function must return reference to hash or array”?

The follow code used to work in Postgresql 8.3: select * from sha1_to_url('11a9e81eaa229b8379404b9c7d4a1eb08564c692', 'http://www.google.com', 'jpg'); sha1_to_url …

13 mins ago
1 answer

Moving MySQL datadir

I am trying to move the data directory of my MySQL database to a second disk array that I have as a mount point /array2/ The problem I am having is I have tried everything and after I modify the ...

14 mins ago
5 answers

Error while creating a Membership user “The password-answer supplied is invalid”

I tried creating a new user using CreateUser method. but when I click create user button I get this weird error : "The password-answer supplied is invalid". I already tried putting a strong password …

4 answers

Using SQL for a Realtime Multiplayer Game Server's Working Data (Fast Enough?)

The game I'm working on currently has a Client in Flash AS3, and a Server in C# (multithreaded). Currently I use mySQL to handle logins (Raw access: no middleman for accessing the database) which ...

0 answers

Wrapping words in a SQL query string with regex

i have a database class that is written in PHP and it should take care of some things i don't want to care about. One of these features is handling the decryption of columns that are encoded with the …

5 answers

How is it possible to have a good EXPLAIN and a slow query?

How is it possible to have a good plan in EXPLAIN like below and have a slow query. With few rows, using index, no filesort. The query is running in 9s. The main table has around 500k rows. When I …

16 mins ago
0 answers

Finding path length along points in postgis

I have a postgis database (postgres 8.4.11, postgis 1.5.2) with gps-observations where I would like to calculate some travel distances. I calculate the travelled distance from one point to another …

17 mins ago
1 answer

Object reference not set to an instance of an object with no NULL fields present

I have the following code in my CMS 3.0 project SurveyController.cs private BuisnessSurveyEntities bsdb = new BuisnessSurveyEntities(); [HttpGet] public ViewResult BizSurveyCDF() { var bquery = …

18 mins ago
15 30 50 per page
1 2 3