0
votes
0answers
23 views

How to export settings (Query Execution) with SQL Server Studio Management 2014

Actually, we're migrating from SQL Server 2000 to SQL Server 2014 (approximately 300 servers. With SQL Server Enterprise Manager 2000 and SQL Query Analyzer, we can export some settings (Connections ...
2
votes
1answer
26 views

Order by x DESC - but only continuous rows

I have a table with an ID (integer) and a text field (the name). My current query looks like this: SELECT id, name FROM table WHERE id <= X ORDER BY id DESC X is an ID I get from another query. ...
0
votes
0answers
20 views

How to return a user defined error code through SQL based on the error

I would like to return a user defined error code in my SQL Server stored procedures based on the outcome. For example, if no error takes place, RETURN 0. If a validation error takes place, return ...
0
votes
0answers
41 views

Mysql 5.7 crashes/restarts every 20min

Our situation is bit dramatic because we decided to upgrade to mysql 5.7 (5.7.12-0ubuntu1) from previous server with mysql 5.6 in production (new installation importing dbs from dumps). New server ...
3
votes
2answers
139 views

Copy large table to archive table SQL Server 2012

I have a table with logs of my application that have 161.626.718 rows (and growing) and it's very slow to make a insert on it. My idea is to keep only 6 months of log in the table and all older ...
1
vote
2answers
43 views

Use SQL Script Parameter to Map Drive

I am trying to map a drive to a UNC path where the UNC Path is a variable, but I keep getting an error saying: Incorrect syntax near '+' I execute this script: DECLARE @UNCSourcePath ...
0
votes
1answer
46 views

Corrupt Transaction Log on database

I have reason to believe the transaction log file on my database is corrupt. This database is involved in transaction based replication (both subscription and publishing), and I'm unable to start ...
-5
votes
0answers
37 views

PostgreSQL community channels other than mailing lists and IRC? [closed]

Is there an active channel for the PostgreSQL community other than the official mailing lists and IRC? I'd hope to find a forum-like channel. This is the 21st century after all...
0
votes
1answer
21 views

PostgreSQL9.6 Beta1:new setting remote_apply for configuration parameter synchronous_commit

PostgreSQL9.6 add new setting remote_apply for configuration parameter synchronous_commit, Reading the following document I still don't understand the difference between on the setting on and ...
0
votes
0answers
32 views

How to check the age of a user using triggers

Im new to databases so sorry in advance for maybe obvoius questions. I have a database where i want to block new user registrations if the age of the user is less than 18. How to count the age? ...
2
votes
3answers
46 views

How to send SQL Server database backups to OneDrive for Business?

I have five databases in SQL Server Express, and now I need to find out what is the easiest way to make regular backups and send all these backups to OneDrive for Business?
2
votes
1answer
49 views

Calculate path to node in a tree

The following is part of a bigger system. The tree data table and temporary table cannot be changed easily so I need to work with those. The tree structure is more complex (deeper and wider) but the ...
0
votes
2answers
81 views

What is difference between JOIN and simple query

I have two tables in database one is Orders and another one is customers Orders Table Contains : OrderID , CustomerID and OrderDate Customers Table Contains: CustomerID , CustomerName , ContactName ...
1
vote
0answers
16 views

Find the number of rows in a table from metadata

I want to write a single select statement to determine the number of rows in a set of tables in Sybase IQ. In SAS, I write this as CREATE TABLE dsnobs as SELECT libname,memname,nlobs, datetime() ...
0
votes
0answers
7 views

Ops Manager alert “Host is down” no info in mongodb.log, automation-agent logs and /var/log/messages

We received Host is down alert (Ops Manager - Alert - XXX - 2016-05-18T23:32+0200) I checked mongodb.log on all 3 replica set members. I see only logs about index creation, looks all healthy to me. ...
0
votes
1answer
33 views

Modify Backup Directory Path Ola Maintenance Script

