DO NOT USE this for questions targeting Microsoft SQL Server, use the tag sql-server instead. "SQL" is an acronym for "Structured Query Language", it is used in relational database management systems (RDBMS) to query, update, delete, and insert data as well as modify the structure of the database. ...

learn more… | top users | synonyms (1)

0
votes
1answer
18 views

delete query performance issue on mysql

I have two tables table1, table2 where table2 is a subset of table1 (basically created with the query create table table2 as select * from table1 where .....) Now, I am trying to run the below query. ...
3
votes
2answers
90 views

sql querying for a pattern

I was hoping someone could steer me in the right direction with this one. I have a table that has student grades. Create Table StudentGrades ( StudentID references Student(StudentID) int not null, ...
1
vote
1answer
195 views

Sql Server sys.Traces log

Working with traces on production server I found some mysterious entries to me in sys.Traces, When I run below query it shows me status of all traces as ‘Paused’ along with entries in ...
0
votes
1answer
24 views

How to merge two databases, both with primary keys

I have two databases, both with the same tables, but the data is out of sync. I need to add data from database A to database B, but not overwrite any data in B that exists in A, instead add it with a ...
2
votes
2answers
81 views

Cannot generate SSPI context ( SQL Server 2008 ) ( RESOLVED )

When someone tries to connect to a SQL Server instance, the error shows up: It's not possible do generate SSPI context. Yesterday we had a blackout (don't know how to say this expression in ...
0
votes
1answer
33 views

SQL select with unique_list - losing an item

I have an oracle database and I have the following problem: If I make an select like this: SELECT fk_proddes_id,fk_id_cod_deseu, LISTAGG (TO_CHAR (cod_eliminare), ',') WITHIN ...
2
votes
2answers
110 views

Searching multiple tables in SQL

This question will involve some C# code but I hope that is fine, in the end it is the SQL that is the issue. (To see short question look at end of post) So I have a site, where you can add a site in ...
0
votes
1answer
520 views

Selecting from an excel spreadsheet into SQL Server table

This question has been asked before but I tried giving full admin rights to the SQL Server user on C:\temp\ folder location (I am using Windows authentication into SQL Server Express). So for the ...
-1
votes
1answer
22 views

Retrieve user Permissions on a database [on hold]

Please could you provide me query that shows user(John Felix) permissions on a server\database.
0
votes
1answer
15 views

Optimize Query in MySQL

I've following tables with respective fields 1) wi_individual_g(ind_id,ind_is_recepient,ind_deleted,ind_district_id,...) - Around 200K data 2) wi_individual_p(ind_id,prg_id,...) Around 250K data 3) ...
2
votes
1answer
13 views

Linking SQL Server tables to a PostgreSQL Server

I have a SQL Server 2005 instance and also a PostgreSQL 9.3 running on the same network, I would like to know if its possible to somehow create or have 'views' on a database within the PostgreSQL ...
-1
votes
0answers
9 views

Can anyone convert this SQL into Rational Algebra Format [on hold]

select RATE.rname, RATE.boundary from RATE, ROUND, CANDIDATE where RATE.rname=ROUND.rname and ROUND.cname=CANDIDATE.cname and CANDIDATE.person_name=’Jacky’;
1
vote
2answers
207 views

Add function parameter to SQL query WHERE clause

I have a web application in java and it uses a query. I don't want to write the query into Java, so I made a function: CREATE OR REPLACE FUNCTION testFunc(inputs text) RETURNS TABLE(...) AS $$ ...
0
votes
0answers
3 views

Access 2010 delete and append queries run partially then give “Read Only” error

I have a number of append and delete queries written in Access 2010 that link to and modify tables on our SharePoint 2010 site. These queries have run without problem for months, but suddenly they've ...
2
votes
2answers
20k views

Oracle password has expired, however I have no way of changing it

When I connect to my local development database, I get an error saying the password has expired. I've been trying to change it with sqlplus to no avail: C:\>sqlplus ...
0
votes
2answers
41 views

SELECT that is null if there is one more register in this date that is not null

I'm trying to make a query that I can't produce... This is my table capturainfo captureid int(11) userid int(11) date date dateinit datetime datefin datetime I need to select ...
1
vote
2answers
17 views

How can I map a login to a database using T-SQL (not SSMS)

I'm writing a program that requires me to assign all permissions and everything in code. I have gotten stuck in this part: I just want to do the equivalent of clicking the little box under "Map" ...
1
vote
3answers
38 views

Script to drop all databases except one not working

I'm trying to drop all databases but one on my test server. For this, I'm using the below script but it gives error: EXEC sp_MSforeachdb ' USE [?] IF (DB_ID(''?'') > 4 AND DB_NAME()!=''ABC'') ...
1
vote
1answer
251 views

Database Mirroring and Replication in SQL Server 2008 R2

I have configured the mirroring and replication between 4 servers (A,B,C,D).i.e, Mirroring between A to B and C to D, Replication between A and C. The configuration was a success and I am able test ...
1
vote
0answers
26 views

Is there a way to improve this query further?

I've got a query that over time I've been improving. Originally it simply selected * from the records table, and the data was formatted on the webapp side. But that was slow and I wanted to make ...
1
vote
1answer
115 views

Query does not use index (according to EXPLAIN SELECT)

Can anyone give me an indication, why this query does not use the Key on the table 'gtg'): ...
0
votes
0answers
39 views

