All Questions

3
votes
1answer
394 views

SQLServer add a default value for a column [on hold]

I am using MS SQL Server. I have an "action" table with an "action_type" column that I want to set a default value of "to do" for. My DDL in MS SQL Studio errors! I have read many many articles trying ...
3
votes
2answers
29 views

giving users select-only permissions of database objects

I'm running SQL Server 2017 with a production database called Biz. I'd like to Give three users the ability to run SQL queries against this database without altering the data, or maybe preferably, ...
-3
votes
0answers
29 views

Aggregation queries and sorting [on hold]

I have three tables with attributes as follows: The Sponsored table contains the names and ids of the Orphans sponsored. In the Sponsor group, a member can sponsor more than one orphan. I want to ...
1
vote
1answer
8 views

Unable to connect to the Reporting Services instance through SSMS with windows authentication

I am trying to connect to Reporting Services instance SSRS with SSMS so that I can update some of the parameters on display of remote errors and retention of execution log statistics. I receive the ...
2
votes
1answer
50 views

How can SQL Server 2016 deadlock with a pagelock on two different tables?

I'm using SQL Server 2016 and running into a situation where a deadlock, via pagelock, is happening on two different tables. As I understand the database never shares pages across tables, so how is it ...
1
vote
1answer
25 views

How to prevent the creation of Mysql columns with default values that are not defined

Is there a Mysql server setting that will prevent the creation of columns that are NOT NULL but do not have a default value specified? I'm trying to prevent the creation of fields like this: ALTER ...
2
votes
1answer
31 views

Failed to allocate BUFs during DBCC CHECKDB

I am writing to see if anyone can help me out with a problem that I just can't seem to figure out. This one is going to be a doosey and I am going to try and list out as much of the important info ...
0
votes
0answers
15 views

how to detect infrastructure problems?

I'm new as MySQL and DBA role. Our systems started to fail due to timeout established by SLA (a few seconds). Nothing different happened that day, normal usage, less than a thousand transactions per ...
1
vote
2answers
24 views

Login failed errors while DB refresh in progress

We have a 2.5TB refresh in Production, I have automated the refresh of latest production backup to lower environment every Sunday night. And during this activity, SQL error log is filled with ...
1
vote
2answers
24 views

query help in joining tables

I'm quite green in mysql, but I have been assigned a task for which I completely lost. I have a unique codes table in mysql and then I have another 6 tables for individual clients. I would like to ...
1
vote
1answer
51 views

Trans Log fills during delete, conceptual question

I'm learning everything I can about backups and transaction logs and such. I want a little feedback on if I'm understanding this, so I have a conceptual question. First, here is what I observed: I ...
4
votes
2answers
77 views

Indexes getting highly fragmented during normal usage of system

I am using MS SQL Server 2014 Standard Edition in my project and recently I have encountered an issue with index fragmentation getting high during normal usage of the system by the users. Currently ...
0
votes
0answers
10 views

Is there an ideal way to structure collections that can contain each other?

I have a box. That box can have crates in it. These two types of objects have similarities in that they can contain things but are different enough to keep classification separate for them. Those ...
0
votes
0answers
4 views

MariaDB Inner join is slow

Here is my SQL (with explain): EXPLAIN SELECT * FROM GBI gbi INNER JOIN VF_KRED kred ON gbi.vendor = kred.vendor; Giving below the outcome: Now, the select SQL takes ~10 seconds to produce the ...
0
votes
1answer
20 views

it’s safe to run mysqltuner on production server

Can i run mysqltuner directly on a production server ? It’s will slowdown my server or install some packages ? My users will be affected ?
0
votes
0answers
17 views

Automating cumulative updates [on hold]

My team has been tasked with automating SQL cumulative updates. I have read Kendra's 2016 article on the subject, and we are following up on her suggestions. Meanwhile just wondered whether there are ...
0
votes
0answers
18 views

Are temporary columns a good solution for loading data for a small scale data migration?

Our team is facing the following scenario. We're trying to import data from a denormalized data set in MySQL into a normalized MySQL database and are unsure of what a good solution would be for ...
1
vote
1answer
29 views

Why does setting my column as Always Encrypted change its collation from SQL_Latin1_General_CP1_CI_AS to Latin1_General_BIN2?