I have configured backup using SQL Server Maintenance Solution by Ola (https://ola.hallengren.com). In the backup job, I specified BackupDirectory as a shared folder (eg: \comp1\path). It worked ...
0
votes
1answer
65 views

How to optimize query with order by

Have query which generate OpenERP ORM. Table have 100k rows. SELECT "tbl".id FROM "tbl" WHERE (("tbl"."active" = 'True') AND ("tbl"."is_company" IS NULL or "tbl"."is_company" = false )) ORDER BY ...
0
votes
0answers
6 views

Django Auth user as well as custom users table?

So we've been using djangos database authentication for a while now and have recently decided we want to implement a completely new login system for our website. We are keeping the django ORM as we ...
0
votes
1answer
28 views

How to know current logins and what are they do in SQL server? [closed]

How to know current logins and what are they do in SQL server?
0
votes
1answer
31 views

PostgreSQL values to unique dictionary

I have table with one billion rows and more than 50 columns. I need to reduce size and speed up queries, backup, exports, etc. Some columns contain f.e. only hundreds of distinct values which are long ...
2
votes
0answers
40 views

Insertion into postgres database stops (hangs) after table reaches a certain size without error

We are currently trying to insert a large amount of data, about 27 million records with 200 columns, into a single table in a postgres 9.4 database. (Yes it is probably better to refactor the table ...
0
votes
1answer
34 views

DDL doesn't work in MySQL master to master replication while DML can work?

I have two master in replication left master -> 5.5.47-log MySQL Community Server (GPL) rigth master ->5.5.47-log MySQL Community Server (GPL) "left master" mysql> create table test.left ...
1
vote
1answer
27 views

When PostgreSQL will use Index Only Scan over Bitmap Index + Heap Scan

Today I've been doing some reading on the difference between the two and I think I've got a reasonable idea of each. Index Only: Accesses heap pages as it moves through the index, possibly access the ...
0
votes
0answers
12 views

Grand read privilege to the user but is not allowed to grant the same privilege to another user?

i am a noob and this is how far i got so far, thanks and also how would you do it if you want to allow user to grant the same privilege to another user. GRANT SELECT ON DATABASE_NAME.* TO USER;
0
votes
0answers
16 views

Software to manage ERD [on hold]

We have a small database (Around 50 tables) under development, and I am being asked to produce an ERD for the development team when ever a change is made. Using Management Studio is tricky, because we ...
0
votes
0answers
43 views

How to avoid an Index Spool [closed]

I have a scenario wherein my SQL Server 2012 production server is generating an execution plan using Index Spool to read a billion rows and to filter 40. This is a complex query being generated ...
-3
votes
0answers
15 views

Creating a Known Error Database [closed]

I was looking for some insight in creating a simple KEDB. At first, it needs to store a simple solutions. It will have web interface.
0
votes
0answers
37 views

Calculating Hoursworked [closed]

CHECKINOUT Table: USERID-----------CHECKTIME ---CHECKTYPE 7 -------------2016-01-08 13:29:41 -----------0 7 -------------2016-01-11 15:16:06 -----------I 7 ...
0
votes
1answer
45 views

Unable to install MySQL 5.7.12 in RedHat in a separate directory

I am trying to install the MySQL version 5.7.12 into RedHat in a non default data path. The installation syntax used /app/mysql/5.7/bin/mysqld --initialize --user=mysql --basedir=/app/mysql/5.7 ...
1
vote
2answers
29 views

Scalable way to track who's viewed a post? [closed]

I'm building an app that needs to check who, out of millions of users, has not received a post. If a post hasn't been seen by many people, this task will be easy. But if a post has been seen by nearly ...
1
vote
1answer
13 views

Is there a way to connect a Postgres 9 database client to a Postgres 8 system?

I a now work mainly with Postgres 9.5, but I alsoo need to connect to a number Postgres 8 databases connect them probably as different schemas, if that is possible. Are foreign database wrappers the ...
1
vote
1answer
17 views

FreeTDS TSQL connect string

I am unable to connect to a MSSQL 2012 Server using FreeTDS on OSX in the terminal when I pass the -P . Example: V-MBP:etc vashavoc$ tsql -S SERVER_IP -p PORT -U USER -P PASSWORD locale is ...
3
votes
0answers
42 views

how do i create an automated sql restore script for multiple backups?

Hello to all SQL gurus out there. I basically have 6 daily sql backups (.bak) that need a restore everyday. I want to automate this process by having the sql agent run the script daily. I have the ...
0
votes
0answers
14 views

AWS DMS creates tables with no auto_increment

I am migrating my databases to Amazon's RDS using their DMS tool. Pretty much everything looks great except that columns that were marked as auto_increment on the source database did not get marked ...
2
votes
0answers
19 views

Logical condition when declaring handler procedure

I have a procedure in MySQL that executes a handler for SQLEXCEPTION to read the errno code and insert it to a table. DECLARE EXIT HANDLER FOR SQLEXCEPTION BEGIN GET DIAGNOSTICS CONDITION 1 ...
2
votes
1answer
39 views

RedGate SQL Prompt - Cursor Snippet mistake

Using RedGate's SQL Prompt & loving it. But I used the "curff" snippet for the first time today ("Fast-forward read-only cursor"), and it produced the following TSQL (which I've filled in to make ...
0
votes
1answer
22 views

SQL Server 2012 Patching Service Pack and CU Question

I am tasked with updating a SQL Server 2012 from a version(11.0.5623.0) before SP3 all the way to SP3 CU2. Can I install both patches without a reboot until afterwards? All the documents I have found ...
5
votes
2answers
163 views

Running query against DMVs for Query Stats and Execution Plans joined to sys.databases

I originally posted this as a different question in Twitter #sqlhelp, but wanted to post it here differently. I'm trying to create a job that tracks worst performing statements for various statistics ...
8
votes
2answers
108 views

Recursive CTE to find Total for all children

Here is an assembly tree that I want to search using a recursive T-SQL Query (presumably CTE) with the expected results below. I want to know the total amount per assembly given any part. Meaning if ...
3
votes
2answers
36 views

SELECT other rows based on one matching row

I am trying to get related rows in a tag table based on one tag, where "related" means "having the same area_id". Example: tag area_id -------- ------- turkey 1 stuffing 1 carrots 1 ...
0
votes
2answers
34 views

sql - Pulling specific digits from place values

I'm wondering if it's possible to pull the digits at specific place values in a number with SQL. For example, the number 7654321 is stored in the database. I want to pull out the number at the one ...
1
vote
0answers
36 views

How to recover LogMiner after its tablespace had been deleted?

Here is my story: I created separate table space for Log Miner, create tablespace logminer_ts datafile '/path/to/logminer.dbf' size 50M AUTOEXTEND ON And moved Log Miner to the created table ...
0
votes
1answer
22 views

HADR procedures

We are thinking of a SQL Server 2014 + Windows Server 2012 configuration for a HADR scenario. My questions are: on a HA scenario, how does the primary server get updated once it is again available ...
0
votes
1answer
24 views

fix `mysqldump: Error 2013: Lost connection` on “cloud” server

I have 6 months of backups left to perform and a single day can take up 200MB in raw mysqldump --extended-insert=false --complete-insert form. If I try to dump more than a day worth of data I get ...
0
votes
0answers
14 views

How do I set an SSIS Sql Agent job to unexpected error or failure?

I was running a series of SSIS packages in a SQL Agent job on a virtual server when the server was shutdown - hard. The package execution report shows it as still running even though I believe it is ...
0
votes
2answers
43 views

CASE with max()

I know how to do this in SQL Server but Postgres is different. I want to return the max employee pay. Select b.enumber, b.bday, case when Max(c.id) then c.pay ELSE c.pay End As "Current Pay" From ...
1
vote
0answers
13 views

SSRS: UserName value in Subscriptions table, ExtensionSettings column

SSRS subscription to a Windows File Share. Is there a way to query for all the "credentials used to access the file share" in plain text? It appears that the UserName value in the ExtensionSettings ...
1
vote
0answers
40 views

Bulk Insert into view and find missing values

I have 2 tables, Categories, and SubCategories: CREATE TABLE [dbo].[tbCategories] ( [CategoryID] [int] IDENTITY(1,1) NOT NULL, [CategoryName] [varchar](250) NULL, ) CREATE TABLE ...
1
vote
0answers
12 views

SQL Server 2012 certificate encrypt connection

I'm not a DBA by trade. My organization doesn't have a dedicated DBA, we have to just figure things out. I have a SQL Server 2012 Enterprise installed on a Sever 2012 R2 OS. It is a not in a SQL ...
1
vote
2answers
63 views

Update table using values from another table in SQL Server

I have 2 table in my database. Table #1 ------------------------------------------------------------------------- | name | family | phone | email | gender | phone2 | address | birthdate | ...

15 30 50 per page