Why is MySQL not saving inserted data?

So I have the following insert statement that I run through MySQL Workbench: INSERT INTO PeakOnlineCount (time_stamp, LocationId, Count) values ('2015-03-26', 0, 1) If I run the following query: ...
0
votes
1answer
19 views

oracle database - sql for counting the columns with the same id with the one in current row

I have an oracle database and a few tables and with this query: select rap.DENUMIRE,a3.ID,op.FK_ID, (SELECT COUNT(*) FROM ANEXA3_TABEL1_ROWS) AS count from ANEXA3_TABEL1_ROWS a3 inner join ...
0
votes
0answers
18 views

DB space vs query complexity tradeoff

I have a dilemma - Right now I have a query that I do constantly - joining 5 tables on different columns, calculate stuff per row, distinct on that, and do that with offset and limit (pagination). I ...
3
votes
2answers
31 views

Getting Machine name from where stored procedure was last executed

Is there any way to find out machine IP or machine name from where a particular stored procedure is executed in SQL Server 2005? We have a client server architecture with .NET as a front end and SQL ...
0
votes
2answers
240 views

SQL Server 2012: Full Text Catalog taking up all the disk space

We have created full text catalog and index for a pretty large table. The column on which the index is being created has a datatype of varchar(max). The problem started as soon as we started ...
0
votes
2answers
335 views

How to retrieve the Capture Instance for a given table?

Working with SQL Server 2012, I have a hierarchical table layout (TPT). All tables "inherit" from the same base table (dbo.DataObjects). All tables have history tracking via CDC enabled. I am trying ...
0
votes
2answers
110 views

How to import into database when records contain multi-line data

I am setting up a new database and I want to import lots of data from multiple spreadsheet files. One of the fields in these documents contains an array of data, each item declared on seperate rows as ...
2
votes
1answer
28 views

How to keep updates (diffs) of some entity in the database

What is the best way to keep updates (diffs) of the some entity in the database? At StackOverflow we can edit questions and answers. And then we can look at any revision of the question or answer we ...
-2
votes
0answers
13 views

Can anyone tell me which programming language is from www.freelancer.com, www.clickbank, www.craigslist.org and www.pof.com? [on hold]

I want to build a site like www.pof.com and advance search area is my favor (key word post and match and searching). Any one can tell me better, simple and easy to apply and manage in the future for ...
4
votes
2answers
1k views

Select rows where value of second column is not present in first column

I have this table structure: id1 id2 1 2 1 3 1 4 2 1 2 5 I need to build a query to select id2 where id1 is not in id2. For example if id1 = 1 then only id2=3 and id2=4. I tried ...
0
votes
2answers
598 views

SCCM 2007 SQL Query Code - Help Needed

I am trying to write a report where I grab data showing all server collections with maintenance windows. How I want to do this is to show only those server collections where those computers are also ...
1
vote
3answers
5k views

Bulk update of all columns

I am wondering if PostgreSQL has an update query somewhat like their insert values syntax. I have an updated set of data in this form currently: INSERT INTO ...
0
votes
0answers
9 views

