Most Popular

1500 questions
23
votes
1 answer

What is the reasoning behind the CAP theorem?

http://en.wikipedia.org/wiki/CAP_theorem http://www.cs.berkeley.edu/~brewer/cs262b-2004/PODC-keynote.pdf I think it is not very straightforward why only two of Consistency Availability Partition tolerance can hold for any given distributed…
Lazer
  • 3,351
  • 15
  • 42
  • 53
23
votes
3 answers

How often to backup the master database?

The suggestion in BOL is fairly vague: Back up master as often as necessary to protect the data sufficiently for your business needs. We recommend a regular backup schedule, which you can supplement with an additional backup after a…
8kb
  • 2,629
  • 2
  • 32
  • 35
23
votes
3 answers

Parent-Child Tree Hierarchical ORDER

I have to following data in SQL Server 2008 R2. SQLFiddle Schema: CREATE TABLE [dbo].[ICFilters]( [ICFilterID] [int] IDENTITY(1,1) NOT NULL, [ParentID] [int] NOT NULL DEFAULT 0, [FilterDesc] [varchar](50) NOT NULL, [Active] [tinyint]…
Archangel33
  • 417
  • 2
  • 4
  • 11
23
votes
2 answers

Referencing system views in SSDT?

I've imported a database into SSDT containing a reference to a system view (specifically, sys.columns). The problem is, that I then get warnings about unresolved references when I build the project From what I've seen on MSDN forums, it looks like…
TomGough
  • 281
  • 2
  • 8
23
votes
2 answers

PostgreSQL: Cannot change directory to /root

I am trying to copy a table planet_osm_polygon from one database osm to another test. I su postgres and performed the pg_dump. Problem: However I'm getting the error could not change directory to "/root" and the Password: prompt appeared twice! Is…
Nyxynyx
  • 1,121
  • 6
  • 17
  • 28
23
votes
1 answer

Is "+" slower than "CONCAT" for large strings?

I have always thought that CONCAT function is actually a wrapper over the + (String Concatenation) with some additional checks in order to make our life more easier. I have not found any internal details about how the functions are implemented. As…
gotqn
  • 4,016
  • 11
  • 48
  • 84
23
votes
3 answers

How to search for a specific column name in all the tables in MySQL Workbench?

In MySQL Workbench, is it possible to search for a specific column name in all the tables? (Writing the string to look for in the field at the top right does nothing). Thank you.
Pietro
  • 609
  • 3
  • 9
  • 19
23
votes
4 answers

What are the consequences of setting varchar(8000)?

Since varchar takes disk space proportional to the size of the field, is there any reason why we shouldn't always define varchar as the maximum, e.g. varchar(8000) on SQL Server? On create table, if I see anyone doing varchar(100) I should tell them…
Aleksandr Levchuk
  • 1,187
  • 1
  • 9
  • 11
23
votes
6 answers

Need to migrate SQL Server to MySQL

I have a database on SQL Server 2008 on a Windows server and I want to move all of the data to a MySQL database on a Ubuntu server. I have tried using the SQL Server Import and Export Wizard with the MySQL ODBC driver, and it correctly accesses both…
murgatroid99
  • 371
  • 1
  • 2
  • 8
23
votes
6 answers

Is there a generic term for tables and views?

I am looking for a generic term, e.g. for a database abstraction, that includes all tabular data structures like database tables, views, tabular query results aso. As far as I understand, 'entity' is not the proper term since this would correspond…
Pinke Helga
  • 341
  • 2
  • 5
23
votes
2 answers

MySQL: Tree-Hierarchical query

SUB-TREE WITHIN A TREE in MySQL In my MYSQL Database COMPANY, I have a Table: Employee with recursive association, an employee can be boss of other employee. A self relationship of kind (SuperVisor (1)- SuperVisee (∞) ). Query to Create Table: …
Grijesh Chauhan
  • 571
  • 3
  • 6
  • 18
23
votes
1 answer

SQL query for combinations without repetition

I need a function that can generate all possible combinations of a given set of n values. For each combination, the function should also generate all combinations of length k, where k ranges from 1 to n. For example, if the input is a table with…
Ario
  • 1,042
  • 4
  • 13
  • 27
23
votes
2 answers

how to update a property value of a jsonb field?

I have a jsonb type named attr field that contains the following: { "pid": 1, "name": "john", "is_default": true } how to change is_default to false? I try to run below, but no luck. update attr set attr ->> 'is_default' = false where…
Don2
  • 429
  • 1
  • 6
  • 8
23
votes
3 answers

Justify NOT using (nolock) hint in every query

Have you ever had to justify NOT using a query hint? I am seeing WITH (NOLOCK) in every single query that hits a very busy server. It is to the point that the developers think it should just be on by default because they hate seeing it in their…
datagod
  • 7,091
  • 4
  • 36
  • 56
23
votes
7 answers

MySQL - How to check for a value in all columns

I am curious, is there a good way to search all columns for a given value? For my purposes, it doesn't need to be at all fast, it's just a 1-off kinda thing, and I don't really want to have to type out every field name. That's precisely what I'll be…
donutguy640
  • 449
  • 1
  • 4
  • 11