0
votes
1answer
4k views

Import data from a CSV file without creating a table first in MySQL

I want to import CSV data into mysql database. Additionally, I dont want to create a table first and then import. That means, if my csv file name is test.csv, and its contents are like ...
0
votes
1answer
455 views

Take query results and insert into new table [closed]

So I have the following query: DECLARE @tbl TABLE(value int) *--The same function but with the number of the random numbers ;WITH Nbrs (n) AS ( SELECT 1 UNION ALL SELECT 1 + n FROM ...
0
votes
0answers
64 views

How to analyze incoming DML in SQL Server 2005?

I have database and specifically one table that is used for batch data transfer from another organization. With each run the table is truncated and rows are re-inserted. I want to handle that process ...
1
vote
2answers
114 views

Three databases : one instance or three?

I am a new DBA working for a charity and I have project to consolidate the multiple databases scattered across the organization. I have identified the main databases that are mission critical to the ...
0
votes
2answers
141 views

SELECT first value from 3 tables that is not null

Having 3 tables with name(varcahr) value(varchar) pairs how do I select the value for a given name from one of the table with respect to the following conditions select value from tab_1 if it exists ...
5
votes
1answer
429 views

Why does InnoDB table by default uses the UNIQUE constraint instead of the PRIMARY KEY?

In my MySQL database I have a table with 4 columns, the PRIMRAY KEY, two columns with a FOREIGN KEY CONSTRAINT and one UNIQUE index on all fields except for the PRIMARY KEY. The SHOW CREATE TABLE: ...
1
vote
1answer
206 views

Resolving Cyclical Reference in Referential Relationships

I'm designing a small SQL Server Compact Edition database and am attempting to enforce referential integrity. The database is a simple backend for a small desktop application that functions as an ...
-2
votes
0answers
227 views

How to make make my query run fast? [closed]

How to make this query run faster? Table contains over 2 million rows of data and takes around 30 to 120 seconds to process the query. SELECT INET_NTOA(blocks.startIpNum), ...
1
vote
2answers
969 views

Maintenance Plan Job running at additional unscheduled times?

I have a situation that has left me really scratching my head. This is a SQL Server 2008r2 instance, used as the database server for a substantial corporate SharePoint service. As my company is ...
2
votes
2answers
2k views

Optimized query to fetch a record from 10 million entries

A table has 2 fields | UniqueKey | TimeStamp | ------------------------- | xfsddddq | 1024125412 | | xfstttdx | 1024125413 |< | xfsdxxau | 1024125415 | Estimated, there are 10 million ...
0
votes
0answers
1k views

How can I create a view in a stored procedure on MySQL?

I am trying to dynamically create views based on an SQL query and have a trigger recreate them when the fields in the view are to change. When I call the procedure I end up with a permission denied ...
2
votes
2answers
3k views

SQL service does *not* start, port 1433 in use

Sorry to raise if this has been asked before. The SQL Server service is defined as manual, whenever I start it I get (event viewer): > Server TCP provider failed to listen on [ 'any' 1433]. Tcp ...
0
votes
2answers
159 views

Is there any disadvantage to using Oracle's Easy Connect syntax?

Oracle allows a few different syntaxes for specifying where to find your database service. The one I've seen most commonly (in the few short years I've been developing software professionally) looks ...
1
vote
0answers
222 views

ODBC Connection Not Refreshing

I am trying to connect FedEx Shipping Manager Integration Assistant to a SQL 2008 R2 database. I have a view created that has all the necessary fields to populate in the Integration Assistant. The ...
4
votes
1answer
631 views

Do SQL Server Views update their data types automatically based on what tables feed them?

Someone mistakenly created a bunch of nchar fields in database tables. I noticed this, and after examining the issue, we're moving these fields to nvarchar types and trimming the values inside. In my ...
1
vote
1answer
420 views

When tables are locked does MySQL queue queries?

I have a small production website, but it's live 24/7. When running the Optimize, Analyze or Repair commands, MySQL locks the table it is working on. QUESTIONS How would this effect users trying ...
3
votes
1answer
523 views

Inserting a 30 million row table from a linked server

