0
votes
1answer
5 views

Security concerns on SMTP in SQL Server

In my company, while I try to get the ports opened to connect to my SMTP server from my SQL Server running on Windows Server 2012, I get a reply saying that it is a security concern to open ports ...
0
votes
0answers
2 views

Find chunk_id for given record in Postgres

Is there a way to find details of the TOAST pointer for given row and column in Postgres (8.3)? Especially the chunk_id?
0
votes
0answers
6 views

MySQL Database delay

I've made my TV into a clock using PHP, a dedicated machine, and recently am adding MySQL to the equation to allow editing the settings from my phone. I've gotten this working, however, there is an ...
-1
votes
0answers
8 views

error in parallel query execution-single row subquery returns multiple rows

I am getting the error "error in parallel query execution-single row subquery returns multiple rows " sometimes while executing an sql query, while most of the times the same query runs without any ...
1
vote
1answer
16 views

sql getting sum of calculated columns

How can I get the sum of TotalAmount as single value for example Product Name UnitPrice Quantity Discount% Amount SharingCost% ShippingCost CustomsCost TotalAmount pro1 ...
0
votes
0answers
2 views

A different number of AFTER INSERT trigger alarms in SQLite and SQL Server

I have trigger CREATE TRIGGER [Foo] AFTER INSERT ON [Bar] BEGIN UPDATE Log SET count = count + 1; END When i execute query insert into Bar (ColumnName) values ('SomeValue1'), ('SomeValue2'), ...
0
votes
1answer
17 views

Tricky condition for postgresql UPDATE query

I need help with a postgresql query. I have a Django app + pg backend, where users post interesting URLs (or links) and can then comment under such links (called replies). There are two pg tables to ...
1
vote
2answers
51 views

Are cursors/While loops the only way to make administrative changes to multiple databases?

I specifically want a programmable way to change the recovery model of all the databases on a server, and i know this solution can be applied to all 'Alter Database' commands. While I know SMO in ...
0
votes
1answer
11 views

Using Select Statement to get column name and table name from the same table

I have a table containing 2 Columns : Column1 (table_name) and column2 (column_name) like this : (Column 1) (Column 2) |Column_Name | Table_Name | -------------|------------| ...
0
votes
0answers
6 views

MariaDB shows crashed and PID/Program Name shows -

I have setup alpine linux 3.3 on ubuntu 16.04 as a container using lxc/lxd and setting up mariadb. I am done with the installation and all. When I check for the status of mariadb, it shows crashed ...
-1
votes
0answers
4 views

How to select rows until condition is met (value != 0 after this row value = 0 will be ignore) [on hold]

Assuming: CREATE TABLE T ( x int not null primary key , y int not null ); INSERT T(x,y) VALUES (1, 0) ,(2, 0) ,(3, 0) ,(4, 0) ,(5, 3) ,(6, 0) ,(7, 4) ,(8, 0) ,(9, 0); Expected ...
-2
votes
0answers
9 views

3NF For a Weak Entity with no non-Key attributes

Can a weak entity made entirely of non-key attributes be in 3NF? I'm making a db for an assignment, and I currently am struggling to figure this out, especially since I've introduced auto-increment ...
0
votes
0answers
6 views

Windows 7 service manager thinks postgresql 9.4 is stopped, but database is up

I have several machines running postgresql 9.4 on windows 7. The database is configured to start automatically after a reboot, and it seems to start ok. pgadmin is accessible, and I can run queries ...
0
votes
0answers
34 views

MySQL Query fix and speed up

I'm newish to MySQL and a lot of my query is pieced together from this site and trial and error, so any help is appreciated. If I left out anything, or more detail is needed, I will be happy to give ...
0
votes
0answers
6 views

T-SQL to MySQL conversion for PIVOT [duplicate]

I made a garbage table with garbage data and a PIVOT on it in T-SQL format and I would like to convert it into MySQL but I can't figure out how to get it to work. Table and data: CREATE TABLE ...
-1
votes
0answers
12 views

PL/pgSQL trigger function syntax error at END; [on hold]

I'm writing a simple trigger function, as seen below. For context, it's meant to enforce uniqueness of a key across multiple tables. It will be made more generic once I've got it working. CREATE OR ...
0
votes
1answer
16 views

