Questions tagged [sql]

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. [mysql], [postgres], [mssql], or [oracle].

An abbreviation of "Structured Query Language," SQL is a database language used to manage data in relational database management systems.

Due to many vendor implementations of SQL (such as T-SQL for SQL Server & Sybase, PL/SQL for Oracle and PostgreSQL and MySQL) it is a fractured language and syntax that works with one vendor may not work with another.

1284 questions
7
votes
8 answers

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. Or comments, if there is a thread and someone…
user274
7
votes
4 answers

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 changed them to GENERATED BY DEFAULT. This is…
Tim Büthe
  • 352
  • 2
  • 5
  • 16
6
votes
2 answers

What is a typical Compression Ratio for an SQL Database backup file?

One of my clients want us to give a safe estimate of how much disk space does a compressed SQL backup file take. They need to size their server hard disks accordingly. We can rouhgly estimate the SQL database backup size (based on estimated number…
user1034912
  • 1,345
  • 3
  • 14
  • 20
6
votes
1 answer

On Amazon Web Services what is the difference between SQL Server Standard and SQL Server Web?

I noticed that SQL Server Web is vastly cheaper than SQL Server Standard on Amazon Web Services. Why is that? What am I missing if I use SQL Server Web instead of Standard?
CatDadCode
  • 265
  • 3
  • 10
6
votes
2 answers

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 user_tables. Also, all of its partitions and indexes show up…
Jeremy
  • 163
  • 1
  • 4
6
votes
3 answers

Renamed a SQL Server, however maintenance plans still have old name

A colleague has renamed a SQL server, however all of the maintenance plans still have references to 'OLD_NAME' as 'Local Server Connection'. The text boxes containing the server names for Local Server Connections are greyed-out and cannot be…
Richard
  • 105
  • 1
  • 2
  • 16
6
votes
5 answers

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 disks (2 span) and the performance stayed the…
MrVault
6
votes
4 answers

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 username Click checkname The name goes underlined and…
Alice
6
votes
6 answers

How should I set up protection for the database against sql injection when all the php scripts are flawed?

I've inherited a php web app that is very insecure, with a history of sql injection. I can't fix the scripts immediately, I rather need them to be running to have the website running, and there are too many php scripts to deal with from the php end…
Kzqai
  • 1,278
  • 4
  • 18
  • 32
6
votes
3 answers

Does resizing a column lock the table?

What happens if I change a column from nvarchar(2) to nvarchar(10) or a column from char(2) to nvarchar(10). Does this lock, reorganize the table or does this work without any impact or downtime? I tried to find what happens if I alter a column, but…
kcode
  • 1,825
  • 4
  • 19
  • 21
6
votes
7 answers

How to rollback a deleted table data?

I have deleted one table accidentally how can I rollback that. Please suggest that.
Simhadri
  • 183
  • 1
  • 1
  • 4
6
votes
1 answer

Send sql server job alert only when a query has rows to return

I have a query that checks if we've made sales of a particular stock item select * from merchand_history where stock_code = 'zzz007' and create_timestamp >= getdate() order by create_timestamp desc I'd like to have a sql job that emails a user (I…
Paul D'Ambra
  • 1,082
  • 1
  • 13
  • 22
5
votes
2 answers

Can't go back to root from postgres: forces to enter postgres password which it finds invalid

I've installed postgres on Ubuntu and it switched me to postgres user. I've opened psql created a database and then decided to switch back to root. However, it doesn't allow me: sudo su - results in it asking me [sudo] password for…
parsecer
  • 163
  • 1
  • 8
5
votes
3 answers

Boot Windows from SAN

Am not so familiar with Storage. I have some questions around running Physical and Virtual Machines with SAN for Storage. Is it possible to boot OS from a SAN Storage attached to a Physical Server? If so is there are downside to it? Say there are…
dunantsm
  • 51
  • 3
5
votes
1 answer

Where are Azure SQL Database Backups Stored

I've got 5-6 Azure SQL Databases running. They run in the Basic and Standard pricing tiers. From what I've read backups run by default which allow for the Point in Time restore options to work. These are my questions: Where are these backups…
jrd1989
  • 698
  • 15
  • 48