Sql
   9 tags on

0 answers

I'm confused about Sqlite comparisons on a text column

I've got an Sqlite database where one of the columns is defined as "TEXT NOT NULL". Some of the values are strings and some can be cast to a DOUBLE and some can be case to INTEGER. Once I've narrowed …

31 secs ago
0 answers

getting a Must Declare Scalar Variable when it is already defined

I receive the following error when trying to update records: Must declare Scalar Variable @PaymentTermID Problem is, @PaymentTermID should be defined already in the Update parameters. The 2 …

2 mins ago
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 ...

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?

4 mins 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: …

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' ...

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 ...

8 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 …

10 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 …

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 = …

20 mins ago
3 answers

Paginate SQL query

On a winform, in a datagrid, I am displaying about 100k rows, selected from the DB. Showing all these records take a lot of time. Is there a way to make the select query faster or maybe load the first …

2 answers

Are there alternatives to Microsoft Access, like Hyperion?

Our office is using Microsoft Access to generate reports and to create front ends for updating/adding data to our SQL Server database. Put another way; We use Access for creating a Front End for end …

1 answer

How to Stop SSMS 2012 from scripting SPs using sp_executesql

I realise this is a very similar question to this. However, they seem to have changed the behaviour with SSMS 2012. If you have the 'Check for existence' option selected, as in: ... it now ...

0 answers

Getting the count of 2 different columns in one statement

I'm trying to get a count from 2 tables working and I'm struggling! I've got a table with notebook items, a table with links to contacts, a table linking contacts to clients and a table linking ...

25 mins ago
0 answers

Converting X y Coordinates to lat/long

I have a table that has X y coordinates in SQL Server2008.But the other table in the DB only stores the lat long. so I need to convert the X y coordinates and enter it in that another table. How to …

30 mins ago
6 answers

Round *UP* to the nearest 100 in SQL Server

Is it possible to easily round a figure up to the nearest 100 (or 1000, 500, 200 etc.) in SQL Server? So: 720 -> 800 790 -> 800 1401 -> 1500

33 mins ago
4 answers

Return value from OleDbCommand

sqlQuery = "SELECT [ID] from [users] WHERE CallerName=@CallerName"; OleDbConnection conn = new OleDbConnection(connectionString); conn.Open(); cmd = new OleDbCommand(sqlQuery, conn); cmd.CommandText …

2 answers

Postgres date overlaping constraint

I have a table like that : date_start date_end account_id product_id 2001-01-01 2001-01-31 1 1 2001-02-01 2001-02-20 1 1 2001-04-01 2001-05-20 1 …

34 mins ago
3 answers

Entity Framework no columns from simple query

I have the following stored procedure: SET ANSI_NULLS ON SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[GetData] @taskName VARCHAR(205) = NULL AS BEGIN SELECT * FROM ...

1 answer

Insert into MySql failed

Hy everyone i have a problem when i try to insert something in database. The DB method is: public static void insertInEntries(String NrDeOrdine, String NrDocument,String Data, String Emitent, String …

37 mins ago
3 answers

Solution for: Store update, insert, or delete statement affected an unexpected number of rows (0)

I found a solution for people who get an exception: Store update, insert, or delete statement affected an unexpected number of rows (0). Entities may have been modified or deleted since entities were …

1 answer

encryption of SSRS subscription emails and attachments

Is it possible to set up an SSRS e-mail subscription, with an attachment, that is encrypted?

45 mins ago
0 answers

823 errors on tempdb

Have a couple Fiber channel SAN-attached cluster servers which have been intermittently reporting errors like: 2012-05-09 16:31:54.13 spid74 Error: 823, Severity: 24, State: 2. 2012-05-09 ...

0 answers

Batch loading XML data to SQL Server 2008

I am trying to batch load XML data to SQL Server 2008 by using following script: CREATE TABLE #WorkingTable (Data XML) INSERT INTO #WorkingTable SELECT * FROM ...

46 mins ago
5 answers

SSIS ETL Question/Option

In our current prod environment, when the ETL launches, it first checks an environmental variable at the OS level which tells it where the "config" database and table is for it to get the necessary …

48 mins ago
15 30 50 per page
1 2 3