Display the the result of a substraction in a MySQL query (1 table)

I've made a table that looks like this: stop (table name) -cityName {PK} -schedule {PK} -price -routeNo Basicly the customer wants to know what's the cost difference between 2 different stops by ...
4
votes
1answer
163 views

Why can a differential backup not be copy-only?

I have noticed that copy only backups does not allow for differential backups. What is the reason the copy-only backup option is disabled for differential backups?
0
votes
0answers
4 views

Is it advisable to configure huge pages on SLES for MySQL

What is a general opinion on using huge pages with MySQL server? As described in here: https://dev.mysql.com/doc/refman/5.7/en/large-page-support.html Or is it best to leave things as is and not ...
0
votes
0answers
15 views

Functional Dependency Diagram From the Result of a Query?

I was wondering if someone could explain to me how this works. I understand the concept of functional dependency diagrams i.e being given a set of attributes and split the tables using the diagram to ...
1
vote
1answer
44 views

Many to many between lots of tables?

TL;DR: How could I set up many-to-many relationship between that many tables and is it viable/recommended? Each body type has its own table Each car in each body type table can has several ...
-3
votes
0answers
18 views

i need to know some advantages of field size [on hold]

Can you explain some advantages of field size. I have already tried to change the number of characters. This is because changing the number of characters reduces the amount of space wasted in the ...
1
vote
0answers
11 views

import TSV file into mysql table with SET datatype column

Is it possible to use LOAD DATA INFILE to load data into a mysql/mariadb table, where one column uses the SET datatype? If so, how do I specify the separator for the individual set elements?
-1
votes
0answers
15 views

How external/internal fragmentation effect to query performance [duplicate]

could you explain me what is external fragmentation and internal fragmentation? what does that effect to query performance Thanks in advance
4
votes
0answers
20 views

In SSMS, is “Navigate to” (Ctrl+,) of any use?

In standard Visual Studio 2012 or higher, IDE window called Navigate to... (Ctrl+,) offers all useful objects in scope of currently open project (see samples) getting increasingly filtered as I am ...
1
vote
1answer
21 views

Why does 3NF Normal form allow transitive dependency of prime attributes?

I'm just a beginner in Relational Design, When i came across the definitions of 3NF and BCNF. According to 3NF, Any non-trivial functional dependency X-> A shouldnt exist unless X is a super key or A ...
1
vote
0answers
41 views

To find SQL Server is actually used or not?

I have an SQL Server 2012 and a 2008R2 running in my environment. I need to decommission the server if the server is not actually being used. I did go through this and this where connection count is ...
1
vote
2answers
38 views

SQL Row concatenation with XML PATH and STUFF giving aggregate sql error

I am trying to query two tables and get results like the following: Section Names shoes AccountName1, AccountName2, AccountName3 books AccountName1 The tables are: CREATE TABLE ...
4
votes
1answer
62 views

When executing a command via xp_cmdshell what user issues the command to the system?

I'm executing the following command to stop a service on a remote server from within a stored procedure in SQL Server. ---------------- -- Stop Service ---------------- SET @Command = 'sc \\' + ...
2
votes
2answers
40 views

Select rows where smaller row does not exist

Consider the following table data: ID NAME 1 Kshitiz 2 Aman 5 Aakash 6 Manjeet Here there are records missing between 2 and 5. What query can I use to select row 5 in this table?
5
votes
1answer
73 views

Conditionally add an index to a temp table

I have a stored procedure that looks something like this: SELECT columnlist INTO #temptable FROM Table JOIN lotsofothertables WHERE severalconditions UPDATE anothertable SET column = ...
0
votes
0answers
12 views

On the fly MySQL balance

Please excuse my English translation that makes by Google Translate I need to solve the following in a MySQL query without php or another language: In the “A” column I have a string value, in ...
2
votes
1answer
12 views

Constraint on row value based on values in other rows

Is it possible to have a table with four columns: CREATE TABLE accrual ( add_date date NOT NULL, user_id integer NOT NULL, rate integer NOT NULL, amount numeric(7,3) ); and then ...
0
votes
0answers
5 views

Why do my queries are not routed to a correct queue for my user group in Redshift

