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)

0
votes
1answer
13 views

Facing SQL Error 3403

Recently I was working in SQL Server and I faced an error called SQL Error 3403 which was stating "Error 3403, Severity 22 During recovery initialization, page %ld was encountered. This page belongs ...
0
votes
0answers
17 views

Adding a second database to the same instance of a server

I already have a multi user software program running on Windows 7 work stations and the server is running Windows Server 2008r2. I am trying to setup another program using the same server. The code is ...
0
votes
0answers
10 views

How to determine is a value exists in a column within a partition

I have a set of data where I need to look at partitioned data and determine if a value exists within that partition. Example data: AccountNumber Code Status Credited ...
1
vote
1answer
34 views

changing SQL data types from varchar(50) to smaller rational types increases table space

in my case i want to understand why changing varchar(50) types to optimized smaller types caused the table containing 61065164 rows to grow from 3.1 GB to 4.46 GB and not get smaller as expected. ...
0
votes
2answers
46 views

SQL Multiple JOINS Interpretation order [on hold]

I have a big problem of using multiple joins in one SQL Statement. For example i have 10 Tables which they are tbl1,tbl2, tbl3,..,tbl10. I would like to select some columns from each table from tbl1 ...
1
vote
1answer
22 views

Alternate per 2 postgresql rows, but start over if there are rows remaining

I'm trying to select below table, grouped by two (=max, if there is only one, show one) of each supplier_id. But, after all suppliers are selected it needs to start over. So this is the table: Table: ...
0
votes
1answer
32 views

Combine two updates [on hold]

I want to combine the following SQL statements into one: Update ENGROYLIB/UCOMPFL Set AddrLn1 = 'ELECTRIC LIGHTING STATION,', AddrLn2 ...
0
votes
2answers
30 views

How to select the largest value of the same column in multiple tables?

I have multiple tables which have some columns with the same meaning, eg., event_timestamp. The schemas are like following: Table A: ...
1
vote
1answer
19 views

#2014 - Commands out of sync. you can't run this command now. Query was working before. But now it is not working