Populating a table with data from a table that has the historical data on columns (SQL/plSQL 10g) [on hold]

I have to populate a table with information from a table that has the historical data on columns. The source table name is source table xxtbl_source(client_id number, dec_14 number, nov_14 number, ...
-2
votes
0answers
11 views

What are Client Access Profiles and what are they used for?

Can someone please explain to me what Client Access Profiles are, and what they are used for? I have not able to find 1 single thing about them online in the past week.
-3
votes
0answers
24 views

Monyog for SQL Sever [on hold]

I'm looking for a SQL Server Log Parser/Analyzer like Monyog for Mysql where I can load a log file and the parser can show me how often a query was executed (this is done by replacing literals so ...
2
votes
2answers
793 views

Designing database with Category and Tags for Posts - Seeking for guidance/advice

I'm not really a database novice but I'm not an expert either. Problem: I'm having this difficulty on designing my Post, Category and Tags relationship. I've read Normalization many times but could ...
0
votes
2answers
191 views

mysql need help optimizing query

I have a table containing servers logs, and another table containing rules to match certain and drop them. The logs tables contains around 1 million rows, and there are about 20-30 rules. The ...
0
votes
0answers
16 views

difference between phpmyadmin and php PDO

I'm running a query in Phpmyadmin and also execute the same query with php PDO but results are not equal. What could be wrong ? This is query : SELECT dim_date_key as date ,dim_jdate_key as jdate, ...
-2
votes
2answers
23 views

SQL SUM of different product groups in one query?

I have a table with the following columns: PRODUCT_ID | PRODUCT_NAME | GROUP_ID | GROUP_NAME | PRICE GROUP_ID and GROUP_NAME are not UNIQUE. Can I make a selection which just returns each GROUP_ID ...
0
votes
0answers
19 views

Windows Server 2012 - Can't connect to database with PHP [on hold]

I have problems connecting to my database. We have bought a cheap used windows 2012 IBM Server which is hooked up in our network. It has PHP 5.6 installed as well as SQL. I've only worked with ...
0
votes
1answer
22 views

Postgres - count of GROUP BY

I am trying to determine the total number of contributors in an image database who have contributed at least five images. The following query will give me counts of images by contributor, but that's ...
0
votes
0answers
19 views

trying to a lag a column in SQLite

Sorry if this is too basic for this forum, but I have had no luck in StackOverflow. I am a newbie to SQL. I am using SQLite. I have a table where rows represent individuals in a point in time. I am ...
2
votes
2answers
14k views

Connect to SQL Server with Windows Authentication in a different domain

I am trying to connect to a remote SQL Server on a VPN in a different domain. When I enter the Server name on the SQL Server and choose Additional Connection Parameters to add some extra stuff needed ...
0
votes
0answers
11 views

Why is my Make Table query pasting 0 rows?

I have 3 tables that I am trying to merge into 1 table using a make table query. They have thousands of rows of information. They all have multiple columns, but the first column on each will contain ...
0
votes
0answers
7 views

Push all SQL Server changes to a non-SQL Server platform [on hold]

What is the best approach for capturing all the changes (all creates, inserts, updates, and deletes) and sending those into an external platform like Datomic for history/reporting/auditing? I'm ...
2
votes
1answer
59 views

Updating table of versioned rows with historical records in PostgreSQL

I have a master table of versioned rows: CREATE TABLE master ( id SERIAL PRIMARY KEY, rec_id integer, val text, valid_on date[], valid_during daterange ); INSERT INTO master ...
1
vote
3answers
122 views

Text Storage and Database Design Optimization in a SQL Server Database

Given a database with a number of columns (c), where some of these columns contain text that is one of multiple values due to a set CONSTRAINT on the columns, what is the most efficient way to ...
0
votes
0answers
18 views

outer join more than 2 tables in access [migrated]

After following this thread. I am getting an error as "Syntax Error in JOIN Operation" Here Is my query SELECT StudentMaster.Student_id, ExamDetails.Subject_id, ...
1
vote
1answer
169 views

How to set IN values on an update (SQL Server)? [on hold]

Quick question, I did try to google but couldn't find an answer. I have 3 separate queries here, I want to do SET IN ('price1', 'price2', 'price3') but when I tried I got an error. How would I do ...