I was following this tutorial to configure query queues on Redshift. So I created a parameter group, modified parameter group settings and created a queue. It has Query Groups set up as data_team ...
0
votes
0answers
27 views

Migrate SQL server data to new schema

I have a database that was originally created by a couple of people for a small business unit (about 8 staff and 10 customers) in MS Access. The original 'developer' was a non-geek who had been sent ...
0
votes
0answers
4 views

Backup/Restore single database with MySQL Enterprise backup

From what I have found online is it is possible to backup/restore an entire mysql instance with MEB and also a single .ibd file (to my understanding is a single table). What I am trying to do is ...
0
votes
1answer
16 views

pg_stat_activity shows lots of easy queries running for minutes

After application server start its connection pool fills quickly and application can't work properly. I went through pg_stat_activity and noticed lots of queries running for minutes: But postgres's ...
-1
votes
1answer
27 views

Multiple references to another table, but I don't know how many

I have two tables in a database, folowwing this model: scientists : id (int) | name (varchar) | surname (varchar) | publications (int) publications : id (int) | fulltext (varchar) I would like to ...
0
votes
1answer
30 views

How to find the AD user that logged in to SQL Server using SQL Login [duplicate]

Some users are logging into database servers locally, opening SSMS and logging in to SQL Server using SQL logins to run queries. How can I find the AD user that logged in to SQL Server using a SQL ...
0
votes
0answers
15 views

MS SQL data synchronization question

I'm in charge of modifying an application which was intended to run Microsoft SQL Server Compact 3.5. The application must run on a local database during fieldwork when there is no network ...
-1
votes
0answers
19 views

Get results from a query without calculate it [on hold]

i'm working with a big database more than 50 GB and basically the system that is using this database is to generate reports, I want to know if there is a way when I try to generate a report for second ...
0
votes
3answers
32 views

SQL Server 2008R2 min value within a set (or window) within a three column table

I only have SQL Server 2008R2, therefore I do not have all the window functions available since SQL Server 2012. I have a table that looks like this: I would like to retrieve a result set like ...
0
votes
1answer
23 views

What system privilege is needed for a user to manage user accounts only

I'm looking to delegate user termination to our NOC. Requirements are: A user NOC will be created User NOC will execute stored procedures allowing them to either 1) lock another db account or 2) ...
1
vote
1answer
98 views

How can I speed up a stored procedure? [on hold]

Here is an interview question I just had. I would like to know what a good answer to this would have been and what the different options would be. We have a stored procedure that is taking 26 ...
0
votes
1answer
22 views

Restore a database with compression on a non-enterprise edition SQL Server

Is it possible to restore a compressed an object from backup without the Enterprise Edition? I'm getting the following error after a RESTORE DATABASE operation. Msg 3013, Level 16, State 1, Line 2 ...
0
votes
0answers
8 views

SQL 2012 Availability Group issue - The core cluster resources do not move when we initiate AG fail-over

I have a Windows 2012R2 cluster with two nodes and a File Share quorum. I am running SQL 2012 SP2 and I have configured a test AG with a dummy database. When I fail-over the AG, the Availability ...
0
votes
0answers
3 views

How can I clear my database on Heroku?

I have an application that I deployed to Heroku. Everytime I try to sign-up, it gives me and error that tells me my password is invalid. I've type in everything correctly and I'm sure I've never ...
0
votes
0answers
2 views

Postgres Array into Geoserver

I'm working with OS Highways data, which when loaded into Postgres using ogr2ogr has a few columns that are set as arrays. Geoserver does not like this, so I need to transform the arrays into a simple ...
1
vote
0answers
20 views

How can I optimize a query with multiple derived tables containing `IN` and `GROUP BY`?

I'm collecting nmap data every five minutes and storing it in a database. Information about each scan (e.g. start and end time) is stored in the scans table: CREATE TABLE `scans` ( `scan_id` ...
0
votes
0answers
19 views

Can I delete an Oracle “Whole database backup” while a level 0 backup is being created?

I have created a Whole database backup using: -- In SQL*Plus ALTER SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE = 5000G SCOPE=BOTH; ALTER SYSTEM SET DB_RECOVERY_FILE_DEST = 'O:\ORA_FRA'; alter system set ...

15 30 50 per page