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)

-3
votes
0answers
11 views

how can insert multipal data from table1 one column data can copy from another table2 from sql server [on hold]

how can insert multipal data from table1 one column data can copy from another table2 from sql server eg insert into Voterinfore(CustID) select CustID from CustomerVoterInfo --SET IDENTITY_INSERT ...
0
votes
0answers
8 views

Choosing a better configuration for Windows Server 2008 R2 Standard

Currently we have a dedicated server running the following configuration Intel Xeon E3-1230, 4C/8T, 3.20GHz, 8M Cache 16GB Memory, DDR3, 1333MHz 2 x 146GB, SAS, 3.5-in, 15K RPM Hard Drive (RAID 1) ...
0
votes
1answer
20 views

Sql statement to count sum and campare it with another table

I would like to write an sql statement in microsoft access that group items and count their sum in order to compare it to another table I have two table like below : Product: list of demanded ...
0
votes
1answer
85 views

Dealing with data stored as arrays in a MySQL DB

So I know storing arrays in a DB field is wrong and would never do it myself, however a 3rd party plugin my company is using stores data in an array and I was wondering if you could help me try to ...
0
votes
2answers
28 views

How can I genereate a string from the returns of a SELECT query in Mysql?

I need to create a string from data that is extracted from an SQL query, and wish to accomplish it within the SQL Query. The return is something like +---------------+ | foo_ids | ...
1
vote
1answer
44 views

Need help with SQL Server PIVOT

I know about the PIVOT feature in SQL Server and I've read a few other questions and answers on here but I just can't seem to grasp it in order to do what I need. I'm trying to run some calculations ...
0
votes
0answers
12 views

MySql query keep running for a long time

Following query keep running for a long time and I'm using MySql 5.5.34 on XAMPP on Windows SELECT id_package, `pck`.`fk_sales_order`, `pck`.`fk_picklist`, count(pci.id_package_item) as items, ...
0
votes
0answers
11 views

SQL Server 2008 R2 installation device error

I am trying to install SQL Server 2008 R2 to use along with Visual Studio for a website I am creating. However when I am installing SQL Server I am constantly getting the following error: The ...
3
votes
1answer
287 views

How to separate out individual sql statements from Oracle SQL script for execution from java code

I have Oracle DB 11g Enterprise Edition and I want to execute sql script from my java code. I am reading this sql script from a .sql file and the script contains statements such as create table, ...
0
votes
0answers
18 views

Time series indexing

Indexing time series (like in this article) is done by reducing dimensionality and indexing it using some spatial access method (like R-tree). How does that improve performance, though? It's not like ...
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
1answer
48 views

Query multiple rooms with different conditionals (Adults, Children)

I have a simple query where I select available x Rooms with x Adults + x Children per hotel that matches a date range, but I'm having a hard time trying to figure out how to query a list of rooms per ...
2
votes
1answer
121 views

Numbering multiple dates per delivery

I am interested in producing the following view where different delivery dates are numbered. SalesID Delivery Date DateNo SO00000014 2014-02-21 1 SO00000015 2014-02-13 1 SO00000016 ...
1
vote
2answers
45 views

Returning empty string when string_agg has no records

I am trying to return a text field in a PostgreSQL query that is of the form 'stringOne' || string_agg(field, ',') || 'stringTwo' where for certain elements in the group clause, field is always ...
-4
votes
0answers
12 views

I can't connect with the DB through the php file. [on hold]

i can't transmin from php file,to the localhost db created with phpMyAdmin. I doesn't giv mi any errors,but still,doesn't transmit the informations. The code is simple. from e form with post method, ...
1
vote
1answer
88 views

MySQL with slow queries

I have a website running on Wordpress Multisite + Woocommerce with over 5700 users on a Nginx + Apache server. I recently experienced some down time but didn’t get any errors, just a blank page. I ...
0
votes
1answer
73 views

How to get back sql table data? [duplicate]

IDE: Microsoft SQL Server Management Studio Mistakenly I have cleaned a table data using delete from table tblBookData and now it has cleaned that table, please tell me is there any way to get ...
1
vote
1answer
63 views

