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

0
votes
1answer
1k views

Sending Email from SQL Server Agent scheduled job

I've scheduled a job in SQL Server Agent that sends the result of a query in an email. If I execute the stored procedure from SSMS, it works fine. But the SQL Server Agent is not able to send emails. ...
0
votes
0answers
3 views

SQL alwaysON and WSFC

I have a WSFC configured on 2 (hardware)nodes with SQL AlwaysOn group. The problem is, if the node Where I have created the cluster goes down the cluster is not available for second node and here ...
0
votes
0answers
9 views

How to execute cursor in PostgreSQL? [migrated]

This is my program for cursor, but I am not getting how to execute the cursor on a database. emp=# CREATE or replace function cursor_demo() returns integer as $$ declare emp_rec employee%rowtype; ...
1
vote
1answer
673 views

How to filter columns in SQL Server replication?

I need to replicate some data from two tables in one database to another databases. I used snapshot replication. The issue is that I would like to replicate only some selected columns and the others ...
3
votes
0answers
22 views

Update SQL Service Pack Named Instance

I have an existing SQL 2008 R2 on SP3. Have another instance in use that is SQL 2008 R2 SP1 I need to update the named instance with sp1 to sp3 but i'm not getting any options. It tells me my version ...
0
votes
1answer
41 views

Is there a way to kill a range of session ids (connections) in ms sql server?

i was wondering if there is a way to kill a range of SQL Connections on an Microsoft SQL DB. If i want to kill a single session id i can use kill [session-id]; go;. If i want to kill all sessions i ...
0
votes
1answer
961 views

SQL Server doesn't allow to execute subquery as dynamic SQL

I tried to make a dynamic SQL which gets all tasks for some users The procedure [GetAllSubExecutorsByUserId] returns IDs of all subalterns of curent user I write these IDs into a temporary table, and ...
0
votes
0answers
14 views

SQL 2014 Collation Policy job failing

I have setup a new SQL 2014 server and created a policy to make sure all DBs have the same collation. I created a DB names test and gave ##MS_PolicyTsqlExecutionLogin## permission to it and all ...
0
votes
1answer
30 views

How to attach a database created by sql 2008 to sql 2012 when full text catalog missing?

I have an already created mdf file which was created by sql server 2008.But when I attach this mdf file to sql server 2012 it asks me to add necessary full text catalogs. I have no idea what to ...
0
votes
0answers
19 views

Several Connection Errors on SQL Server 2008 R2 [closed]

I have a Microsoft SQL Server Standard Edition (64-bit) with a database on it. Then i have sever clients softwares that work with this database. Problem is now that every now and then they get ...
0
votes
1answer
15 views

Concurrent MySQL processes

I have a file, let's call it a.php, which executes a long cycle of iterations, each one of them makes some queries to the database. To complete the cycle, it takes quite some time (some hours). My ...
0
votes
1answer
464 views

Having trouble piping between cygwin and sqlcmd

This simple command fails in bash: echo "print 'tsql'" | sqlcmd -E it works correctly in a regular old command prompt. It used to work with previous versions of cygwin. I've also tried inserting ...
1
vote
2answers
148 views

Many huge files in Sharepoint… Any “stubbing” or “shortcutting” software exist?

I'm in an industry that uses a lot of scanned documents and large attachments (100MB), and I see our Sharepoint database growing quickly. What options do I have for managing this rapid growth? Can ...
0
votes
0answers
46 views

SQL Listener on Azure can't connect

I'm having an issue trying to create an SQL listener on a VM hosted in Azure. I have followed the instructions from MS on this link and everything seemed to go through fine. The listener created ...
5
votes
5answers
14k views

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 ...
1
vote
2answers
52 views

how to separate IIS event logs by application in event viewer

Just to start with, I would like to advise I am VERY new to IIS so apologies for any obvious questions in advance. I have done some research around this topic and my findings have been inconclusive. ...
1
vote
1answer
4k views

MySQL table does not exist