My table structure is ... There is Counter which has many Box in it. Box has a one BoxType. and Collection stores Box datewise revenue and data. I need data of particular 1 COUNTER (Data of All the ...
0
votes
1answer
19 views

Alternative to RDBMS: Modeling Exam/Testing data

I'm a born and bred relational database guy and C# programmer dude. IBM DB2 & VB.Net in school. TSQL & C# at work. I'm planning a project for fun: Designing a Testing platform that goes from ...
1
vote
2answers
72 views

How to do an =ANY(SELECT…query in postgresql?

I'm trying to select all the latitudes and longitudes for a group of users based on their id being in an array stored in another table. Here's my attempt: SELECT latitude, longitude FROM userloc ...
0
votes
1answer
23 views

Copy of a database with an existing database with schema and data in sql server

I have two databases one is having master kind of tables and other will have transaction data. I should create a new database with a structure of an existing database to my clients. Here is the ...
1
vote
0answers
33 views

Is it bad practice to launch more than 100 sql statements at once?

I have PHP code that is meant to updating the billing status of someone. I only want it to update if the bill has been successfully created and therefore I think a possible solution would be to ...
1
vote
1answer
28 views

Trigger AFTER INSERT on tables with different columns

I'm writing a trigger that works after an insert. This is what I have: create trigger trgInsereQuestao on tblquestaoOpcao after insert as begin set nocount on; insert into ...
0
votes
1answer
17 views

Numeric Latitude & Longitude values are rounded up when querying SQL Server Database

Developing an application that is using Google Maps. Lagitude and Longitude values are stored in the table as the correct value. However when they are pulled into a view the value is rounded to the ...
0
votes
0answers
24 views

table not taking records sequencially [duplicate]

While inserting rows into a table in oracle 10g, the rows are not inserted in the order I am putting them, like for the following inserts: insert into emp values (1000, 'debjani', 30); insert into ...
0
votes
0answers
30 views

Can I create a constraint to a subset of data? [duplicate]

Here's a simplified view of my database |---------------| |-----------| | ORGANIZATION | | CONTACT | |---------------| |-----------| | OrgId | | ContactId | | OrgName ...
0
votes
1answer
21 views

How to list all past remote login information on client SQL server

Instead of using "Remote Desktop" for connecting to SQL server, I and my coworkers are using SQL Server Management Studio to apply the changes on remote server (each users have their own credentials). ...
0
votes
0answers
23 views

What kind of data cannot be stored economically in a database / data-warehouse?

Someone mentioned this in a presentation but didn't provide any examples. This stuck with me and I am trying to figure out what kind of data couldn't be stored economically in datbases ever since. It ...
0
votes
0answers
20 views

merge two column into single columns and show them in separate rows

My Table looks like this Name Date1 Date2 Date3 A 25 23 20 B 20 15 10 I want it like this Name Date A 25 A 23 A 20 B 20 B 15 B 10 how i can ...
-3
votes
0answers
30 views

Backup and Restore

What are the Negative Aspects backup and Recovery in sql server Over these points. Full Backup and Restoration Point in Time Restoration Restoration in Same Instance Restoration in Different ...
0
votes
1answer
24 views

SQL Server error log entry : Error: 17806, Severity: 20, State: 14

I have error in my log for a few weeks, I searched a lot but I couldn't found useful answer. I did closed SQL Server port for public IP, but I have problem yet. Error: 17806, Severity: 20, State: ...
0
votes
0answers
16 views

How to setup a trigger for updated records

Prod database "Mother" Copy of database "Father" Here's my scenario I need help with: I have a database that has a table called User_Group table on our Production db "mother". The dev team wants me ...
-3
votes
0answers
36 views

SQL Pivot by data [on hold]

I have this procedure : alter proc rel_manipula(@inicio datetime,@fim datetime) as select A.codigoins, b.nomeid ,sum(a.qtd), a.dtmov from com_InsusTrans A inner join com_insus B on b.codigoins = ...
1
vote
0answers
22 views

finding out the Backup set physical name

I created a maintenance plan to back up two user databases and system databases over a month ago. I queried the msdb database to view the size of the backups using the following query. SELECT ...
1
vote
1answer
40 views

UPDATE/INSERT into Dynamic Columns

I am trying to update columns based on the value of the inserted column of the table 'my_table'. I want to be able to record the timestamp of the values changed. I am using the triggers but I can't ...
4
votes
0answers
50 views

Timestamp-based index

I have a big database (200GB+) that contains some log info. And I want to speed up SELECT queries and stored procedures. I have a table with a GeneratedOnUtc datetime column, and have a non-clustered ...
0
votes
0answers
3 views

Delete fabricante_producto_solicitud only if is not related to modelo_marca_producto

I have this related tables: It's possible, in one query, check if fabricante_producto_solicitud has relation with modelo_marca_producto or do I need to rely on programmatic way? I need some ...
-1
votes
0answers
13 views

How to convert DECIMAL to DATE in DB2 for iSeries SQL

I am trying to write a SQL query to convert DECIMAL to DATE in DB2 but below error is thrown. Error: [SQL0204] TO_DATE in *LIBL type *N not found Please assist me on this issue. The data type of ...
1
vote
1answer
16 views

Updating one table from another table where non-primary-key field is similar string

I have a database in Access that I am trying to fix (actually, I'm working on a copy of the original). There are two tables, one with data input errors, and a second that is a copy of those errors, ...
-1
votes
1answer
33 views

How to select a record and update another record with selected

Say, I have a table: User User_key User_id User_name User_status State 1 001 Adam Active CA 2 002 Zack Active NY 3 003 ...
0
votes
0answers
16 views

DB2 LUW Timestamp differences in versions

Im new to DB2, my back ground is in MS SQL server 2000 thru 2012. I have a developer using Local DB DB2 LUW v9.7.500.4299 FIXPACK_NUM = 5 She is selecting some data from a table where the field ...
0
votes
1answer
37 views

Why does MariaDB 10.1.2 blow away MySQL 5.6.22 in sysbench?

Problem Maria DB is doing roughly twice the number of transactions that mysql is using standard oltp benchmark. The VM and db's are both fresh installs from vendor apt repos with default configs. ...
0
votes
0answers
17 views

Need help on transferring data from a PostgreSQL database to a future (to be decided) database!

(English isn't my native language) I'm doing an internship for school and my task is to theoretically describe the best way to transfer the data from their current database (PostgreSQL) that they have ...
0
votes
1answer
19 views

multiple table inner join didn't get expected values

Student_register table: regNo pro(HNDIT,HNDA,HNDFT) name start_day etc ... more columns Semester: regNo curSemmester(3,4,5) name The query I used to get values: SELECT ...
0
votes
1answer
13 views

how to overcome these type of issues where null value inserted into primary key not null column in table

how to overcome these type of issues where null value inserted into primary key not null column in table
0
votes
1answer
43 views

Update a set of SQL statements

dbo.MatchFirstName(@FirstName) and dbo.MatchLastName(@LastName) are table Value Functions(TVFs). Problem: In my Update statement i.e Update #Temp after Insert, I want only those rows to be ...
1
vote
1answer
65 views

Query on 250 million records

I have a table with below structure CREATE TABLE [dbo].[ColumnValues]( [Id] [int] IDENTITY(1,1) NOT NULL, [ColumnId] [int] NOT NULL, [Value] [nvarchar](max) NULL, [OutputArea] ...
0
votes
2answers
47 views

SQL Server tuning: Disk queue to OS drive: How to optimize?

I expect to see the disk queue move on the data, tempdb, log and backup volumes. I do not expect to see the OS drive (C:) which has zero SQL files present, show disk queue impact. Assume it is to ...
0
votes
1answer
46 views

Exclusive access to edit rows [on hold]

I'm developing a program that allows users to view and edit data. My question: Is there tools (sql server tools, may be users/roles) to implement the following: There are two users: A and B. User A ...
0
votes
1answer
51 views

Uexpected values inserted in table

I have a table called FunctionWeights which contains data as follows: My query is as follows: select @constVal = FunctionWeight from dbo.FunctionWeights where FunctionWeights.FunctionName = ...
0
votes
1answer
28 views

Update does not working while select returns right results

I am trying to execute the query below: UPDATE( SELECT Ord.Completed FROM Product P INNER JOIN Order1 Ord ON Ord.OrderID = P.OrderID WHERE EXISTS( SELECT * FROM Delivery ...
0
votes
1answer
40 views

Converting sql into mongodb nosql

I am trying to convert oracle sql into its mongodb equivalent version. create table my_hll as select mod(ora_hash(n), 1024) bucket, max(num_zeroes(trunc(ora_hash(n)/1024)))+1 val from previous_data ...
-2
votes
0answers
13 views

which one is better for connecting vb.net to sql? wizard or ado.net coding? [closed]

What is the solution for this picture? Data is not saving in SQL database. I think it happend when i added the grid-view.
0
votes
1answer
23 views

Difficulty with nested query order & grouping

I'm trying to identify the count of objects a user updated during a given day, but only where the user was the final update. Each object can have multiple updates in a day from any user, but the ...
0
votes
0answers
29 views

How can I track changes across 60 local databases with 1 million+ rows each?

The files are mdb and I have them locally on my computer. Just trying to track changes across the 60 databases. Realistically I want to compare two at a time and find the differences in the reports, ...
2
votes
1answer
31 views

How to pass multi-valued characters in SSRS Report?

I have a SSRS report that has 3 data sets feeding off one data source. The main dataset is a stored procedure that is aggregating some data based on a set of parameters powered by the other two ...
0
votes
1answer
36 views

Locking the database to a single user so that other user wont change it

I am using SQL Server CE 4.0. In office the database (.sdf) file are on a server. When I want to change design of the database I have to copy it to local PC and access it since n/w connection to a ...
-2
votes
0answers
33 views

Multiply operation/field causing the record set to 'ungroup'?

I'm trying to sort a query for a report but every time I add a Multiply operation to it the record set result becomes a mess and if I try to GROUP BY I get the legendary ...either an aggregate ...
0
votes
2answers
37 views

Oracle custom week of the year numbering based on first Monday of the year

I have following sql for generating dates, I wanted to change week of the year numbering based on 'First Monday of the Year'. Hence numbering would be, 01-05-15 ---> 01 01-12-15 ---> 02 ...