An acronym for "Structured Query Language" (it's not the name of a specific DBMS product), SQL can be used in relational database management systems (RDBMS) to query, update, delete, and insert data as well as modify the structure of the database. It can also be used to manage schemas and data ...

learn more… | top users | synonyms (1)

1
vote
1answer
39 views

Check entry based on entry in another column

Still fairly new to databases and SQL, so bear with me. I'm trying to check whether or not data can be inserted depending on data in another column, create table Table1 (PaymentType varchar(5) ...
1
vote
1answer
281 views

SQL Server is configured to allow remote connections

I use SQL Server 2012 and SSAS Tabular Mode (My Instance Name Is MSSQLSERVER2012T) Then I download AdventureWorks Tabular Model SQL Server 2012 From This link I open it with Visual Studio 2010 and ...
0
votes
0answers
33 views

Backup is getting failed with following error

Msg 3202, Level 16, State 1, Line 1 Write on "\w-mum-fp\SQLBKP\Weekly-FL\Interactions_26_01_2014.bak" failed: 1130 (Not enough server storage is available to process this command.) Msg 3013, ...
2
votes
1answer
65 views

Why should the most restrictive condition be listed last in the where clause?

The book I'm going through has given a rather poor explanation of why exactlt to place the most restrictive condition last in the WHERE clause. Say that we have Query 1: SELECT COUNT(*) FROM ...
1
vote
2answers
44 views

Change all datatypes in a table

I'm migrating a database and i need to change the "container", i don't exactly how to name it. I give an example to keep it clear : old base: VARCHAR2(20 BYTE) new base: VARCHAR2(20 CHAR) I can ...
5
votes
1answer
81 views

2008R2 Cannot Disable Non-Clustered Index

We have identified a handful of superfluous non-clustered indexes and I would like to disable them for a few days before straight dropping them. However when using the GUI in SSMS (right click > ...
0
votes
2answers
206 views

c# Backup sql server database, error Operating system error 5(Access is denied.)

I have been trying to backup an sql server database, and I understand that this error is in regards to drive write protection. I am at the end of my rope with this, as nothing that I have found online ...
0
votes
1answer
51 views

What is ag(always on) and fci(failover clustering) databases in sql server 2012? [closed]

I found an article from http://msdn.microsoft.com/en-us/library/ff929171.aspx. But I need simpler and better explanation. Can someone explain to me what they are and when you need it and why you need ...
0
votes
0answers
82 views

Optimize tables & schemas & sql query - mysql

I have a mysql querying the following tables: CREATE TABLE `products` ( `id` int(11) NOT NULL AUTO_INCREMENT, `page_id` int(11) NOT NULL DEFAULT '0', `category_id` int(11) NOT NULL, ...
2
votes
1answer
131 views

How oracle Oracle Database 10g used index?

I have table “result”, DDL : CREATE TABLE result (id_graduate NUMBER NOT NULL, id_sml NUMBER NOT NULL, last_update DATE NOT ...
0
votes
2answers
145 views

Slow insert - 300+ Million Records

The following query takes over an hour on the table to insert. There are no indexes. There was one which was deleted but still takes an hour after deletion. Any pointers on improving this ...
0
votes
1answer
38 views

How can i deploy ssrs report one server to another server [closed]

please help me when i create one sample ssrs report then i will deploy it so the bellow error will come:- "The specified report server URLhttp://localhost/reports could not be found. verify the ...
0
votes
0answers
25 views

Error in configuration sql server replication

I am configuring replication for a sql server 2005 on win server 2003. I get this error: TITLE: New Publication Wizard SQL Server could not configure 'aaaa' as a Distributor. ...
3
votes
2answers
212 views

Rearranging Data in an MS Access 2007 table into a new table format/Result Output

I have Access tables that have the following format: -------------------------------------- |Name |Math|Science|Reading|Civics| -------------------------------------- |Mike | A | C | A | B ...
1
vote
0answers
43 views

MySQL aggregation count performance

I have a table with about 30 million records, and I'm doing a query where I can group by field Year and count the results for that year. The table structure looks like: id | year | amount The ...
0
votes
1answer
55 views

Automobile database logic

I am building a web based quoting system for a local automobile dealership. I think I have figured out the logic for the databases but I want to get a second opinion before I start just to make sure ...
1
vote
1answer
45 views

Mysql down on my server (log files)

I have server (on DigitalOcean) with LAMP + site with wordpress 3.8.1. Sometimes my MySQL server down. I try to plug swap, and it helped sometime (fo example when pst publishing) but sometime my site ...
2
votes
1answer
51 views

Restoring Differential Backups

Is it possible to restore a differential backup separately? The production server runs the following every sunday DECLARE @Pathname VARCHAR(512) = 'N:\Backup\Dir\DBName_' + (select ...
4
votes
1answer
56 views

SQL Server transaction replication ignores DML which does not change data

I have a transactional replication setup between the two servers and I noticed that if a run a statement similar to this: UPDATE mytable SET mycolumn = mycolumn the replication somehow knows to ...
4
votes
1answer
146 views

SQL Server 2008 R2 Restore constantly hanging

I have a SQL Server 2008 R2 SP2 test server that I have to refresh the databases on fairly often, but every time I have to do a restore on, it will hang on me. I use a custom script to check the ...
0
votes
0answers
236 views

Cannot read property Collation.This property is not available on SQL Server 7.0

I'm not able to add administrator role in SQL Server 2008 R2. When I try to add new user it throws me the following error: Cannot read property Collation.This property is not available on SQL ...
2
votes
3answers
40 views

Database restore without deleting old database

I've done a copy of my database, using SQL Server 2008 R2 (DB -> Tasks -> Back Up). Now I'm trying to restore it (DB -> Tasks -> Restore DataBase). But SQL Studio give me an error and say, that I ...
5
votes
4answers
122 views

Use of HAVING without GROUP BY in SQL queries

In order to use HAVING in SQL queries , must there be a GROUP BY to aggregate the column names? Are there any special cases where it is possible to use HAVING without a GROUP BY in SQL queries? ...
0
votes
1answer
51 views

Why is the index not used?

When I run the following querys in MySQL: SELECT count(*) FROM Inventory AS i WHERE i.lastModified > 1389920146804 or SELECT i._id FROM Inventory AS i WHERE i.lastModified > 1389920146804; ...
1
vote
1answer
55 views

Execute a query which returns uniformly at maximum 100 records

I have a table in which every record has an ID, a date and a value. There are a lot of records, and I want to get those dates and values, to create a graph. But I do not want to have more than 100 ...
0
votes
1answer
35 views

Order result by number of occurence of a word in a text

I am working with sqlite3/python . I would like to order results by the number of occurence of %@% in text. For exemple Jimmy 10 // Jimmy wrote 10 strings like %@% James 2 Sophia 0 ..etc The ...
2
votes
1answer
65 views

Database Design guidance required

I have scenario where there is Table T with columns PK,A, B, C,D TABLE t ( PK, A, B, C, D ) i have to insert data from different sources ie columns A,B,C,D are calculated separately.. and they same ...
1
vote
1answer
36 views

How to calculate average of list of qualifications of each pupil MYSQL

I have this database and query: http://sqlfiddle.com/#!2/b4cf72/116 And I would like to add a column with the average of the exam qualifications. However, I try doing this but it tells me there are ...
0
votes
1answer
47 views

Issues with 'plus symbol' output in PSQL on update query

Simple but frustrating issue... I'm trying to do an update command to correct a misspelling with this field: grouper=> select * from master_list WHERE group ~ 'JustAdopted'; group | ...
5
votes
1answer
398 views

Use of FROM keyword on DELETE statement

The BOL and many other sources point out: FROM Is an optional keyword that can be used between the DELETE keyword and the target table_or_view_name, or rowset_function_limited. I'm used to ...
11
votes
1answer
225 views

Why does subquery use parallelism and join doesn't?

Why does SQL server use parallelism when running this query which uses a subquery but it doesn't when using a join? The join version runs in serial and takes around 30 times longer to complete. Join ...
1
vote
1answer
71 views

Autoclose property resets to true after attaching db even if model is set to false

I am using SQL Server Express 2008 R2. The auto close property of a newly created database will be set to value same as model db. In my case I have set autoclose to false for model so that when I ...
2
votes
2answers
98 views

View scripts ran by a specific user?

I read in a stackoverflow post that you can restore scripts from the past 24 hours by using this query: Use <database> SELECT execquery.last_execution_time AS [Date Time], execsql.text AS ...
0
votes
2answers
117 views

Implications of changing compatibility mode in SQL Server from 100 to 110

I have a database Mydatabase created in SQL Server 2008 R2. I have upgraded to SQL Server 2012. I was trying to execute below query to calculate percentile select Distinct ...
0
votes
1answer
22 views

What is the term that describes the use of OFFSET and LIMIT in a query

I am looking for a technical term (or phrase, or something concise) that describes the process of limiting the number of records returned from a query through the use of OFFSET and LIMIT. For ...
2
votes
0answers
45 views

Multi-Statement Template Plan Guide

A piece of, um, software seems to be issuing ~20k queries of this form every few seconds: DELETE FROM macVendor WHERE companyId=N' 08-00-'; INSERT INTO macVendor (companyId,organization) VALUES (N' ...
0
votes
0answers
38 views

non-optimized regex and substr with injected list in mysql query

edit: I can replace phone, -10 (that is last 10 digits of phone ) with full phone digits. on tip i got is SELECT….FROM… WHERE phone IN (…) UNION SELECT … FROM … WHERE email IN (…) edit end I am ...
0
votes
0answers
18 views

Bring relevant results based on an input search query - full text search?

The database contains information about businesses : title,name, categories, services, description ... to bring the relevant businesses to the user according to his search query I'm thinking about ...
0
votes
2answers
102 views

Missing DB on linked server

So there is a linked server. However, I am not currently able to view all databases associated with that linked server from within SSMS after expanding the catalog dropdown. It is my understanding ...
0
votes
1answer
45 views

importing database backup to phpmyadmin return #1064

When I tried importing mysql database backup to MySQL using phpMyAdmin I got the following error message: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your ...
1
vote
2answers
28 views

How to automatically grant permissions to application created databases in SQL Server 2008 R2?

So I have an application that automatically creates a new database after the database it is currently in reaches a fixed number of rows. I need to be able to automatically assign a user within the ...
2
votes
3answers
195 views

UPDATE … FROM … syntax for iSeries for a MS SQL Server developer

When I wanted to update a table to the values from another table in SQL Server I would use following syntax: UPDATE t1 SET t1.a = t2.a FROM t1 INNER JOIN t2 ON t2.b = t1.b What would be iSeries 7 ...
1
vote
1answer
74 views

SSIS v/s Replication v/s logshipping

I have 2 SQL server instances, on different servers. One is Production instance and gets lots of reads and writes daily. Another one is for external applications to use a copy of few of the tables ...
0
votes
1answer
73 views

Installation SQL Server 2012 - “Ready to Install” page missing

I need to create config file, so I could install sql server from cmd. I need basic server installation so I've downloaded SQLEXPR32_x86_ENU I need to go through whole installation process til page ...
0
votes
1answer
26 views

MS Access + MS SQL Server for 1160+ users - Is it worth it? (Please Help!)

Our school in Delhi (India) wants to develop a professional and robust in-house database (SIS) that should handle vast amount of student information, including admissions, registration, re-enrollment, ...
1
vote
1answer
64 views

Delete in big table data all data, where foreign_id in other table didn't exist

Let's say i have two tables: table_a: id | article_id | text article: id | text table_a for example contain data: 1 1 "" 2 1 "" 3 1 "" 4 2 "" 5 3 "" and table articles such ...
1
vote
1answer
21 views

How do I query for fields that have AT LEAST a given range?

Say I have a table of the form: +-----+-------+ | Key | Value | +-----+-------+ | A | 1 | | A | 3 | | A | 4 | | B | 2 | | B | 3 | | C | 3 | | C | 4 | | C | ...
0
votes
1answer
31 views

Replication in mysql with many servers

There are 3 shops. In each of these is a mysql server. I want all servers to synchronize their date if at least one server changes the date. I read a bit of literature and realized that I need ...
0
votes
2answers
55 views

A simple database and Query System? [closed]

I am new to databases and trying to solve one problem in which I have to build a simple database having few entries and then querying that database and then recording that answers from the database. I ...
1
vote
2answers
107 views

T-SQL script to perform a compressed backup with maximum compression level [duplicate]

I have a database with full backup of almost 2GB. When I perform a full backup (without compression) and then compress it with winrar it become 140MB, but when I backup WITH COMPRESSION syntax the ...