I am getting following error in err file. 110803 6:51:26 InnoDB: Error: table `ims`.`temp_discoveryjobdetails` already exists in InnoDB internal InnoDB: data dictionary. Have you deleted the .frm ...
2
votes
1answer
42 views

How can postfix hash: databases be replaced by static: or inline:?

What is the syntax to replace a postfix hash-Database, for example domain.tld PREPEND my-header: foobar with a static map? docs define it as Example: "inline:{ key=value, { key = text with ...
0
votes
0answers
16 views

When to break large delete queries up? [migrated]

I've got an auto generated join table (three columns, two of them keys to other tables), which was recently corrupted during an aborted migration. As a result there are around 1 million duplicate rows ...
1
vote
1answer
1k views

Log In failed for user error 18456

I have two servers. Both of the servers have two different database that will be joined together using SQL Server Agent. However, during this activity SQL Server is throwing a Log In Failed Error. ...
0
votes
5answers
8k views

SQL Server Log File Won't Shrink due cause “log are pending replication” on non replicated DB?

I have a non Mission Critial DB 9am-5pm SQL Server database that I have set up to do nightly full backups and log backups every 30 minutes during business hours. The database is in full recovery and ...
0
votes
1answer
3k views

Error: Package 'Microsoft SQL Management Studio Package' failed to load. In SQL Server Management Studio

I had installed SQL Server 2008 R2, the installation was succesful. But I can't open the Management Studio because this error is shown: Package 'Microsoft SQL Management Studio Package' failed to ...
2
votes
1answer
37 views

What are the downsides of running all SQL Servers under same domain account?

I am running two SQL Servers 2012 (for Always On) under the same domain account and would like to know what are the downsides in doing so. Few articles that I have read prior setting up the servers ...
0
votes
1answer
40 views

Importing Data Dump Using pgAdmin

I looked around and found the following code on how to import a data dump using pgadmin: CREATE OR REPLACE FUNCTION db_to_csv(path TEXT) RETURNS void AS $$ tables RECORD; gmdeclare statement ...
2
votes
5answers
1k views

Backing up a SQL Server 2008 R2 Database without stored procedures

Is it possible to back up a SQL Server database, but only back up the Table structures and content (i.e. not include the stored procedures, views etc?) The scenario: We have a data centre hosted ...
0
votes
1answer
409 views

SQL / OracleDB: How to set the same value for all fields in a column?

Is it possible to set a value for all fields in a column, e.g.: ID Host URI 1 //cyrus /images 2 //cyrus /videos 3 //cyrus /text 4 //cyrus /misc 5 //cyrus /backup I want be able to ...
0
votes
0answers
26 views

Cisco CallManager AXL SQL Toolkit - Retrieve directory number and user ID

I have the below SQL query to retrieve the list of userid and their telephonenumber using Cisco CallManager AXL SQL Toolkit: sql query="select d.name as deviceName, e.userid, e.telephonenumber from ...
2
votes
2answers
2k views

Determine Who Dropped a Database?

I have a SQL Server 2005 database that has been deleted, and I need to discover who deleted it. Is there a way of obtaining this user name?
-1
votes
1answer
127 views

Restore SQL Database From BAK File using a SQL Query

I have my database backing up to the hard disk in the format of BAK file. I am trying to restore that backup, but I unable to do so. Here is my query: ALTER DATABASE DBASE SET SINGLE_USER WITH ...
0
votes
1answer
40 views

Azure Database Permissions

Is it possible to create a Server Login with a Master database user that is able to create a Server Login with a Master database user ? I have not been able to do this, I always need to use the Admin ...
5
votes
1answer
4k views

How can I verify that a SQLite db3 file is valid/consistent

I have some sqlite version3 db3 files I copied off a live running production system (I know bad sysadmin bad sysadmin) for various reasons. Is there some sqlite command I can run that will verify that ...
2
votes
7answers
994 views