I have a large table that needs to be updated on a nightly basis from a linked server. Initially I had simply truncated the table and inserted all of the records but this was taking too long. I'm ...
3
votes
1answer
312 views

Three Node Cluster that Allows For Two Failures

We are creating a three-node three-instance cluster with SQL 2008 R2 (not cutting edge, but that is what the application supports) and think it should be able to maintain quorum with two physical ...
3
votes
2answers
3k views

How to Log Debug Information About a Stored Procedure

We have a group of fairly complex stored procedures that process a transaction queue on a pretty much round the clock schedule. Currently these scripts use a number of print statements to document ...
0
votes
1answer
659 views

row_number over partition at Version < Firebird 3

I´m currently at the end. Given facts: ID ID2 FROM TO COSTS 4985 501671 2013-07-25 00:00:00 2013-12-30 00:00:00 17.8 4985 501671 2013-09-05 00:00:00 ...
2
votes
1answer
777 views

Database Backup from 2008 R2, Restore on 2012 Failover Cluster Instance

I have a production database server having sql server 2008r2. This is an old server and considering our load, we are moving to a better hardware configuration, Now the new environment is a cluster ...
1
vote
1answer
1k views

How to get list of tables, views etc. a users has rights to on Sybase IQ?

I'm looking for a way to get a list of views, tables, procesdures etc, a user has been granted to. A select onto SYSROLEGRANTS helped me to find basic role of users -- but not more like this. So ...
1
vote
1answer
386 views

GETDATE() uniqueness when used on INSERT

Recently I was reading this blog post: http://blogs.msdn.com/b/sqlazure/archive/2010/05/05/10007304.aspx which contains this section: Picking a Clustered Index There are a couple of ...
1
vote
2answers
281 views

How to delete list of email addresses from MySQL database?

I have a list of invalid email addresses parsed in the following format; There are roughly 1500 invalid addresses, and I need to remove them from my myBB users. What SQL query can I run to remove ...
1
vote
0answers
1k views

Cannot read property Collation.This property is not available on SQL Server 7.0. (Microsoft.SqlServer.Smo) [closed]

I am new to databases and Microsoft SQL. I just installed SSMS today and am getting this error while trying to add new login in security or rightclick-> view properties on user logins already there ...
0
votes
1answer
233 views

Add 0 into array_agg if there is no matching data

I wrote this view, and it is selecting almost everything I want, but I do not get results for all: project_keywords(which has_many project_report(keyword_id, project_id)) So a project_keyword has a ...
0
votes
1answer
208 views

remote connection to mysql

have two machine PC#1 with db mysql and appache and PC#2 with a c# form try to connect to this db here is my connection string used in PC#2: SERVER=My_public_ip;PORT=3306;DATABASE = my_test; UID = ...
2
votes
1answer
910 views

Designing a reservation system schema

I am not sure if this has been asked before, however I am tasked with designing a new reservation system for my organization We have an older system which simply stored the booking in a table, and it ...
1
vote
1answer
33 views

Suggested ways to route traffic between master / slave

I have multiple Postgres servers up, running in master / slave streaming replication mode. I was wondering what the suggested methods of routing write traffic to the master, and the read traffic to ...
0
votes
1answer
811 views

MySQL: Use Sysbench on Windows

Sysbench is a tool to analyze the MySQL performance. I downloaded it and extracted but there is no executable file. Files having extensions like .sh or .c or .h are available. I gone through the ...
1
vote
1answer
233 views

Can't find stored procedure for updating after creating it

I'm trying to create a procedure to update my table create proc UPDATE_PRODUCT @ID_CAT INT, @ID_PRODUCT VARCHAR(30), @LABEL NVARCHAR(30), @QTE INT, @PRICE VARCHAR(50), @IMG IMAGE AS UPDATE ...
1
vote
0answers
43 views

is there a DB client which supports oracle editions?

We are using a clever feature or oracle 11gr2 called edition-based redefinitions. This means each stored proc and view looks different depending on the edition you set in the session. There are ...
0
votes
1answer
141 views

How to convert database mysql4 to mysql5

I have mysql dump file named booster.dump. It was export from 4.0.27-standard mysql server. Now I want to convert this database to mysql 5.1.73-cll. How can I do it? I search about this topic in ...
0
votes
1answer
379 views

