An acronym for "Structured Query Language" (it's not the name of a specific DBMS product), SQL can be used in relational database management systems (RDBMS) to query, update, delete, and insert data as well as modify the structure of the database. It can also be used to manage schemas and data ...

learn more… | top users | synonyms (1)

4
votes
0answers
694 views

Receiving error Error: 18059, Severity: 20, State: 1 in the SQL Logs

I'm using SQL Server 2008 Sp3 Lately I'm having errors in the SQL Logs: Error: 18059, Severity: 20, State: 1. The connection has been dropped because the principal that opened it ...
4
votes
0answers
244 views

ERWIN create and use database

Im trying to generate physical database from my logical model using ERWIN 7. All is well in the script that is generated automatically, there is only the problem that the model is created in the ...
3
votes
0answers
35 views

Using Import Wizard with Access - No null values

I am trying to import a table from Access to SSMS using the Import Wizard but when I do the resulting table has a lot of empty strings instead of the NULL values that I am expecting. How do I make ...
3
votes
0answers
48 views

How can I prevent having inconsistent data under isolation level serializable in Oracle SQL?

I have the following table: InStores +--------+---------+-----+ | ProdID | StoreID | qty | +--------+---------+-----+ | p1 | s1 | 25 | | p1 | s2 | 70 | +--------+---------+-----+ ...
3
votes
0answers
52 views

SQL Server SSL connection

Is it possible if I wanted to set up SQL Server 2008 R2 instance so that it only accepts SSL Connection? I am getting different answers and based on my testing, it will accept non-SSL connection even ...
3
votes
0answers
165 views

How can I search values, considering occurences, on more than one term in SQL Server CE?

I have a rather complex SQL query, that I actually received help from this SE site to come up with parts of. This query is designed to take a search term and search all relevant values in a database ...
3
votes
0answers
199 views

SELECT COL_NAME(969262708, ORDINAL_POSITION) returns a NULL value in one of the rows

So I've got a Stored Procedure that's copying data from one table to another. It calls this other SP to get the column names. I didn't write this darn thing, but here's that part: ALTER PROCEDURE ...
3
votes
0answers
135 views

merge replication too big

I have multiple handhelds which sync their data via merge replication. from time to time, new core data is imported on the server-database. for some reasons I keep the old data in the databse and set ...
3
votes
0answers
110 views

How to Audit for Access with Cross Database Ownership Chaining

I've just joined the data team of a new company and we have a large SQL Server environment (100+ instances) and cross database ownership chaining is on by what I gather is a necessity. I'm looking for ...
3
votes
0answers
234 views

How unsafe is it to change the data source of repl_distributor on a publisher

I have a long story that I will condense to a few bullet points that leads up to my question Reporting Server (SQL 2008) is distributor/subscriber cluster for a SQL 2000 Transactional Publication ...
2
votes
0answers
51 views

Network and memory waits after massive ALTER

We had to do a massive ALTER to our DB, changing one central table's PK to BIGINT due to approaching ID's generated in the 2 billion range. Due to this, several hundred referencing keys and indexes ...
2
votes
0answers
60 views

Which parameters was a stored procedure or command executed with?

We are using nHibernate which generates queries from .NET code. Occasionally, some queries get stuck in the sp_whoisactive list and we cannot find out why. I have a feeling that it has to do with a ...
2
votes
0answers
56 views

SQL Server 2012 High availability Groups for OLTP and Reporting environments

I would like to seek your advice in designing a high availability architecture at my current work place. We are moving to SQL Server 2012 platform and we currently have a set of OLTP databases ...
2
votes
0answers
156 views

Empty Space in buffer pool

I was doing some reading and came across this article from Paul Randal: http://www.sqlskills.com/blogs/paul/performance-issues-from-wasted-buffer-pool-memory/ Using the queries from that article, I ...
2
votes
0answers
30 views

Setting up triggers based on exposed columns in a view's source table

I have a table where I want to do a AFTER UPDATE trigger if one of the columns modified was in a specific view CREATE VIEW [dbo].[iv_EmployeesView] AS SELECT EMPLOYEE_GUID AS EmployeeGuid, ...
2
votes
0answers
66 views

Multi-Statement Template Plan Guide

A piece of, um, software seems to be issuing ~20k queries of this form every few seconds: DELETE FROM macVendor WHERE companyId=N' 08-00-'; INSERT INTO macVendor (companyId,organization) VALUES (N' ...
2
votes
0answers
420 views

Postgres Case statement not return else value in this query

I'm creating a SQL query with a some nested queries and I'm trying to use the CASE statement but it is behaving weirdly. I've been at it for at least 6 hours without any luck... This is my query at ...
2
votes
0answers
61 views

SQL Server 2012 Replication

Please help me out with a problem I am facing. I have a table T. I altered the table to alter the column C from varchar (10) to varchar (100). Now, there is a view V that is schema bound and selects ...
2
votes
0answers
346 views

Query optimization on a large table in PostgreSQL

I am not super experienced with databases, just have a college level course under my belt. I am trying to see if an existing query can be optimized. Currently on average takes over 300ms. There is a ...
2
votes
0answers
532 views

Mysql slow writes

i have a strange problem with mysql. My selects goes fast. My insert/create/delete/drop/update go very slow. I have done some tests on 2 machines. My old machine and my new machine. Old is worst ...
2
votes
0answers
184 views

Did the Change Tracking internals change from SQL Server 2008 to 2012?

In trouble shooting an issue with synchronizing disconnected devices with a central database server, we are experiencing a problem after upgrading to SQL Server 2012 on the server. It appears that the ...
2
votes
0answers
382 views

SQL Server 2008 R2 cluster installation error

I was trying to install SQL Server Cluster (Launch wiard to install single node SQL Server 2008 R2 faliover cluster) .. The setup checks displayed no error and the installation started after all the ...
2
votes
0answers
362 views

Cannot connect to SQL Server 2008 after updating the service pack

After updating, whenever I start the service of the server in configuration manager, it always stops then. And I found the error in the log 2013-04-13 19:08:19.63 spid7s Error: 15174, ...
2
votes
0answers
287 views

Transform XPath map into XML document using relational data

Background Most modern databases have XML functions that can be used to extract data in an XML format. I want to avoid the task of manually calling XML functions to extract the data. This problem ...
2
votes
0answers
168 views

How to speed up SQL Server RIGHT JOIN on 100MM+ Records - use TVF?

I use a table insert to UNION a CTE of converting transactions to visits (converting or not) and then summarize the visit data (no details, just pages visited & txns completed) to get funnel ...
2
votes
0answers
589 views

Is there a Postgres admin GUI that can execute a master file containing multiple sql files

I'm developing a really long script. I'd like to break the script into smaller, more manageable scripts and include each sql file in a master file, then just execute the master file. example: ...
2
votes
0answers
143 views

Limit Output Flat File Size In SSIS

I am using Flat File Destination to export my data's to a Text file. I need to limit the output File size to 1 MB. Is it possible?
2
votes
0answers
196 views

Last Known Successful DBCC CHECKDB

I understand that looking at DBCC PAGE is supposed to show me the last known good DBCC CHECKDB but I am not seeing this work correctly. I have a database that I know is corrupted. If I run DBCC ...
2
votes
0answers
88 views

QBE Query By Example. How does it handle OR conditions?

I've been looking at implementing QBE into an application but need more information on how more complex queries work. How does QBE handle "OR" conditions? For example when searching a telephone book ...
2
votes
0answers
410 views

SQLite Performance Tuning

I have the following query, which fetches data from only one table. It is a query which is supposed to return data for an autocomplete function. Autocomplete data can be in text1 or text2. The ...
2
votes
0answers
386 views

SQL fulltext accent insensitive

I am using SQL Server fulltext containstable and the column which is indexed has collation Czech_CS_AS, so why when I have word "byt" it returns records with word "být" too. I thought that the ...
2
votes
0answers
118 views

SQL fulltext indexing ranking combined with ranking used by window's file indexing service

We have a list of records contained within a MS SQL database table, we have enabled "Full Text Indexing" on the table. Also, we have set up a window's file indexing service and added a catalog ...
2
votes
0answers
254 views

How to get SQLCMD to output errors and warnings only?

How can you get SQLCMD, when executing a SQL script file, to just output any errors or warnings it encounters? I essentially dont want information based messages to be output.
2
votes
0answers
385 views

SQL Developer Data Modeller and Data Dictionary question

I'm not a DBA but I am a (mostly!) competent SQL report writer. Can I trouble you DBAs for some pro-knowledge, please? I can connect SQL Developer to Oracle XE's data dictionary without any problem, ...
2
votes
0answers
332 views

What is causing all of the msrepl_tran_version columns to become out-of-sync between locations in transactional replication setup?

I have been having a recurring issue with transactional replication setups at the firm I work for. We use SQL 2008 R2. Seemingly without warning or any replication errors, all of the ...
2
votes
0answers
102 views

sql data to a csv-file via cobol

I 'm using the following code : string 'insert into ' delimited by size 'tgamGameTeams ' delimited by size '(Id,Name,RemainingBudget,TeamGamePoints,GameId) ' ...
1
vote
0answers
23 views

Merge/combine two queries with different dates

I have one query that runs a SUM statement based on daterange 1, and worked fine, and another query that run same SUM statement, but on a different date range. I would like to merge/combine the two ...
1
vote
0answers
37 views

MySQL fulltext selection performance

I have 1.5M rows in a table. Following is the table create code: CREATE TABLE `jobs` ( `id` INT(8) NOT NULL AUTO_INCREMENT, `job_id` VARCHAR(50) NOT NULL DEFAULT '', `title` VARCHAR(255) ...
1
vote
0answers
49 views

Database Structure Definiton

This is a question more so on the table definition vs actual programming. I have 6 sets of potentially 255 unique fields. I have a potential of getting 40 million records per year of these. For the ...
1
vote
0answers
38 views

Is it recommended to have redundant foreign key columns?

Imagine I have the models A, B, C e D, where A have many Bs, B have many Cs and C have manyDs: Without redundance A | id | ... | ------------ | ... | ... | B | id | a_id | ... | ...
1
vote
0answers
54 views

Database Mail not sending

I'm trying to send email using the DatabaseMail on SQL Server 2008, I can see my emails sitting in the msdb.dbo.sysmail_unsentitems But they just sit there, I get no error messages. I've checked ...
1
vote
0answers
48 views

Join and aggregate result and insert blanks for missing appendants

Consider these two simplified tables: CREATE TABLE "sources" ( "id" serial NOT NULL, "name" text NOT NULL, CONSTRAINT "sources_pkey" PRIMARY KEY ("id") ); CREATE TABLE "values" ( ...
1
vote
0answers
38 views

Testing equivalence in strings with different character sets

I have to synchronize a number of tables with string columns between two databases: the source Oracle 10.2.0.3 NLS_CHARACTERSET WE8MSWIN1252, NLS_LENGTH_SEMANTICS BYTE the destination Oracle ...
1
vote
0answers
38 views

Failover cluster connection issue

I'm trying to run SQL Server Failover cluster in Azure. I have NODE1 and NODE2 in a cluster and another SERVER in the same network trying to connect to the database server using the instance from ...
1
vote
0answers
46 views

appending 2 tables based on common columns in Postgresql 9.3

I have 2 large tables that I need to combine into a single table--for statistical analysis. The two tables have some variations in column named, otherwise I would just use an INSERT statement. So I ...
1
vote
0answers
28 views

Transactions using Isolation Level on databases with FileStream

We have a highly transactional application. We have a requirment to upload huge data into our database that can happen for a duration of 5-10 minutes. During our upload time, the tables are getting ...
1
vote
0answers
23 views

What to do when the error message is longer than 4000 in T-SQL?

I have a OPENQUERY linking to an Oracle server that is failing. (I can't make any changes on the oracle server) But when it returns the error string it is cut short because it returns the query in ...
1
vote
0answers
42 views

Getting upcoming world wide releases from a database

From my database I want to get upcoming world wide release dates for an itemId along with the platformIds. If I have a table that looks like this and the current date is 2014-05-14 ...
1
vote
0answers
85 views

Storing changes to stored procedure and triggers in PostgreSQL

I want a mechanism where I can store/track changes in stored procedure and triggers. I want to track these logs in some table. What is the best possible way ?
1
vote
0answers
117 views

Best practice - SQL Schema to store Timerecords for a Time and Attendance module

I'm starting a time and attendance module in C# and SQL. There will be many time rules depending on every shift. For example: Shift 7:00 - 14:00 for Administratives: 15 min grace time, but if ...