How do I report SQL Injection attacks (e.g. to User's ISP)?

EDIT : Sorry, my question clearly wasn't clear. I don't want to report attempted server attacks internally; we already have systems that log. record and report that activity. What I was keen to do ...
0
votes
0answers
14 views

SQL 2012 IPSec or SSL

I have a requirement to secure connections to SQL server. (at transit that is) - TDE will be used for encryption at rest. SQL provides two options which are either certificate based SSL or Windows ...
0
votes
2answers
878 views

Alias a linked Server in SQL server management studio?

Hoping someone can help - is there a way in SQL server management studio 2008 R2 that I can alias a linked SQL server? I have a server, added by IP address, to which I do not have the login ...
-1
votes
1answer
33 views

Unable to backup SQL database due to insufficient permissions

We are attempting to do an internal SQL backup of our databases, however it appears when the databases were configured the SA user account had been disabled. For whatever reason the BUILTIN\Users only ...
2
votes
0answers
26 views

backup compression ratio in SQL 2012 worse than in SQL 2008

We have SQL 2008 Enterprise with TDE enabled and upgraded to SQL 2012 with TDE still enabled. Everything works fine except that I am getting worse backup compression than in SQL 2008. I do ...
0
votes
0answers
4 views

How do I determine which tier of Azure Web Service my RESTful API requires? [duplicate]

My application's back end is a RESTful API which generally doesn't perform any logic, just basic CRUD on top of an SQL DB (I think I will use Azure SQL Database Service). Assuming you are given ...
0
votes
1answer
372 views

Installing SQL Server on a Domain Controller [closed]

I want to install SQL Server on a Domain Controller ( windows server 2003 R2) but i have an error because SQL Server services can not run under a local service account or a network service account.
2
votes
5answers
2k views

Why does this SQL run so much faster in a Oracle server with the same hardware/data than another Oracle server?

My application has a SQL that takes ~ 30 min to run in the Oracle server in production. It takes about the same in a test Oracle server. For some reason, in another Oracle server, it runs much ...
0
votes
0answers
115 views

MySQL unable to repair, dump, upgrade table (simply crashes)

I need to backup one of my databases from MySQL (Running MariaDB). The issue is that aside from all of my other databases that backup perfectly fine, this database has issues backing up and crashes ...
3
votes
1answer
102 views

Find Full or Differential backup from .bak (with powershell or by any other means)

I'm trying to determine whether an MS SQL backup file (.bak) is Full or Differential. Is there an easy way to do this? A way of doing this in powershell?
24
votes
2answers
36k 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 ...
-1
votes
1answer
1k views

SQL Server 2008 setup error Attempted to perform an unauthorized operation

I am trying to install SQL Server 2008 Standard Edition on windows 7 and during installation it give error: Attempted to perform an unauthorized operation
2
votes
1answer
1k views

SQL Server: How to report error from a job's step of PowerShell type

I have a SQL job whose step of 'PowerShell' type does 'exit 1' if encounters an error i.e. $ErrorActionPreference='stop'; trap{"$_"; exit 1} Problem is, SQL Server doesn't pay attention to that exit ...
-2
votes
1answer
186 views

SQL server slows down

We have a java application running on Tomcat and we are using SQL 2008 and 2005 as database. Our databases sometimes slows down really significantly and we don't see any blocking, deadlock, etc. I ...
5
votes
3answers
816 views

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 ...
0
votes
2answers
2k views

MySQL database really slow with a really big table [closed]

I have a MySQL table with 150 million rows. Below is its data structure. Below is some of its data. Now, using PHP My Admin I ran the below command. SELECT `iwords` FROM `wordstable` WHERE ...
1
vote
2answers
823 views

SQL Management Studio Can't Connect to Database---Microsoft fixes failed

I just installed MS SQL Server 2014 a couple days ago and it was working fine until today. I attempted to connect using the Object Viewer and I got the error message Cannot Connect to MyserverName. ...
0
votes
1answer
28 views

prevent replace sql database files with old one

i have a database that i use in my application. the operation i want to prevent is if i stop sql server and take the database files to another location then start the sql server and make some ...
0
votes
0answers
25 views

No messages received on Queue after Failover in SQL Always On

We have an Application, which uses Service Broker to receive notifications from the SQL Server. The application works fine when we don’t have SQL Always On enabled, and when we are interacting with a ...