Database language for managing data in relational database management systems (RDBMS). Note that each database implements SQL with slight variations. Please remember to tag with your specific database as well, e.g. [tag:mysql], [tag:postgres], [tag:mssql], [tag:oracle]

learn more… | top users | synonyms

58
votes
9answers
48k views

Dump Microsoft SQL Server database to an SQL script

Is there any way to export a Microsoft SQL Server database to an sql script? I'm looking for something which behaves similarly to mysqldump, taking a database name, and producing a single script ...
26
votes
9answers
5k views

To improve SQL performance, why not just put lots of RAM rather than having faster hard disks?

People keep telling me that in order to improve an SQL server's performance, buy the fastest hard disks possible with RAID 5, etc. So I was thinking, instead of spending all the money for ...
19
votes
8answers
52k views

SQL Server 2008 Express - “Best” backup solution?

What backup solutions would you recommend when using SQL Server 2008 Express? I'm pretty new to SQL Server, but as I'm coming from an MySQL background I thought of setting up replication on another ...
16
votes
6answers
23k views

GRANT SELECT to all tables in postgresql

Is there a one-liner that grants the SELECT permissions to a new user postgresql? Something that would implement the following pseudo-code: GRANT SELECT ON TABLE * TO my_new_user;
14
votes
1answer
23k views

Postgresql: what does GRANT ALL PRIVILEGES ON DATABASE do?

I'm trying to grant all privileges on all tables of a given database to a new postgres user (not the owner). It seems that GRANT ALL PRIVILEGES ON DATABASE my_db TO new_user; does not do that. After ...
13
votes
6answers
19k views

How can I diff two Oracle 10g Schemas?

I have the feeling that there are some difference between two large complicated Oracle schemas which should be identical, so decided to dump and diff them to investigate. I found an article ...
10
votes
5answers
11k views

How to load-balance SQL Server 2008 for high-usage ASP.NET applications?

Imagine that you have a successful web application that uses ASP.NET and IIS 7. It generates many calls to a SQL Server 2008 database, and is expected to be available to the public with 99.9% uptime ...
9
votes
11answers
800 views

Free SQL Server tools [closed]

Anyone have an update to date list of Free administrative Tools for SQL Server. There is a forum post on SQLServerCentral but its pretty outdated. Please provide a link as some vendors do a pretty ...
8
votes
2answers
779 views

Is it a good idea to back up SQL database to an External USB Hard Drive?

I will be installing a Database System on an Offshore Oil Platform (rack Servers). They have very limited hardware and space therefore sending up a backup infrastructure is not possible. Sending ...
8
votes
7answers
2k views

Is MySQL better than PostgreSQL in something?

I know the question sounds provocative, but it really isn't. I'm lately finding MySQL limiting in a lot of areas and liking PostgreSQL more and more. It scales a lot better and it respects the SQL ...
7
votes
2answers
2k views

Third-party SSD solutions in ProLiant Gen8 servers

I was wondering if anyone had any specific experience using Intel DC3700 SSDs (or similar) in the HP (DL380p) Gen8 servers? I'm upgrading a set of database servers that use direct-attached storage. ...
7
votes
3answers
11k views

Postgres: How can I see all SQL statements being executed by the database server?

I'm in the process of reviewing every SQL statement that an application makes against the database, for performance reasons. Is there an easy way to log all statements that are executed by the ...
7
votes
2answers
1k views

Postgres: Non zero exit code when executing a sql file?

I am writing a shell script which makes calls to psql using 2 forms... one is by command (-c), the other is by file (-f). e.g. psql -c "create table foo (bar integer)" psql -f foobar.sql One ...
7
votes
2answers
6k views

How to change in postgresql password of the user using SQL

How to change in postgresql password of the user using SQL. I have user (alex) and his password (e.g. pass) i need to change using sql statement his password to NULL...
6
votes
1answer
652 views

Are vCPU the same as 1 Socket, or a single Core?

Currently I have a Hyper-v VPS with 2 (vCPU) processor. I would like to install SQL Server Express 2012 that has a limitation of 1 Socket or 4 Cores, whichever the lesser. My Question: Are vCPU's ...
6
votes
5answers
3k views

DHCP server with database backend