I am encrypting a VARCHAR(50) NULL column as randomized. When doing this, the collation is changed from SQL_Latin1_General_CP1_CI_AS to Latin1_General_BIN2. I cannot find any resources explaining why ...
0
votes
1answer
63 views

How to migrate 450+ databases

We have a requirement to migrate an app which has 450+ databases. Manually restoring the backups will be very tidious and we are looking to have a simpler solution. For UAT we used COPY DATABASE.....
0
votes
1answer
16 views

PostgreSQL - PUBLICATION tries to copy the data which already exists in another database?

I have database and table collection_city on one server. It has 21 rows. I have database and table collection_city on second server. It also has 21 rows. They both have this row: tinker=# table ...
0
votes
1answer
11 views

Understanding joined set-returning functions in the FROM list

I am using a construct like this very often: SELECT * FROM my_table, my_srf(my_column) for example here: CREATE TABLE my_table ( my_col text[] ); INSERT INTO my_table VALUES ('{a,b}'), ...
0
votes
2answers
20 views

Getting Ranked Position - SQL - Simple Query

I have a very simple database structure and am struggling to write a command to find the ranked position of the user. ------------------ id | average ------------------ 1 | 79 ------------...
0
votes
0answers
25 views

MYSQL 5.7 Note Got an error reading communication packets

134359 [Note] Got an error reading communication packets Appears in logs every 5 minutes, I have seen a few similar posts on here however none actually match the error I'm seeing here. MySQL 5.7 - ...
0
votes
1answer
50 views

Setting up SQL Server Developer Edition

I just installed SQL Server Developer Edition and SQL Server Management Studio, how can I configure the server? I want to configure it to have server name localhost-sql-server, with a login/password. ...
0
votes
0answers
28 views

Mysql takes long time on “sending data” thread, and select are to slow to execute

When loading of server rise above 500 query per sec, there are appearance threads with State "Sending data". And those threads i see very long time (more then 300 sec). Then all my applications witch ...
0
votes
1answer
23 views

Detect bottleneck of server via psycopg2

I have PostgreSQL superuser called "admin" which can connect to a PostgreSQL database. I am not managing the database server. I have no root-access to this machine. Sometimes the performance is not ...
0
votes
1answer
25 views

How to change column datatype from float array to integer?

CREATE TABLE x (y _float8); ALTER TABLE x ALTER COLUMN y SET DATA TYPE int4 USING (y::int); ERROR: cannot cast type double precision[] to integer How can column y be converted to an integer?
2
votes
1answer
79 views

why the processing is sometimes terminated , sometimes not