MySQL: Transaction and Deadlock

I have table "tbl_data", where have a lot of rows (3 - 5 million). I have JAVA (*.jar) module from which I INSERT/UPDATE data into this table. If I start *.jar file (for example, "run.jar") and after ...
0
votes
2answers
59 views

CASE_SENSITIVE on ORACLE DB

I have a ORACLE DB and when i try inserting "INDIA" and "india" as values into column which is carrying unique constraints on it , it is allowing the value to insert . It looks like case sensitive ...
1
vote
1answer
51 views

How to resynchronize replication for a single database

I have two MySQL 5.5 servers in a master/slave replication setup. The server hosts about 10,000 databases, but the replication is messed up for only a couple of databases. To fix the replication I ...
0
votes
1answer
2k views

After installing postgresql and postgres-xc with apt-get, I have psql but not postgres, initdb, pg_ctl

I used apt-get on Linux Mint to install postgresql and postgres-xc. I have access to psql, the postgres user exists, it's possible to create databases. However, the server seems to be running on ...
4
votes
4answers
13k views

Displaying the list of all tables in all database

How can I display a list containing all the tables of all the database in a SQL Server 2008 R2 server?
0
votes
1answer
61 views

Fetching User Recent Status

I am running mysql with MyISAM storage engine to store user status(user updates data). To load user recent updates data i am using this query: $limit = 20; $uid = 3; SELECT * FROM userstatus WHERE ...
1
vote
1answer
64 views

Is this diagram possible or correct?

just starting to learn to design. I don't know the term in english to describe this type of design, so I'm here for some help. Can this "specialitzations" have a relation like this one? Thanks!
0
votes
3answers
511 views

Changing MySQL auto_increment_offset

Sorry for the wall of text, but I don't know what's relevant and what's not. I have MySQL a MySQL database that it is being replicated from our production environment to our development/test ...
2
votes
1answer
56 views

Find the SQL query that caused an event in the past

I have a database in which I noticed that one of my tables is missing. I haven't used this database for over three months and now I want to find out who caused this, when this happened, how it ...
7
votes
1answer
912 views

What happens in PostgreSQL checkpoint?

Here's part of my checkpoint log: 2014-03-26 11:51:29.341 CDT,,,18682,,532854fc.48fa,4985,,2014-03-18 09:15:24 CDT,,0,LOG,00000,"checkpoint complete: wrote 15047 buffers (1.4%); 0 transaction log ...
0
votes
0answers
162 views

Comparing CLR Functions in Visual Studio SSDT

I'm comparing the CLR functions from a pair of SSDT projects to a database. The only difference shown in the comparison is on two properties: IsDeterministic and DataAccess The compare shows that the ...
0
votes
1answer
912 views

How to create multiple graphs with TitanDB (+Cassandra) in the same machine?

I'm experimenting with TitanDB (with Cassandra as storage) + Rexter. I've been reading the documentation during hours and trying to create multiple graph DBs on the same machine, but I didn't find ...
18
votes
3answers
2k views

When to use CDC to track history?

SQL Server Change Data Capture is a feature that reads historical data from the SQL Server transaction logs and stores them in a special table. Through the use of special table value functions (TVF) ...
1
vote
1answer
3k views

stored procedure with multiple statements does not execute all statements when run from job

** see updates below I have a stored procedure (SQL Server 2012) that deletes old records from a table, then inserts new records from a view to synchronize the table with the view. When I execute the ...
1
vote
1answer
811 views

Data History Table vs Using a Current Record Flag [closed]

There are two strategies when dealing with data records which contain multiple versions. One is to have current records in one table, and their past versions in a history table. The other is to have ...
1
vote
1answer
438 views

How to aggregate pairs of id values into groups

I have a table with two id columns id1 and id2. Each row shows that 2 id values have been linked together. My actual data has both id columns as varchar(20) but I have used integers in the example ...
2
votes
3answers
4k views

What are the risks of copying MDF/LDF files without detaching the DB first?

Where DB backups are not available, our support team has been trained to restore using the following steps: Get a copy of the MDF/LDF from a file system backup. Stop the instance. Overwrite the ...

15 30 50 per page