All Questions

Filter by
Sorted by
Tagged with
-1
votes
0answers
38 views

How to insert data in column based on data from other two column in mysql [migrated]

I have 3 columns on table named loan. first column named approved_by_asm which holds integer value 0,1 or 2 second column named approved_by_rsm which holds integer value 0,1 or 2 and third column ...
0
votes
2answers
22 views

Work around average behaviour with nulls

I have two tables: Product (PK product_id, brand, model) Order (PK invoice_id, customer_name, customer_email, FK product_id) I am trying to find the product(s) whose number of times that product is ...
1
vote
1answer
35 views

Explanation for second Compute Scalar

I noticed a peculiar thing. This query declare @t int = 3; select distinct top(@t) Number - Number + ABS(CHECKSUM( CAST(NEWID() as binary(16)) )) from Numbers as n; produces this plan dbo....
0
votes
0answers
12 views

Creating subscriber for replication without initialization?

Just wondering - I am sitting here for past 30 minutes waiting for Subscriber to finish initialization for Merge Replication. Could I skip this step somehow? and skip snapshot creation? I have: ...
0
votes
0answers
17 views

Structure of a project management database

I will do my best to explain my problem as precisely as possible but please feel free to ask questions if anything is unclear. I want to create a DB where Projects are billed. In general there are 2 ...
-2
votes
1answer
32 views

Merge Multiple Selects in one request [closed]

I have to extract a data using selects statements based on same conditions with a little change, I would like to make union for all my select in one statement: select Date_, application_name,count(...
0
votes
2answers
24 views

Database table archiving

I am trying to create a stored procedure (SP) in order to archive a table within my production database which is about 1TB. The production DB runs on Linux SUSE OS and the destination location for ...
-1
votes
0answers
12 views

My SQL Query getting hanged in linux setup of mysql [closed]

ALTER TABLE `table_name` ADD `Table_Column_2` INT NOT NULL DEFAULT 1 AFTER `Table_Column_1`; I am working with Alters, Executed this query on Localhost (windows setup MySql) successfully, When it ...
1
vote
0answers
40 views

SQL Server 2019 and TDE

We are about to move away from SQL 2008R2 to a much newer version. We upgraded to the Enterprise Edition of 2008R2 just for TDE, but I was just browsing here: https://docs.microsoft.com/en-us/sql/sql-...
2
votes
3answers
60 views

“Network-related or instance-specific error” while attempting connect to a SQL Server on remote computer on home network

I have two laptops (both running Windows 10, 64-bit) connected to my home network using wifi. Here are details about each laptop (please ask if you need more info): Laptop #1 2017 Microsoft SQL ...
0
votes
1answer
13 views

How to login into mysql shell from localhost instead of '%'?

I need to grant a permission to a newly created user. I have access to root. But, i can't grant a permission to a new user. When I run: grant all privileges on 'newuser'.* to 'newuser'@localhost; I ...
1
vote
0answers
24 views

pg_stats is huge and slowing PostgreSQL server down… What do I do?

I have two servers running PostgreSQL 10.11 that are configured the same, contain the same databases and mostly the same tables. Various Nagios checks using check_postgres check these servers on a ...
2
votes
0answers
50 views

SQL Browser Service Stops After One Minute

I am encountering an issue with the SQL Browser service where the service will start, run for around 60-90 seconds and then stop. No error is logged, the event logs show three informational entries: ...
0
votes
1answer
31 views

Columnstore Index maintenance and finding fragmentation

We are using clustered columnstore indexes and partitions in SQL Server 2014. Some tables have a lot of updates and we find ourselves with a lot of deleted rows for some partitions. In our tests, a ...
1
vote
2answers
42 views

Error while running sp_blitz in 2008 SQL Server and lower versions

I have created an SSIS package to run sp_blitz in my production servers. The stored procedure runs fine for servers having a version higher than 2012 but fails for 2008 and 2005. Please find the ...
1
vote
1answer
16 views

Trying to understand TID defenition from documentation

I trying to understand what is TID and how it works. I found 2 definitions of TID in documentation: 1) from https://www.postgresql.org/docs/11/datatype-oid.html A final identifier type used by ...
1
vote
1answer
56 views