DECLARE @Error int; INSERT INTO Person.BusinessEntityContact (BusinessEntityID ,PersonID ,ContactTypeID) VALUES (0,0,1); SELECT @Error = @@ERROR; PRINT ‘The Value of @Error is ‘ + CONVERT(varchar,...
0
votes
2answers
16 views

Value of prepared statement is listed as error in query string

I have made a Wordpress plugin that writes some data to a proprietary table. The query as shown in the log is: INSERT INTO berichten_devices (device_UUID, article_id) VALUES (%s, %s) If I take ...
2
votes
0answers
7 views

Is it possible to create AWS RDS as replication from external server?

I can't find any tutorial to create a new instance of AWS RDS (MySQL) to be an replication db from an external db server. Is it possible to create one? Thanks.
0
votes
0answers
13 views

How to get the statement that acquired a lock in HANA?

I am reposting my question from SAP SCN, where it was not blessed with an answer. I am trying to write a query or script in HANA that shall provice detailed information about the current locks in the ...
0
votes
0answers
25 views

Common way to handle a changing reference in dependency of status

I am new to SQL an SQLite, so this is probably a silly question. I am designing the data model for a commercial application. While documents (like quotes) are being created, I need to reference to ...
0
votes
2answers
23 views

missing initSID.ora

I learning to use Oracle database, and I just installed Oracle Database 12c Release 2 on my Ubuntu 18.04. I login as sysdba with this following command: sqlplus / as sysdba So far all thing working ...
0
votes
1answer
15 views

using mysql calculate balance of each currency where credit and debit in same column?

With the following MySQL table containing debit or credit "actions" with associated amounts and currency, how is it possible to select all CLIENT_IDs with a non-zero "balance" of each currency? I have ...
0
votes
0answers
6 views

Merge 2 SQL files from backup and actual table

I failed a delete on a particular table and I would like to merge the backup with the actual database I have, only some data were affected since I deleted almost 300 records. I don't want to just ...
0
votes
1answer
20 views

Oracle Database Client Installation 12c minimal install - Centos / Red Hat 7

I'm looking at reducing the Linux package prerequisites when installing the Oracle Database Client 12c on the below headless application server / stack: Install file: V839967-01.zip Application ...
0
votes
0answers
20 views

the “new” record has not yet been assigned

sorry if I stress you, but if I copy the tuples from a .cvs file, I use the keyword 'COPY' instead of 'INSERT', the system answers me that NEW has not been assigned yet. It should be a statement-level ...
3
votes
1answer
58 views

Need help in picking solution and understanding when to add columns vs EAV

I've been working on the following problem for a long time and I can't decide between two solutions. While both would work to solve the problem, neither "feels" exactly right to me. Any advice on ...
0
votes
0answers
20 views

Log shipping - Secondary Server

I am not a SQL Server DBA but I need some advise. I am having a problem with a prod server that’s being pounded by constant queries and data mining. I have a second server that I would like to setup ...
2
votes
1answer
34 views

Return all rows containing specific value in json array

I have the following table: CREATE TABLE [dbo].[Journals]( [Id] [nvarchar](450) NOT NULL, [CorrelationId] [nvarchar](450) NOT NULL, [Version] [int] NOT NULL, [Type] [nvarchar](max) ...
-2
votes
1answer
15 views

subquery problem

select customer_id , sum( value) , date(ap.created_at) , date(ap.updated_at) , cc. name from astropay_payment ap inner join customer c on c.id = ap.customer_id inner join country cc on cc.id = c....
0
votes
0answers
8 views

ERROR 1064: Cannot execute while loop in mysql using variables

I'd like to run the below query to insert into a table in a loop: SET @maxid = ( select max( length( id ) ) from article ) ; SET @x=1; WHILE @x<= @maxid DO INSERT INTO `article_responder` (...
0
votes
1answer
11 views

MongoDB stuck in startup2 state

I have a Mongo replica set (MongoDB server version: 4.0.3) with primiry, secondary and arbiter. Size of database is about 7 Tb. I add a member to replica set. It stucks in sturtup2 mode for a month! ...
0
votes
1answer
11 views

argument 'and' incorrect, sum values of attributes

excuse the disturbance, but a comparison does not give me a boolean value, because the sum of the attributes does not return an integer value, but bigint. How do you add up the values of three queries?...
-1
votes
1answer
41 views

SQL Server RLS vs Oracle FGAC [on hold]

What is the difference between SQL Server RLS and Oracle FGAC. How to decide which one to go for? We already have both the products in place and teams to support the products.
0
votes
1answer
30 views

Moving a hard disk with PostgreSQL data folder to another server

I'm running a NAS server with an SD card mounted as / and RAID-1 storage mounted under /media/hdd. /etc folder is on SD card. PostgreSQL data folder is on the RAID-1 disk. /-+ +- etc | +- ...
0
votes
1answer
54 views

Query to Find Multiple Start Time and End Time on a Single Day based on Boolean Value

I want to find the multiple Start Time and End time in a single Day based on the Boolean value where data is divided into each half hour interval for a day. So Each day is divided into 24hrs/2 = 48. ...
-1
votes
1answer
22 views

Postgres: deadlock for CREATE PARTITION with INSERT

I have a partitioned table named logs with a lot of INSERT transactions. Every day I run a cron job with a query for CREATE PARTITION on this logs table. But it seems INSERT statements block the ...
3
votes
2answers
60 views

Can only specific SQL users be forced to use TLS?

My school would like to develop custom software for some embedded devices. As part of this, we may need the devices to connect to an SQL Server instance. Is it possible to force specific SQL users to ...
0
votes
1answer
23 views

SSIS job — how to create stored procedure that repeats SSIS jobs?

Hey I realize I can probably create a modular parent package that repeats SSIS jobs in Visual Studio itself .... but I know you can execute SSIS packages using a stored procedure in SSMS -- 'exec ...

15 30 50 per page