Possibly tempdb out of space or a system table is inconsistent

While running DBCC CHECKDB I got this error Msg 8921, Level 16, State 1, Line 1 Check terminated. A failure was detected while collecting facts. Possibly tempdb out of space or a system ...
0
votes
1answer
79 views

Different time in different sessions

I am connecting to same db from 2 different machines using SQL Developer and querying a table which stores timestamp. But to my surpise the time value returned by query has a gap of one hour on ...
1
vote
1answer
45 views

Unnest multiple arrays into rows

I have been shown a great way to bulkinsert with this example: WITH p AS ( INSERT INTO parent_table (column_1) SELECT $1 RETURNING id) INSERT INTO child_table (parent_table_id, ...
0
votes
3answers
89 views

Database update query for split and sum in another field using mysql

I have one table test ID text sum ----------------------- 1 1_2_3 0 2 2_3_4_5 0 i want to update this table as ID text sum ...
0
votes
1answer
45 views

sql statement in access that group items and count their sum

I would like to write an sql statement in microsoft access that group items and count their sum My table is like below : id : Auto-Increment Items : String Quantity : Number Eg : id | Items | ...
0
votes
1answer
26 views

Dynamically REVOKE CONNECT FROM guest in SQL Server 2005

I wrote this simplistic script (I'm not very familiar with TSQL and dynamic SQL) to revoke all connections from guest accounts: DECLARE @database_id int, @database_name nvarchar(100); DECLARE ...
2
votes
1answer
547 views

Can't Restore DB Because of Active Connections

I have a DB I would like to restore. There are other active connections on the DB. I tried using sp_who2 to find those connections and manually kill them. Unfortunately, this did not solve the ...
1
vote
1answer
92 views

Difference between now() and current_timestamp

In PostgreSQL, I use the now() and current_timestamp function and I see no difference: # SELECT now(), current_timestamp; now | now ...
0
votes
2answers
786 views

Oracle query is slower the second time

I have a general question about something I'm seeing in performance tuning in Oracle. I have a query that I'm testing. It's too big and complex for me to provide a simple example, sorry! (I tried ...
2
votes
1answer
63 views

SQL Profiler - Insert values?

I setup an SQL profiler to run, but I am not seeing any values for updates/inserts. Is there a way to see them? All I see is stuff like this: insert into some_tbl(id, col1, col2, col3) values ( @P0 ...
1
vote
1answer
47 views

Any idea why this seemingly-simple query is really slow?

Here's the query SELECT count(*) FROM registration r LEFT JOIN registration r2 ON r.baggage_group_id = r2.baggage_group_id AND r2.team_id IS NULL WHERE r.event_id = "102577"; It seems pretty ...
0
votes
1answer
104 views

How To Execute an Integration Services (SSIS) Package from a SQL Server Stored Procedure

i am executing query like this on sql server 2008 R2 DECLARE @returncode int EXEC @returncode = xp_cmdshell 'dtexec /f "C:\certs\SSIS Disposition\SSIS Disposition\SSIS Disposition\Package1.dtsx"' ...
4
votes
1answer
379 views

SQL Server 2008 R2 Upgrade (Express to Standard) fails. No “Select Instance”

Hello there, i got stuck in the progress of upgrading 3 systems from SQL Server 2008 R2 Express Edition --> SQL Server 2008 R2 Standard Edition Problem: The Option "Select Instance" in the ...
0
votes
2answers
54 views

Merge two SELECT queries with different WHERE clauses

I have one table of services And I need to merge two SELECT queries, both have different where clauses For example SELECT U_REGN as 'Region', COUNT(callID) as 'OpenServices', SUM(CASE WHEN ...
2
votes
1answer
48 views

Optimizing indexes

I just began optimizing my schemas with indexes (pretty late I guess). I never dealt with huge dataset but I'll be soon coping with about 1 to 5 millions rows. Here is the schema I'm using right now ...
0
votes
1answer
64 views

Efficient way to write query for multiple table which depends on column value of a table in mysql?

In the given schema, there is a table A having column A1,A2,A3,A4 There are three more tables i.e. B,C,D If the value in A4 is b, i have to lookup table B. If the value in A4 is c, i have to lookup ...
0
votes
2answers
147 views

How to migrate data from SQL database to MySQL including flat files?

one of my friend has asked some asp developer to make online application where user can upload files also. jpg, doc, pdf and all these files are saved in SQL database as flat file. Now my friend asked ...
1
vote
2answers
64 views

Storing a Shipping Address Best Practice

I'm building a checkout system which needs to store the customer's shipping address in the database and am unsure the best way to go about it. Currently I have an addresses table which stores each ...
-9
votes
0answers
32 views

Mirroring error #1418 [on hold]

I have configured mirroring in server without witness but I am getting a error no 1418 please suggest how to solve it. Even if I tried to create a endpoint but I couldn't create it.
1
vote
2answers
68 views

MYSQL joining 3 tables with left join

I have these tables: pupils: (id_pupil, name, surname, email, user, pass, level, class) incidents: (id_incidents, date, time, type_incident, comments, id_pupil, id_user, subject, id_trimester) ...
0
votes
1answer
22 views

Can I estimate the row count of a large mysql table using the disk space?

Sysadmin here (not a developer by trade), so go easy please ;) I have a mysql table, on a linux server that uses innodb_file_per_table. When I try to do select count(foo) from table; It doesn't ...
2
votes
1answer
27 views

How to create function(table_name) that returns a set of the table

I have a set of tables that share the same fields (some timestamps and users names used for version control). I need to create a function with dynamic sql that uses a table_name and a timestamp as ...
1
vote
3answers
36 views

New SQL Server 2008 instance, load old instance DB's

BACK STORY: I'm a developer with a local instance of SQL Server 2008 on my workstation. I just recently upgraded my motherboard and found out (much to my dismay) the old motherboard's RAID drivers ...
3
votes
2answers
149 views

How to optimize a log process in MySQL?

In my project, I have about 100.000 users and can't control their behavior. Now, what I would like to do is log their activity in a certain task. Every activity, is one record which includes columns ...
0
votes
1answer
21 views

Merge left outer join column

I have a query that use left outer join. something like that : select issues.id, journal.notes from issues left outer join on (issues.id = journal.issue_id and journal.notes != '') So far it ...
1
vote
1answer
32 views

Avoiding entitized characters when using FOR XML PATH for string concatenation

I have this query: SELECT DISTINCT f1.CourseEventKey, STUFF ( ( SELECT '; ' + Title FROM ( SELECT DISTINCT ...
0
votes
1answer
37 views

What data will be lost with DBCC CHECKDB (REPAIR_ALLOW_DATA_LOSS)?

I have a corrupt database. The last known good backup was over 2 weeks ago. I've run a CHECKDB and have the page numbers where SQL Server located the corruption. I've looked at the data on the ...
1
vote
0answers
31 views

Profiling parameters

I was trying to fine the parameters of a query I suspect to be causing unnecessary logical read and eventually captured it in profiler, however parameters @p3 and @p4 are not listed. Is anyone able ...
1
vote
1answer
51 views

Optimistic Paging and separate query for COUNT?

I am using SQL SERVER 2012 FETCH/OFFSET after searching a lot that this will give me the best performance. But for paging to work, I need a Total count. There are 2 ways to achieve this. 1) Paging ...
4
votes
1answer
65 views

sql indexing and performance

I am using mysql5.1, i have table which has about 15 lakh (1.5 million) records.This table has records for different entities i.e child records for all master entities. There are 8 columns in this ...
-3
votes
0answers
32 views

Is it possible to get the queries executed in the past? [closed]

Is it possible to get the queries executed in the past? the server is restarted.
1
vote
1answer
66 views

Update old database with SQL dump

I had to recover a database with a some months old full backup. I have however in my possession a most recent but unfortunately incomplete SQL dump for this same database done with mysqldump. Is ...
4
votes
1answer
185 views

ERWIN create and use database

Im trying to generate physical database from my logical model using ERWIN 7. All is well in the script that is generated automatically, there is only the problem that the model is created in the ...