Where to download SQL Server 2019 Express LocalDB Installer MSI from

SQL Server 2019 is released but I there doesn't appear to be a LocalDB version available for download. Does anyone know if there will be a LocalDB release or if 2017 is the last version?
1
vote
1answer
54 views

Temporal Tables Granularity

I've start using temporal tables on SQL Server 2017 and I've noticed that rapid updates aren't recorded in the history table. Does anyone know if this is configurable or do I just have to live with ...
0
votes
1answer
56 views

Script to install Oracle client 12c2 on Redhat linux 7.5

Can someone help me to provide a script which I can use to install the Oracle client as part of the server build or AMI. Below script I was able to pull out from the guide in the Oracle site. But ...
-1
votes
0answers
7 views

View individual tables by iterating a table list [closed]

Retrieve the tables with: #+begin_src sql :engine mysql :dbuser org :database grocer show tables; #+end_src #+RESULTS: | Tables_in_grocer | |------------------| | Customers | | OrderItems ...
-1
votes
0answers
6 views

I need some help with SQL [closed]

when I try to insert this: /* Insert data for moives, actors and move_cast */ /* FORMAT of the insert command ---> INSERT INTO movies VALUES (condition, format, genre, store, year, 'Title', '...
1
vote
0answers
38 views

Test if I have too many TempDB Files

I know there are ways to test for tempdb contention to see if you need to add more tempdb files, but how can I test (and maybe prove) if I have too many tempdb files? I've inherited a relatively ...
-1
votes
0answers
18 views

Permissions required for MongoDB service account

I am new to MongoDB Administration. Have SQL Server DBA background. I want to configure my MongoD service as a service that starts up automatically without having to issue the command mongod.exe every ...
-1
votes
1answer
22 views

DATEPART YEAR from 'yyyymmdd' Formatted Date

I'm working with a table that stores the date field as 'YYYYMMDD' and I need to filter the query by the YEAR, using the DATEPART from that same date field. WHERE DATEPART(yy,'YYYYMMDD') = 2018
0
votes
1answer
32 views

One query should be better but I can't see the performance improvements

I've been tasked with optimizing queries. I have the query below SELECT vd.video_id, vd.video_name, vd.video_title, vd.video_description, vd.video_duration, vd.logo, vs.balance_mobile ...
0
votes
1answer
27 views

mysqldump generating inconsistent dumps

I cannot get mysqldump to generate a dump that will properly restore. The dump is being generated to setup a new slave, but whenever the slave starts up, it gets foreign key constraint failures. I'm ...
9
votes
3answers
217 views
+100

Help performance tuning master/detail (email like inbox) SQL query

I have spent the last couple days searching, watching videos, and I think I've gotten as far as I can get just fumbling my way through. I am looking for more specific direction given my example below. ...
0
votes
0answers
24 views

DML vs DDL for Live Databases [closed]

I have been trying to play catch up to make sure that I am making changes to my databases/tables correctly for live environments. My concerns stem from attempting to add a column to a live/online ...
2
votes
1answer
26 views

How to decrypt dtsx package?

I've got some SSIS packages stored as varbinary, and I can load them into a temp table like so: Use SSISDB if object_id('tempdb..#package') is not null begin drop table #package end ...
0
votes
0answers
20 views

Azure Data Studio PowerShell Error when updating Python

I am trying to do some testing with notebooks and when I open ADS I get prompted to update Python. When I click yes and the install begins, I get this error. Could not start session: Installing ...
0
votes
1answer
55 views

MS SQL delete + insert VS insert into temp table + delete not in + insert not in [closed]

I'm working with a table of about 3 million records and I'm left and inner joining around 5 different tables which have complementary information and then selecting about 10 or 15 fields in total, ...
0
votes
1answer
18 views

Could you monitor all changes made within a postgresql database by somehow subscribing to the replication log?

I've been reading about postgresql replication and was wondering if it was somehow possible to listen to the replication binary log and push that to some tool like sumologic or splunk so that any ...
-3
votes
0answers
25 views

Shared multiple SQL instances in a single VM/Server [closed]

I need advise from you, We have two server and one hosts shared SQL server that host a number of SQL instances mainly OLTP. The second one hosts our data warehouse. We are currently migrating to a ...
1
vote
1answer
19 views

Select rows within group before condition is met

I want to select rows within each group following a condition in time. I have the following table trajectory_data in PostgreSQL 10 with daily points for each group. | traj_id | timestamp | height |...
-1
votes
0answers
5 views

Service Broker not working in sql name instance

We have sql server having 2 instance. Service Broker is working in default instance, but it is not working in named instance. We already enabled in sys.databases. But when we trigger, we didn't ...
2
votes
1answer
35 views

Linked Server Timeout - Not Queried

I have a job that runs for multiple regions across the globe. Depending on what region is running and what time zone it's in, the job might not run. It uses GOTO to get to the end and reports that it ...
3
votes
5answers
133 views

Restore a database with a different name on the same server

I need a copy of a live database called Carers on the same server for testing purposes. The test database name will be Carers_Test. I took a backup of Carers using SSMS. And tried to restore it using ...
-2
votes
1answer
45 views

ORA-01427: single-row subquery returns more than one row [closed]

Below query is throwing this issue but when i add the condition rownum <=1 it is updating single row , but i want to update the entire table not the single row UPDATE footnote p SET p.tac_id = ...
0
votes
3answers
59 views

How do you generate a build script for all views [duplicate]

I would like to create a build script that can run through and recreate all views (and stored procedures too, but one step at a time). I am trying to create a baseline of all of our user databases (...
1
vote
1answer
32 views

Distribution statistics on VARCHAR / VARGRAPHIC columns?

It appears that only the first n characters is used as colvalue for varchar/vargraphic columns. From my test below it appears to be 33/16. Is the length documented somewhere? I tried to search the ...
0
votes
0answers
15 views

Log Reader Agent is not starting

I have setup transactional replication on SQL SERVER 2014. It was working fine yesterday. Today, I am seeing below error. How to investigate what is the problem. Why log reader agent is not starting ...
0
votes
0answers
27 views

Postgres Audit Table

Is it good practice to use a table in Postgres as an audit log for login events? The database has other tables like users, posts etc. If the backend receives a failed login, it would insert into the ...
0
votes
0answers
19 views

Galera cluster problem after full crash with mariadb

I have a galera cluster with 2 mariadb nodes running. I know that this isn't best practise but I hadn't a chance to do it in another way. I had a crash and needed to reinitiate the cluster on one ...
0
votes
0answers
21 views

SARGABLE predicate must be in DNF. Why?

This famous paper about finding Access Path in Relational Database Management System by Selinger et al. says the following about criteria tree and predicates (at the end of 3rd section). A sargable ...
-1
votes
1answer
15 views

How to log parameter values of stored procedure using sp_whoisactive? [closed]

I am able to log the sp-names in a table using sp_whoisactive successfully but not able to log parameter’s values with sp-routine names, is it possible in it ?
0
votes
0answers
24 views

How to import db-sample-schemas into Oracle's DB?

I need to import some sample dump file for educational and testing purposes. I've found the next dump file and tried to import it using: imp testuser/oracle file=/home/oracle/PurchaseOrders.dmp ...
0
votes
1answer
22 views

Can Oracle SE2 RAC works with only a single instance? Is it recommended?

I've got a client with an Oracle DB 12 SE2 RAC with two instances. One of the instances is giving too much problems. He wants just to remove it, and therefore leaving Oracle RAC running in only with ...
0
votes
0answers
7 views

Applying batch of row changes (delete) MySQL Replication Stuck

I am using Master Slave replication for master and slave . Master Configuration 64 GB RAM 2 TB SSD Slave Configuration : 16 GB RAM 2 TB SSD My database size is 750 GB. When i configured ...
0
votes
0answers
28 views

Need to reduce the tempdb size in a disk not by restarting the sql SERVER and shrinking the files not worked [closed]

Need to reduce the tempdb size in a disk not by restarting the sql SERVER and shrinking the files not worked
4
votes
1answer
49 views

Insert multiple rows into a table with only an IDENTITY column [duplicate]

I have a table called dbo.Groups defined like this: CREATE TABLE dbo.Groups ( GroupID int NOT NULL IDENTITY (1,1) PRIMARY KEY ); The table really consists of just the one IDENTITY column. ...

15 30 50 per page