I have been looking around for something to replace my (ancient) ISC-DHCPd server. A DHCP server with a database backend sounds like a great idea to me, as I could then have a nice, friendly web ...
6
votes
2answers
4k views

How to attach mdf files from a different SQL Server Install?

Hi I have mdf and ldf files from a different SQL Server install from a machine i dont have access to now, and would like attach them to my current install to get at the data. When I try this, I get an ...
6
votes
1answer
4k views

How do you get the minimum and maximum memory allocation of a SQL instance using T-SQL?

I'm managing about 90 SQL Server instances and need a query to determine how much memory has been allocated to each instance. Please note, I'm not asking how to set it, just to see what it's currently ...
5
votes
8answers
1k views

Should I ever DELETE (SQL and DB) anything?

I am curious, should I ever delete anything? Right now I am building a site (for myself) which allows you to subscribe to users which you then receive a message every time the user has upload content. ...
5
votes
2answers
313 views

My table half-exists. Can't drop it

I have a table that is taking up quite a bit of space even though it has no rows. I also dropped it a while ago. When I try to drop it now, it says the table doesn't exist. It shows up in ...
5
votes
3answers
2k views

Do I need to split a database to filegroups? It's 30gb now

I'm in the process of changing a database server at my company from Windows 2000/Sql Server 2000 to a Windows 2003 R2/Sql Server 2005 now. It holds 30 databases, each of the databases is about 7gb in ...
5
votes
2answers
138 views

Impact of keeping 100+ Linked Server Objects open in MS SQL Server

I manage a large scale cloud based product that uses SQL Server as the database engine. The model is designed such that each customer using the product has its own instance of MS SQL Server. I'm ...
4
votes
6answers
12k views

How to rollback a deleted table data?

I have deleted one table accidentally how can I rollback that. Please suggest that.
4
votes
4answers
2k views

How to shape size of SQL server resorces (RAM, CPU, and others)

It is standard story, there is fight between developers and administrators. One denunciation that database design and queries are bad while others says It is lack of hardware and amount of data. So ...
4
votes
1answer
263 views

Ran out of disk space, how to tar without creating copy

I am at 98% of an 8GB SSD, and I have a 3 GB mysql data that I need to gzip and or tar and then download it, so then I can delete it. How can I tar or gzip the sql (or the mysql tables) so that that ...
4
votes
2answers
154 views

SQL Clustering or Hyper V Clustering

We will soon be implementing our Dynamics AX installation. Our aim is to have high availability and we are working closely with our implementers. We raised the question to them about SQL and Hyper-V ...
4
votes
3answers
4k views

Importing a large SQL script into SQL Server?

I'm trying to move a database from our production server to our test server. I've used Microsoft's Database Publishing Wizard to create a script containing the schema and data for the production ...
4
votes
3answers
2k views

How does SQL Server handle simulataneous read/write requests?

Background: We have an application which uses an SQL Server 2008 database heavily. We are trying to optimize this application. It was single threaded, and we noticed through logging/ profiling of the ...
4
votes
1answer
245 views

Backup database at certain intervals?

My client would like to have the database backed up several times per day, as well as the ability to backup the database manually. I've created a page to backup the database manually, it just calls a ...
4
votes
4answers
21k views

How can I tell if an Oracle database is mounted and activated?

IANADBA, but I'm writing a script that will take action as long as the oracle standby database hasn't been activated. What I'm looking for is two queries (or sets of queries, if necessary). 1 - Is ...
4
votes
4answers
3k views

A good hostname convention for few servers with many different services?

I am looking at setting up a hostname convention for our servers based on the service they provide, such as http, https, smtp, pop, dns, sql, etc. Each service is on its own virtual machines on a Xen ...
4
votes
3answers
3k views

mdf file cannot be overwritten when restoring a database in SQL Server

I got a databse A. It has some data in it. I created a backup for A as A.bak file. Then I create a new empty database B. And then I try to restore B from A.bak. But the SQL Serve tell me the following ...
4
votes
2answers
2k views

DB auto failover in c# does not work when the principal server physically goes offline

I'm setting up DB auto failover in C# with SQL Server 2008 and I have a 'high safety with automatic failover mirror' using a witness setup and my connection string looks like "Server=tcp:DC01; ...
4
votes
4answers
3k views

SQL Server 2008 R2 Error 15401 when trying to add a domain user

