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
9
votes
5 answers

Calling sp_start_job from a stored procedure

Our developers need to be able to start a SQL Server Agent job from their .Net code. I know I can call msdb..sp_start_job to do just that, but I don't want to give general user accounts direct access to run jobs. What I'd like to do is to create a…
Ed Leighton-Dick
  • 1,094
  • 1
  • 7
  • 12
9
votes
2 answers

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 error: Cannot attach a database with the same…
Drew
  • 275
  • 2
  • 3
  • 7
9
votes
2 answers

How to count unique values?

I am trying get the number of unique ip_addresses (in this case '3'). The table looks like this: Structure: CREATE TABLE bandits ( key text NOT NULL, ip_address inet, offence text, count bigint DEFAULT 1); Data: COPY bandits (key,…
Tie-fighter
  • 751
  • 2
  • 9
  • 17
9
votes
1 answer

Change collation of a MySQL table to utf8_general_cs

I tried to change collation MySQL table to utf8_general_cs but got following error: mysql> ALTER TABLE table_name CONVERT TO CHARACTER SET utf8 COLLATE 'utf8_general_cs'; ERROR 1273 (HY000): Unknown collation: 'utf8_general_cs' I run "SHOW COLLATE"…
jack
  • 1,725
  • 5
  • 21
  • 25
9
votes
6 answers

Cannot set SQL_MODE to Mysql 8

I have to set a persistent custom SQL MODE persistent to my server. I added this line in /etc/mysql/mysql.conf.d/mysqld.cnf [mysqld] ... sql-mode = STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION When I try…
Tobia
  • 1,272
  • 9
  • 41
  • 81
8
votes
2 answers

Converting Filemaker to SQL or another database system

Currently at work we have a Filemaker database running on Filemaker Server 7 on a Windows Small Business Server 2003. I would like to change from using Filemaker to a different database, one with a web based front-end. It doesn't have to be MySQL,…
Will3265
  • 123
  • 1
  • 1
  • 5
8
votes
3 answers

Is there an easier way of resolving SQL Server/database collation mismatches than changing every column?

DISCLAIMER: I know that this question has been asked a hundred times before, but I just wanted to check that there wasn't an easier solution I might have missed before I went ahead and wrote/sourced lots of code to do it. Our software uses a…
8
votes
2 answers

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 backups via FTP too is not possible as they do not…
user1034912
  • 1,345
  • 3
  • 14
  • 20
8
votes
1 answer

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 counted as a single core, or as sockets? or…
TreK
  • 257
  • 1
  • 2
  • 7
8
votes
7 answers

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 interface to my server. Surprisingly, I can't any…
Cory J
  • 1,568
  • 5
  • 19
  • 28
8
votes
7 answers

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 standards a lot more than MySQL. I'm still new to…
8
votes
3 answers

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, the maximin identity value is over 560,000,000 and…
user22785
  • 189
  • 1
  • 1
  • 3
7
votes
3 answers

Is a MySQL database a viable alternative to LDAP?

(Apologies if I'm asking the wrong kind of question or in the wrong place.) We run IT for our association (all volunteers). We have got a server with member database in OpenLDAP, mail server, ftp and a bunch of homemade web-applications. Most of…
Roberto
  • 193
  • 1
  • 9
7
votes
2 answers

dbcc checkdb('XYZ', REPAIR_ALLOW_DATA_LOSS) indicating that XYZ is already open and can only have one user at a time

I have a DB, XYZ, that had a corrupt log file and now since the log file is totally unusable this is rendering this specific DB unusable and I need to be able to rebuild it. I've already done a lot of research into this process but am getting stuck…
Christopher Bruce
  • 339
  • 2
  • 4
  • 14
7
votes
5 answers

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 the database mounted (as in, has someone done…
Matt Simmons
  • 20,396
  • 10
  • 68
  • 116
1 2
3
85 86