An acronym for "Structured Query Language", 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 access privileges.
4
votes
0answers
153 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 subsequently
...
3
votes
0answers
39 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
229 views
Query to find optimal filegroups for objects
I have been assigned a task to create four file groups (one per volume) locate tables so that they are located in a manner that during an ETL process no filegroup is being read and written to at the ...
2
votes
0answers
103 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
117 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
48 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 ...
2
votes
0answers
140 views
Sybase SQL - Truncation error occurred. Command has been aborted
Need help with below code, as it fails with truncation error
Truncation error occurred.
Command has been aborted.
create table monCacheQuality (
ServerName sysname
...
2
votes
0answers
81 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
38 views
What is the equivalent of a “Certificate of Destruction” when using a cloud-hosted database?
We have a Rails application hosted by Heroku and using an Heroku Postgres database. Some of the information we store is considered to be sensitive by our users, and we've been asked if we can provide ...
2
votes
0answers
41 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
476 views
Error 9001, Severity: 21, State: 1 The log for database 'DB_NAME' is not available
I have a SQL Server 2008 R2.
I got a mail that the backup had failed, I opened the SQL log viewer and started browsing.
And i found these two errors a bunch of times.
error 1:
Date ...
2
votes
0answers
102 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
209 views
Help with SELECT queries
I need help with some queries. I struggled do find out how to do it, but I think I finally caught on or at least got the results I was looking for in the database.
These are the tables (given by my ...
2
votes
0answers
80 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 ...
2
votes
0answers
85 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 ...
2
votes
0answers
141 views
MySQL database structure: more columns or more rows
I collect how people tag topics with categories in table like:
ID | topic_id | votes_Category_1 | votes_Category_2 |.......... | votes_Category_12
This table holds 1 row per topic and dynamically ...
2
votes
0answers
62 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
235 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
187 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
76 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
118 views
Allow users to do anything within his own schema but cannot create or drop the schema itself
I have created a schema in SQL Azure using following permissions on my database role:
CREATE ROLE myrole AUTHORIZATION dbo;
EXEC sp_addrolemember 'myrole', 'myuser';
CREATE SCHEMA myschema ...
2
votes
0answers
86 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
158 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
210 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
217 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
69 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) '
...
2
votes
0answers
179 views
Oracle faster overlap check
We've a table with two columns beginrange and endrange, which contain hex values.
To this table no overlapping ranges should be inputted.
We had implemented the check by having a composite functional
...
1
vote
0answers
37 views
Search for multiple keywords related to separate columns on a single table
Imagine I have a table with the schema shown. Each of the columns represent a searchable collection that I would like to be picked up in the search. I am looking for a method that would derive the ...
1
vote
0answers
23 views
Is there a generic SQL-92 ODBC 64-bit Mac driver for Python?
I have a 4D SQL database which implements SQL-92.
4D's ODBC driver does not work on my system because it is compiled for 32 bit (and I am on 64 bit) and it is closed source.
I wonder if there is ...
1
vote
0answers
38 views
Database Timeout Error from VB Application
Recently we are receiving so many database timeout error from different servers
we are using vb application -- which will use ODBC connection to connect database - here no problem
when we run the ...
1
vote
0answers
68 views
Getting LCK_M_S On read committed Snapshot Isolation
I'm getting LCK_M_S on read_committed_snapshot isolation. From my understanding, this isn't supposed to happen since my selects are not placing shared locks anymore.
From my logs, I can see that my ...
1
vote
0answers
46 views
Why is this query creating 300+ temporary tables in Mysql?
SHOW global STATUS LIKE '%tmp%';
set @UID = 132;
set @param2 = 'cde';
set @param3 = 20130331;
set @param4 = 'C';
select p.id, p.column44, p.column42, ue.column35, u.id, p.column43, p.column45, ...
1
vote
0answers
91 views
Collect CPU, reads and writes when replaying SQL Profiler Trace
I'm trying to replay a trace on a test environment with SQL Profiler in order to benchmark a database prior to making some performance tweaks. I intend to replay the same trace at various stages to ...
1
vote
0answers
44 views
Update table mysql and if value is 10 update another table
I've following sql to update results table:
$mysqli->query("UPDATE results
SET result_value = IF('$logo_value' - result_tries < 0 OR '$logo_value' - result_tries = 0, 1, ...
1
vote
0answers
157 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: ...
1
vote
0answers
38 views
Will Startup Procs Run Again After Database Recovery?
We have a number of stored procedures that run on startup via the sp_procoption startup:
exec sp_procoption 'ProcName', 'startup, 'true'
A customer's server started up with a very large database in ...
1
vote
0answers
163 views
Efficiently retrieve big amount of data based on date range
Table EVENTS
TimeStamp |O.Name |Location |Source |
2008-11-12 |Pretorian|Európe |England |
2009-12-24 |Lex Rosa |Európe |Italy |
2010-01-01 |Nasdaq |USA |Whasington |
...
1
vote
0answers
383 views
The Cluster service failed to bring clustered service or application 'SQL Server (MSSQLSERVER)' completely online or offline
SQL Server service restarted/stopped, which cause the production database down n find this errors in System log.
ERROR5:The Cluster service failed to bring clustered service or
application 'SQL ...
1
vote
0answers
74 views
Problem with order by in MySQL subquery
I'm running a query that runs in about 2 seconds when the subquery does not include the order by date_sold clause. However, when I add the order by clause, the query runs forever.
I'm confused, since ...
1
vote
0answers
59 views
Calculate lower and upper quartile of SQLiteDB via query
I want to calculate the upper and the lower quartile of the value what I call "diffs" in these fiddle with my DB and the query
How can I do this with SQLite?
There's an extension on the ...
1
vote
0answers
199 views
sql agent job hangs without any errors or warnings
Problem:
we have a SQL Agent job which runs everyday in the morning at 4:00 am. This job hangs sometimes without providing any errors or warnings. It just hangs. BUT when i stop the job and run again ...
1
vote
0answers
53 views
Oracle update query sequence of actions on DB side
I searched online but could not find particularly consolidated source of what happens when you execute an update query. I know that there are a few actions happening like create redo data and logs ...
1
vote
0answers
108 views
big mysql database optimization
My Joomla mysql database has about 3.4 million rows in content table. It is just static article. Very slow and often use out of resources. To speed up it, I segmented it into 6 sub-tables and added ...
1
vote
0answers
59 views
Mysql: Large Query with subqueries optimization
Any query optimization gurus in the house??
Anyway, I am trying to attack this on two fronts, one being to code a way around it but secondly, I'm thinking some real optimization might help in the ...
1
vote
0answers
39 views
Slave as a master in PostgreSQL
I have set up a hot standby in PostgreSQL 9.0 on Windows.
I want that, at the time of fail-over, the slave should take over the role of master and start performing operations (both read and write) ...
1
vote
0answers
62 views
need a sql query to find out the Database wait time ratio for MySQL
Oracle supports sql queries to SYS.V_$SYSMETRIC to find out Database Wait Time Ratio (% of wait or bottlenecks experienced in time spent on user-level calls) ...
1
vote
0answers
62 views
Pass in dynamic value to Oracle job scheduler
How does one pass a dynamic value into the oracle job scheduler when the underlying command is a stored procedure?
example procedure:
create procedure foo (bar varchar2)
...
Job creation in ...
1
vote
0answers
133 views
Multi-Table Join to Single Destination
I am having a serious performance issue with join together four tables and placing the results (in a certain permutation) into one destination table. I am using MSSQL 2008 and good ole T-SQL.
To ...
1
vote
0answers
241 views
How can one reliably update a LOB column with data from another LOB column in Oracle?
I have tried:
UPDATE "SCHEMA".TABLE SET LOB_COLUMN = (SELECT LOB_COLUMN FROM "SCHEMA".TABLE)
I have tried:
CREATE OR REPLACE PROCEDURE COPY_LOB_DATA IS
OLD_BLOB BLOB;
NEW_BLOB BLOB;
...
1
vote
0answers
48 views
why size of data files is not grow up even existing data?
currently, I created 1 partition table with 1 file group and 4 data files (4 quarter/year).
Data have been inserted successfully. And everything is right when I check records belong to which ...