I am trying to add a domain user. I am doing the following. Expand Security Right click on Logins Select New Login... Login name select search Click on location and select entire directory Type ...
4
votes
2answers
5k views

How to monitor activity on a single table using SQL Server profiler

I have a table which uses and identity seed for its unique identity column. We have noticed some massive jumps in the identity value which we are not able to explain. The table has 20,000 odd rows, ...
4
votes
1answer
132 views

SQL Server Restore from Backup, Just primary File Group

Thankfully, this question is just a what-if, and I am not in an emergency right now. But I have created a file group in my database (sql server 2008), and moved some massive data tables over to it. ...
4
votes
1answer
142 views

Attempt to access SQL Server with the user SA [duplicate]

Possible Duplicate: Attempt to access SQL Server with the user SA I'm suffering an attempted invasion by brute force. A bot is trying to figure out the sa password. How do I restrict logins ...
4
votes
1answer
421 views

Distributed and/or Parallel SSIS processing

Background: Our company hosts SaaS DSS applications, where clients provide us data Daily and/or Weekly, which we process & merge into their existing database. During business hours, load in the ...
4
votes
5answers
3k views

Why didn't my performance increase when I went from 4 disk RAID 10 to 6 disk RAID 10?

I had 4 drives in a RAID10 set and 2 spare disks. We've been monitoring the perfmon Average Disk seconds per transfer (reads and writes) counter. We bought 2 more disks, rebuilt the RAID10 set using 6 ...
4
votes
0answers
169 views

What does it mean when Twitter says their entire database is in RAM?

I am wondering where to begin with database scaling/optimization strategies. After reading articles like highscalability.com's facebook architecture article, and this twitter architecture article, I ...
4
votes
2answers
4k views

Sharepoint 2010 slow [duplicate]

Possible Duplicate: Slow Sharepoint Server 2010 I have a sharepoint 2010 installation that is running really slowly. The installation is set up as follows, I have a domain controller ...
3
votes
4answers
247 views

Mistakenly ran an update statement on table

We have mistakenly ran an update statement on one of our Columns in a SQL table. We don't have a backup of the table nor the database. Can any one help us to retrieve the values of the Column before ...
3
votes
8answers
1k views

How can I prevent attacks on my SQL Server installation?

In the past month I've noticed in my event viewer on a sql server a lot of failure audits. Seems like a brute force attack from an ip in china trying to log in to the sa account which i have disabled. ...
3
votes
5answers
8k views

Use SQL varchar(max) or text?

I'm using SQL Server 2005 and I have a column where I need to store large amounts of text (sometimes over 8000 characters, the varchar limit). Is there a disadvantage to using the "text" data type? ...
3
votes
5answers
245 views

how do i automatically back up my sql server database every month?

i have a sql server 2005 database without around 100 tables. i need to back it up every month. is there a way to automate this process? how would i do it? i am a newbie so please explain thoroughly ...
3
votes
2answers
6k views

Can't restore SQL 2008 backup - error that the database is in use but it isn't

I am trying to restore a SQL Server 2008 backup and am getting the following error: RESTORE cannot process database because it is in use by this session. ADDITIONAL INFORMATION: ...
3
votes
2answers
5k views

Difference between “NT AUTHORITY\NETWORK SERVICE” and “NT AUTHORITY\SYSTEM”

I am installing MS SQL Server 2008 R2 and I got to the window where I have to set the service accounts. I want to know the difference between NT AUTHORITY\SYSTEM" and "NT AUTHORITY\NETWORK SERVICE". I ...
3
votes
3answers
294 views

SQL Server 2008 R2 Developer Editon

I have a basic question. Is the SQL Server 2008 R2 Developer Edition same as SQL Server 2008 Developer Edition? Why does the Microsoft sites return 2008 pages while browsing when looking for R2 ...
3
votes
3answers
3k views

ODBC: trouble removing system DSN

I have a colleague who has two DSNs with the same name - one's a user DSN and the other, a system one. He removed the user DSN but can't remove the system DSN in ODBCad32 Anybody encountered this ...
3
votes
4answers
9k views

How to find the next generated value for a auto-increment column?

I face some trouble with IBM DB2's auto-increment columns. At first, all my columns were defined as GENERATED ALWAYS, but since I had trouble with this when using the "db2 import ..." command, I ...