All Questions

1
vote
2answers
54 views

sys.dm_db_stats_properties seems to be misbehaving for a small table - how to get the number of records of a table in a different way?

I have this table in one of my databases: IF OBJECT_ID('[dbo].[repl_Gender_Type]') IS NOT NULL DROP TABLE [dbo].[repl_Gender_Type] GO CREATE TABLE [dbo].[repl_Gender_Type] ( [Gender_TypeID] CHAR(...
0
votes
1answer
40 views

SELECT columns which contain data first [on hold]

I have result of a query as below first table but the requirement is to display columns first which contain data in it. Result: Requirement: Sample data generation: Create table #CustData ( ...
0
votes
0answers
20 views

how to dump mysql schema without keys and without constraint ? and keep all of them to alter afterwards

i am using ubuntu 16.04 and want to dump large schema with hounded of tables from AWS rds, remove all keys and foreign key , load data and then add back the keys , is there any automatic tool that ...
0
votes
1answer
23 views

How to grant permissions to database but restrict to certain schemas?

I am new to database administration and work within a small team of data analysts trying to modernise. We have recently set up an Azure SQL DB server we are accessing using SQL Server Management ...
0
votes
0answers
35 views

How to find machine name (host name) from which failed login attempts are coming? [on hold]

Today we have a password expiration day for some domain accounts, and SQL Server started to throw alerts "DESCRIPTION: SSPI handshake failed with error code 0x8009030c, state 14 while establishing ...
1
vote
2answers
19 views

Query “all of” across many-to-many relation

Imagine a setup of three tables, User, Group, and UserGroup, where UserGroup consists of simple a foreign key to each of User and Group tables. User ---- id name Group ----- id name UserGroup ------...
3
votes
2answers
294 views

SQL Server placement of master database files vs resource database files

In a post on SqlServerCentral.com, it is mentioned by several people that the files for the Resource database (mssqlsystemresource.mdf and ldf) should be placed in the same folder as the master ...
1
vote
0answers
24 views

PostgreSQL query report with dates

I'm trying to build report from my access control database system in order to count work hours duration of each employee. So, there are two tables: CREATE TABLE log ( id integer, logtime ...
5
votes
4answers
1k views

Writing a T-SQL stored procedure to receive 4 numbers and insert them into a table

I need to write a stored procedure to receive 4 numbers and insert them into a table. This is what I've developed so far: Declare @1 Int = 10, @2 Int = 20, @3 Int = 30, @4 Int = 40 Create ...
0
votes
0answers
9 views

Can I use EBS data directory path as temp tablespace in ADS Aurora Postgresql?

I am having issue with RDS Aurora Postgresql's root storage (which is used for Temp files/tables and Logs) since its basically 2*PhysicalMemory. I thought of creating a new tablespace in data storage ...
2
votes
0answers
24 views

How to model a set of unique objects?

I have an entity type called 'Object', and I need to model an object set as a list of unique objects with variable length. Then, each object could belongs to many object sets. Current entity-...
-1
votes
0answers
16 views

how to add specific dates to the below script [on hold]

SELECT * FROM ( SELECT couponcreatedate AS "Issue Date", count(*) AS "Issue Count", round(sum(cast(couponmaxvalue AS numeric)) / 100, 2) AS "Max Value" FROM coupons AS c GROUP ...
-1
votes
1answer
52 views

Job with a cursor is abnormally slow [on hold]

I have a query that takes more than 9 hours to complete. Looking at the execution plan, I find this high-cost operator (query plan link): How can I improve this job?
2
votes
1answer
188 views

Indexes with the same object_id but different names

When I run SELECT count(object_id) AS count, object_id, min(name) as name1, max(name) AS name2 FROM sys.indexes GROUP BY object_id HAVING COUNT(*) > 1 ORDER BY count I will get a list ...
1
vote
2answers
18 views

uniqueness in array column type throughout all records

There is a table id serial primary key, names varchar(20)[] it contains such record 1, {"one", "two", "three"} Then, next record is inserting (notice one array element already exists in existing ...
0
votes
0answers
9 views

Connecting PostgreSQL database created on Ubuntu to pgAdmin [on hold]

I have created a PostgreSQL database on Ubuntu 18.04 LTE and am trying to connect to the database using pgAdmin. How can I set the server ready for the remote connection? And how can I set the ...
0
votes
1answer
16 views

Why mysql multiple column index match from left?

Why MySQL using union index from left? For example union index(a,b,c),(a) could using index,(a,b) could using index,but (b,c) could not using index!!!Any useful tool to probe MySQL index file ...
1
vote
1answer
20 views

Temporary role/privileges

Is it possible in PostgreSQL to temporary grant roles/privileges to a user? I'm thinking about this as a solution for the situation when there is a need to troubleshoot an issue and an user may need ...
0
votes
1answer
47 views

Performance Issues on MSSQL Server Web Edition [on hold]

I am facing some performance issues on my MSSQL Server which is a Web Edition. My database size is around 3 TB and there are continuous inserts that happen through various processes. We also have ...
1
vote
1answer
20 views

How does postgres host based authentication work?

This is a duplicate of: https://stackoverflow.com/questions/55804806/how-does-postgres-host-based-authentication-work (I was asked to shift this query to DBA.Stackexchange) I am installing DSPACE ...
0
votes
1answer
16 views

Relation with many roles - Logical Model

I have an assignment where I am asked to draw a logical model. The data is for a hospital where each doctor can have three roles: supervises a patient requests for a procedure carries on a ...
-2
votes
0answers
35 views

SQL Server's “restore headeronly from disk = N'Path to file' ” returns an empty row [on hold]

My questions is: In what scenario will executing the following command, result in no row being returned: restore headeronly from disk = N'Path to backup file' There isn't even an SQL exception. ...
1
vote
0answers
24 views

Design for tables with the same column value but different names

I have the following three tables: doctors (Doc_id, Doc_name) patient (patient_id, patient_name) admission (patient_id, sup_Doc, date) What is the correct way to go about linking the doctor and ...
0
votes
1answer
20 views

How to set up signed SSL Root and Leaf certificates on a PostgreSQL 11 database on Ubuntu and Windows 10 Power BI plus PostgreSQL?

I have Power BI and PostgreSQL 11 installed on Windows 10 and my primary PostgreSQL 11 database on Ubuntu 18.10 Linux. I edited the postgresql.conf and pg_hba.conf files correctly to the IP Adresses ...
-5
votes
0answers
26 views

which will be faster in oracle 12c? [on hold]

Our Current ETL has the following code, to me, it seems messy, I want to make sure the below new code performance will be better than old code. Will this improve the performance ? old code: select ...
-1
votes
0answers
16 views

One long table vs many smaller

Our plugin-style platform has several plugins ( like forum, group, simple mail/chat, etc.) which all have share common features : file and event_log. Their structure are rather simple and can serve ...
0
votes
1answer
29 views

Should you create separate tables for fixed options for a column?

As shown below, in multiple places in my DB Design I am creating tables for "options" if you will. Example, RFP Stages. Which would hold things like "Complete", "Bidding", etc. I'm doing this ...
1
vote
1answer
24 views

The MS documentation on FILESTREAM makes it sound like it should only be used for archiving unstructured data. Am I misunderstanding this?

I am building an application that will store small image files (probably less than 1 MB typically) associated with records. I am considering the FILESTREAM option in MSSQL, but I'm a little confused ...
3
votes
2answers
68 views

Checking IFI enabled on SQL server below 2016

I am using in one of my reports to check for status of IFI being enabled on SQL server. It works well when using dmv sys.dm_server_services for SQL2016 However, in SQL2014 and SQL2012 i see ...
0
votes
0answers
18 views

Is it possible to change the color of relationship lines in MySQL Workbench diagrams?

I have MySQL Workbench Community Edition 8.0.15 installed on my Mac OS 10.14.3. I'm currently working on making an ERD with Workbench's EER Diagram. My problem is that whenever I export my diagram, ...
0
votes
1answer
18 views

Missing Encryption Key when migrating Reporting Services from SQL Server 2008 to SQL Server 2016

Owing to a ransomware attack on our production server Reporting Services went down. This server was installed few years ago and its been in production for long. We have quite a few reports on this ...
0
votes
1answer
7 views

SSAS Tabular model table load from query with #temp table fails

We have several situations where complex queries are being used for creating/populating tables in our SSAS tabular model. The actual use cases cannot be presented here, due to both proprietary ...
0
votes
1answer
31 views

Index for VARCHAR column has low efficiency

I have two tables with relationship one to many. create table locations ( id bigint auto_increment primary key, location_id varchar(128) null, constraint ...
-1
votes
1answer
37 views

if and else condition in select query

I want a query in which if and else will use but I do not know how it will use,below is my table structure ,i want result below mentioned after Produce table. Item Master Table item_code ...
0
votes
1answer
16 views

Using views with no insert table VS Audit tables

I(not a DBA) am considering designing Audit tables for an application that needs to be really fast as well fully audited (undo is not necessary). I referred to some from so and I found variations of ...
0
votes
0answers
16 views

Run two external processes in parallel using a table as a queue [on hold]

I am currently making use of sp_execute_external_script to run either one R script or another based on parameters that are stored in a Jobs table. A custom application feeds data into that Jobs table. ...
0
votes
0answers
16 views

Performance considerations for using MySQL table as a queue?

I'm working on a system which reports certain events to an external service. Whenever a relevant change is made in the database, we want to guarantee that at least one message is sent to the external ...
0
votes
0answers
20 views

Calendar Table with multiple columns, not rows

so I am looking to create a scheduler in Visual C# that links to a SQL Server Database. I am using SQL SMS V18 and SQLServer Express. So, in my search for answers, I found the script (query?) below. ...
-2
votes
1answer
96 views

How efficient is an inner join? [on hold]

Suppose I have a DB with the following two tables: Table_users ID, name Table_userInterests user_ID, interest Query A SELECT * FROM Table_users Query B SELECT Table_users.*, ...
0
votes
0answers
38 views

Oracle SQLDeveloper lost connection

I have succeeded in installing Oracle SQLDeveloper together with Oracle Database 18 and 12 releases . My machine is Ubuntu 18.04 (amd64). As a total newbie to Oracle Database I've got 2 questions: ...
-3
votes
1answer
25 views

Definition of extended event session [on hold]

Is there any complex EE session that can be used to collect performance data on SQL server on daily basis (Queries and their plans , waitings , blockings ,lockings ) , I want to create such session ...
0
votes
1answer
12 views

MySQL 8.0.15 starts normally but any connection hangs

I dropped a large table (80G) Friday morning and got a crash: InnoDB: ###### Diagnostic info printed to the standard error stream 2019-04-19T18:48:55.445507Z 0 [ERROR] [MY-012872] [InnoDB] Semaphore ...
1
vote
2answers
39 views

Removing values from array in postgreSQL

Lets say I have a table called users, who looks something like the following: users table: |user_id | name | 1 Bob 2 Alice 3 Joe 4 Tom And ...
0
votes
1answer
12 views

Getting TNS Name from connection string

I normally connect to my Oracle database at work using a connection string. Other then the obvious answer of asking the DBA what it is, using SQL Developer or some other tool can I find out what the ...
-1
votes
0answers
35 views

using SUM in a Nested CASE Statement

Table_1 ‘Date’ -- Date format dd/mm/yyyy ‘Campaign_Id’ -- Integer Variable ‘Campaign Name’ -- Categorical Variable ‘Conversions’ -- Continuous Variable ‘Device’ -- Categorical ...
0
votes
2answers
37 views

Counting occurrence a record based on consecutive days

I have a query to display record of stationary issued according to date. SELECT date,stationary_id FROM stationary_issued How do i check if a stationary was issued in consecutive days.I have tried ...
-1
votes
0answers
38 views

Create Availability Group in SQL Server 2017 [on hold]

I have a setup of Windows Server Failover Cluster with 3 servers: one Primary, one Secondary, & one Domain Controller, & I have installed SQL Server 2017 and Microsoft Server Management Studio ...
1
vote
0answers
50 views

Slow ORDER BY with large and small tables

I have one small table (200 rows) and two large tables (200k rows each). Small table has primary key id and some other fields. First big table has id field (not a primary key), which are duplicated, ...
0
votes
0answers
13 views

mysql Replication stalled

I am having mysql 8.0 installation with replication between 2 servers in master-master configuration. While data is being replicated from server A to server B the replication is stalled from hours. ...
0
votes
0answers
27 views

Clustered Index in Postgresql [on hold]

I know that, PostgreSQL does not nominate indices as clustering indices by default. If I want to have clustered index, I can manually cluster a table along an index. But I have question about that. ...

15 30 50 per page