DatabasesSponsored by Jamf Now





Databases are organized collections of data, most commonly accessed through management systems including schemas, tables, queries and processes that allow users to enter and manipulate the information or utilize it in other fashions, such as with web applications or for reporting purposes.

Share tech news, updates, or what's on your mind.

Sign up to Post

Hi, in the select query I created, everytime I input a number in Criteria, Access automatically puts brackets around the number and forces me to input a parameter value.  The table the query is built off of shows Numeric for this field.  Any way to fix this?  I won't be able to upload the database for data sensitivity reasons.
Ultimate Tool Kit for Technology Solution Provider
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Currently working on an app in A with 3 pages (activities if you will).

A login, register & reservation page. All work fine except for the latter. Whenever i try sending data to my local database, on the reservation page I get an error. The error's inside my succes/fail message after i've pressed the send button

How do i fix this ?

emulator error message
Reservation.JAVA (called Reserveer.JAVA)

package com.example.baudelo.zeilreservering;

import android.os.Bundle;
import android.view.View;
import android.widget.EditText;

public class Reserveer extends AppCompatActivity {
    EditText Eindereservering;
    protected void onCreate(Bundle savedInstanceState) {
        Eindereservering = (EditText)findViewById(;

public void OnRes(View view) {
    String dte_datum = Eindereservering.getText().toString();
    String type = "reserveer";
    BackgroundWorker backgroundWorker = new BackgroundWorker(this);
    backgroundWorker.execute(type, dte_datum);


Open in new window


package com.example.baudelo.zeilreservering;

import android.content.Context;
import android.os.AsyncTask;


Open in new window


In my LAB I have installed the MBAM server and SQL DB's on a cluster. Reporting services also installed...
I can access the MBAM web page without problems.

GPO's configured as well.

However, after noticing that I can't find any recovery info of my test devices I wanted to check directly in the database.

There are no tables in the DB at all.

I then dropped the Recovery DB and created it again.
No errors whatsoever, but the DB still doesn't contain any tables.

Also not in the Event Viewer. It all looks fine. But DB remains empty.

Any ideas?


Another help required experts out there on the combo box, I have created the stored procedure specifically to supply the much needed combo box in C# Windows Form Application, but it does not work at all, what I’m missing here. The stored procedure is below here, I want only the city name that is all:

Stored Procedure ([dbo].[usp_GetAllAddresses])

1. CREATE PROCEDURE [dbo].[usp_GetAllAddresses]
2. AS
4. SELECT [P_Id] as ID
5. ,[LastName] as LastName
6. ,[FirstName] as FirstName
7. ,[Address] as Address
8. ,[City] as City
10. END

The final piece of code behind the form is also here:

1. private void btn_FillWithDataSet_Click(object sender, EventArgs e) {
2. try {
3. DataSet dsDataFromDB = GetDataFromDatabaseinDataSet();
4. comBox_FilledWithDataSet.DataSource = dsDataFromDB.Tables[0];
5. comBox_FilledWithDataSet.DisplayMember = "FirstName";
6. comBox_FilledWithDataSet.ValueMember = "City";
7. } catch (Exception exc) {
8. MessageBox.Show(exc.Message);
9. }
10. }
11. private void comBox_FilledWithDataSet_SelectionChangeCommitted(object sender, EventArgs e) {
12. lbl_DataSetValue.Text = "City Name: " + comBox_FilledWithDataSet.SelectedValue.ToString();
13. }
14. public DataSet GetDataFromDatabaseinDataSet() {
15. DataSet ds = new DataSet();
16. try {
17. // database Connection String
18. string connectionString = "Server = .; database = CaPremier; Integrated Security = true";
19. …

I am designing an online SQL database for ordering products on my web app.
I am trying to work out the best way to handle the "Basket".
The easiest way in my mind would be to retain the IDs of the items that
a user selects using cookies so that if the user leaves the page and comes
back I can use the cookies to show which items were selected.

An alternative option would be to have a SQL table that is structured
like my Products table. I would insert the user's selected items into this table.

I could also use my Orders table and show the Order status as being in the basket.

I'm looking for a little feedback on this. Thanks
Hi experts,

I saw this example on Grouping with linq.

I also saw this example.

I have a ASP.NET MVC application using C# , Razor and Entity Framework, database first model.

I'm using the Orders table from the Northwind database.

My application directory looks likes this:

My controller looks like this:

My view looks like this:

When I run my app it shows the Orders table.

Now I want to Group it by Customer ID.

I looked at this example to try to group my example but I'm having a hard time grouping it.

How do I revise my example so it groups by CustomerID.
So my View should look like this:


This is my current code for my Controller:

using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.Mvc;
using NorthwindApp.Models;

namespace NorthwindApp.Controllers
    public class HomeController : Controller
        private NorthwindEntities db = new NorthwindEntities();

        // GET: /Home/
        public ActionResult Index()

            // Order by 

Open in new window


I am trying to optimize some Store Procedures that I have in my Database but I still don't fully understand the logic. Maybe you could help me with this one, which is the simplest, so I can work with others on my own. I have been reading in many forums that using Joins is more profitable than using cursors.


/****** Object:  StoredProcedure [dbo].[SP_cursor]    Script Date: 06/14/2018 00:37:08 ******/


alter procedure [dbo].[SP_cursor]
   @CODI_TDOC_TTD_IN       numeric(9)
  ,@NUM_DOC_TDOC_IN        varchar(40)
  ,@ASUN_DOC_TDOC_IN       varchar(2000)
  ,@FECH_DOC_TDOC_INI_TXT  varchar(10)
  ,@FECH_DOC_TDOC_FIN_TXT  varchar(10)
  ,@OFI_EMI_TSEG_IN        int

   declare @FECH_DOC_TDOC_INI  datetime
   declare @FECH_DOC_TDOC_FIN  datetime

      CODI_DOC_TDOC    numeric(9)      not null
     ,NUM_DOC_TDOC     varchar(40)     null
     ,NRO_REG_TDOC     int             null
     ,ASUN_DOC_TDOC    varchar(2000)   null
     ,FECH_DOC_TDOC    datetime        null
     ,FECH_ENV_TDOC    datetime        null
     ,CODI_TDOC_TTD    numeric(9)    

Open in new window

Hi - I have the following code which is used to post the value of a hidden form element to the page via PHP Post - the values and rows are generated from grabbing results from a database and it will output the results for each entry found.

The issue I have is the value posted called 'elm2' is always posted as the last one on the results set - i.e., it the last value on the table for t_ID is '33' then regardless of which row I click, it will always post as 33 - I think I can see the problem, all the outputted rows have the same name/id, but different values and I think it is just taking the last one on the list and posting this, not the one I am clicking.

Is this the problem and is there any way around it, or another way I could approach it?


$conn_task = new mysqli($dbhostname, $dbusername, $dbpassword, $dbdatabase);

$elm1 = $_POST['elm1'];
$elm2 = $_POST['elm2'];

echo "$elm1";
echo "$elm2";


form start

<form id="PH33FORM" action="<?php echo $_SERVER['PHP_SELF'];?>" method='post'>


    if ($conn_task->connect_error) {
      die("Connection failed: " . $conn_task->connect_error);

    $sql = "SELECT * FROM xxxx";
    $result = $conn_task->query($sql);

    if ($result->num_rows > 0) {

      while($row = $result->fetch_assoc()) {

        $t_ID = $row["VWDF1"];
        $t_date = $row["tsk_aim_date"];

        echo "<tr><td>" . $row["t_ID"]. "</td><td>$t_date</td><td 

Open in new window

I am filling labels on a form from two Access Database tables using VB.Net. My first SQL statement works perfectly and populates the datatable correctly. The second database connection is not working correctly but the SQL statement appears to be written correctly. In the second SQL statement I want to pull the QTY value from two different rows. The error I get during build is because the second data table is empty. Here is my code and thanks in advance Experts.

Dim cmd As New OleDbDataAdapter
        Dim cmd2 As New OleDbDataAdapter
        Dim iCalc1 As String
        Dim lCalc2 As Long
        ' Dim ds As DataSet
        Dim dt As DataTable = New DataTable()
        Dim dt2 As DataTable = New DataTable()
        ' ds.Tables.Add(dt)

        iCalc1 = TxtPartN.Text
        lCalc2 = TxtQty.Text
        Using conn As OleDb.OleDbConnection = CreateConnection()

            cmd = New OleDbDataAdapter("Select Customer, [Matl Code], [Box Code], [Part Wt Grams], [Piece Box] from [Parts Data] where [Part Number] = '" & iCalc1 & "'", conn)

            LblMCode.Text = dt.Rows(0).Item(1)
            LblBCode.Text = dt.Rows(0).Item(2)
            LblMatNeed.Text = dt.Rows(0).Item(3) * lCalc2 / 453.59237 & " Lbs"
            LblPCount.Text = dt.Rows(0).Item(4)
            LblBoxNeed.Text = lCalc2 / LblPCount.Text

        End Using
        Using conn As OleDb.OleDbConnection = …
Hello experts. I have an ms access 2016 front end form which is tied to a sql database. I have a currency field (text box) on the form that is automatically rounding entries. So for example if I enter $33.68 it changes the number to $34.00. I do not want the number to round. Simply keep what is typed. On the property sheet in access the textbox format is currency and the decimal places is set to 2. On the sql table properties for that field the data type is set to float. What might I be missing?
IT Degree with Certifications Included
IT Degree with Certifications Included

Aspire to become a network administrator, network security analyst, or computer and information systems manager? Make the most of your experience as an IT professional by earning your B.S. in Network Operations and Security.

I have an IIS 7.0 server connecting to an SQL 2012 Database. On the SQL database I have added a number of linked servers and created a distributed partitioned view to consolidate data from the multiple linked servers. I have a common Windows account on the main server and the linked servers that is common to all (same password). Querying this view from SSMS on the SQL server works fine logged in as the common user. The application pool I am using uses this same user (also on the IIS server) to connect to the SQL server using Integrated Security. I have a simple query of SELECT SYSTEM_USER when run from IIS reports the common  user. When trying to retrieve the data from the linked server view I get Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. instead of the data in the view.

Help appreciated

for Oracle, any feature/way to move all oracle DB files on RAM , not just logical table / objects?
Hi there.
I'm adapting a tutorial which uses ajax and php to pull information from my database, when  the user scrolls to the bottom of the page.

I noted however, that when I was reaching the bottom of the page, information wasn't always getting pulled from my database. I amended my code slightly to include my div tags within the php echo  (as per the original code) and the code now works (to an extent)  - it's pulling information as specified from the database.

So my working php code which displays the information on the page, and reloads is the following :

while($teacher = mysqli_fetch_array($data))
			//here we are displaying the information from the database
			echo '
			<div class="container">
			<div class="col-sm-6 col-md-4 buffer">
			<div class="card" style="width: 100%;">
				<div class="card-header">
				<img src="../public/img/flags/'.$teacher['nationality'].'flag.gif">
				<div class="card-body">

Open in new window

However, I want to display more information within the while.. The following code represents the information I want to display within the while loop and how it should appear. This code displays everything correctly on it's own but the pulling of the data does not seem to work with it.  

<div class="row">

Open in new window

When I run a select statement on a SQL Server table, the current date format of all date columns is YYYY-MM-DD HH:MM:SS.0000000
Is there a way I can change the output to be viewed as DD/MM/YYYYY HH:MM:SS.000 ? Please confirm.

2002-03-01 00:00:00.0000000
2002-02-01 00:00:00.0000000
2002-01-01 00:00:00.0000000
2001-12-01 00:00:00.0000000
2001-11-01 00:00:00.0000000
2001-10-01 00:00:00.0000000
Hello Experts,
Currently I am in the process of comparing a large number of tables between two databases. The source db is Sybase and the destination to which it was migrated to is SQL Server. One simple but a tedious way is to save the output as text files and compare it with each other using file comparison, which really is not efficient when the rows are several hundred thousands. Hence, would like to know if there is an easy way out.

Thanks in Advance!
I have made a clone of one of our live servers as a VM for testing purposes.   I have the VM offline so as to not to interfere with anything running on the live server.  I have renamed the test server and the database on the test server.  For the application I need to test I need to create a mapped drive and use the UNC path to access it.  When the server is offline it will not allow me to access the local share by unc or let me map it.  If I connect to the network then it will let me do that.  We have an application that the developer that wrote it is no longer with us and nobody currently knows how to point it to the test server so to keep things safe I need to keep the test server offline.  I tried using the SUBST command to map the drive offline but that will not work as it's not using a unc path.
Software SQL Server 2005, Redgate Sql Compare.

I have a local database that has some small changes to a tables structure and I want to make the same changes in a remote database.
How can this be done,

Thanks for your help!
I have a SQL Database admin that is having difficulty with backups of a specific database. She has researched enough to know that the SQL Server Agent service is running as local system and other servers that work have it running as NT Service\instancename. I do not know how those services get installed for SQL and how it is decided what the service runs as . I know how to change her Local System to an active directory account and hard code in a password but do not know how to change a service to NT Service\..I need some advice on how a service LOG ON AS becomes NT Service or if it is even possible for me to manually set it that way. Please see the attachment. Am I able to modify her SQL SERVER AGENT to LOG ON AS NT Service\instancename   ?
One of our DAGs in our 2010 Exchange environment went down due to an issue with our Hyper V cluster. It has been off for several days now and the plan is to turn it back on this weekend after the repairs have been completed to the Hyper V cluster. We are also seeing an issue with the logs filling up the drive where the databases reside on the DAG that is up. The drive still has enough free space but I'm wondering if they are filling up b/c replication is not occurring. Backups are running normally.

Once the server is turned back on and the Exchange services have started will the databases start to re-sync? Do we need to purge the log files prior to this? There is nothing wrong with the server itself we simply couldn't turn it back on due to lack of resources on the host.

Exchange environment is a single CAS and 2 DAGs running Exchange 2010 SP3.

Thanks in advance for your assistance.
Introducing Cloud Class® training courses
LVL 12
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

After being hit with Ransomware, restoring from backup, and reinstalling applications as needed, I can't get the Quickbooks Database Server services started or the Quickbooks Database Server Manager to run. When I browse for files and 'Start Scan", it attempts to start the services after browsing the files, finding Quickbooks files. It claims the folder in which the company files live isn't shared. I guess that's technically true, but the directory one level up IS shared, so it's possible to browse to it from a network share. Then it tells me it is attempting to resolve Networking issues, and tells me after that to resolve network issues and try again later (not the exact syntax, obviously).

I have tried installing just the bare server (what we had done in the past), installing the full version of Quickbooks (2016 for the moment), uninstalling, rebooting the server (2008 R2), reinstalling just the database server, using the Quickbooks clean boot utility, disabling ALL firewalls (Kaspersky and WIndows Firewall), I can't get the QBDbMgrN to start and stay started. I can't get the QuickbooksDB26 started. For some reason it claims to be a service that should be started manually. I don't recall that having been the case in the past.  Also,  I don't think the QuickbooksDB26 ever disappeared, even after a clean install (using the Clean Install tool), an uninstall, and/or a reboot.

Previous to the ransomware, the server had Quickbooks 2015 and 2017 database servers installed. …
Randomly I receive 'corrupted' from a php form.

The 'corruptions' are always the same, and cause my scripts to fail as integers are delivered to my database as a mix of text and integer.

An example would be as below. The actual text has been replaced with XX and NN, but I have left the corruptions in place - see 1961댊 in the birthyear field and Mr0 in the title field. Both inputs are from a select form field, which are correct.

SQL: set dateformat dmy insert into tblmembers ( accountno, companyid, memoldaccountno, memaccountreference, memsubaccountreference, mempreviousscheme, mempreviousschemeno, title, firstname, surname, email, mobile, telephone, birthday, birthmonth, birthyear, gender, image, memberstatus, primarymember, uniquemember, createdby, token, consentemail, consenttext, consentpost, consentphone, terms, termsaccepted, createddate, updateddate) values ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, getdate(), getdate(), getdate() ) ; SELECT SCOPE_IDENTITY()

PARAMS:: 'array ( 0 => \'xxxx-A-xxxx\', 1 => \'xxx\', 2 => NULL, 3 => NULL, 4 => NULL, 5 => \'\', 6 => \'\', 7 => \'Mr0\', 8 => \'xxx\', 9 => \'xxx\', 10 => \'\', 11 => \'nnnnn\', 12 => \'nnnnn\', 13 => \'02\', 14 => \'nn\', 15 => \'1961댊\', 16 => \'F\', 17 => NULL, 18 => \'Active\', 19 => \'primary\', 20 => \'xxxxx\', 21 => \'Online signup\', 22 => \'xxxx\', 23 => \'Yes\', 24 => NULL, 25 => NULL, 26 => NULL, 27 => \'VersionDate: nnnn\', )'

I have the Postgres SQL below in an API function. I am passing the $id and $ic variables. The $ic variable can be an array of values or a single value.
    WITH cte as (
        SELECT partnerslistori as a FROM sales.members WHERE id = '".$id."'
    SELECT as actualid,
    	(SELECT || ' (' || ||')' FROM support.members m WHERE = AS actualcompany,
    	DATE_PART('day', CURRENT_TIMESTAMP - u.datein::timestamp) AS daysinstock, 
    	TRIM(u.grade)::character varying as condition, 
    	u.vstockno AS stock, 
    	u.hol AS ic, 
    	CASE WHEN u.rprice > 0 THEN 
    	END AS price, 
    FROM u 
    WHERE u.holl in (".$ic.")
      AND visibledate <= now() 
      AND = any(regexp_split_to_array('".$id.",'||(select a from cte), ',')); 

Open in new window

Now, I need to "aggregate" the results for a single id and contactenate the vstockno values and sum the quantity values into a single record.

For instance, if I return CSV this using the sql above:
"G06","WAP (G06)","CALIPER",370,"C","CAE17366","536-01036",1.00,1,"CY31B05"
"G06","WAP (G06)","CALIPER",770,"C","CAD16821","536-01036",1.00,1,"CALIPERCO"
"G21","WNB (G21)","CALIPER",257,"C","NBI17724","536-01036",1.00,1,"R3415"
"G21","WNB (G21)","CALIPER",128,"C","NBA18095","536-01036",1.00,1,"R2804"
"K17","GAAAP (K17)","CALIPER",270,"C","7I1581","536-01036",,1,"B5-A04"
"K17","GAAAP (K17)","CALIPER",267,"C","7I1594","536-01036",,1,"B4-B04"
"K17","GAAAP (K17)","CALIPER",78,"C","8C1210","536-01036",,1,"[UNKNOWN]"
"N40","WAC (N40)","CALIPER",147,"C","MNA18002","536-01036",1.00,1,"[UNKNOWN]"
"N49","YUPIP (N49)","CALIPER",77,"K","DS180429","536-01036",6.00,1,"UPULL-E"
"V02","CBAP (V02)","CALIPER",1408,"A","CKA1301","536-01036",40.00,1,"[UNKNOWN]"
"V02","CBAP (V02)","CALIPER",350,"A","CPA1257","536-01036",12.00,1,"BIN.360.A"
"M16","BAP (M16)","CALIPER",196,"A","8A067","536-01036",,1,"LOT-23"
"M23","BA (M23)","CALIPER",115,"A","8A065","536-01036",15.00,1,"36AU"
"M21","BUPI (M21)","CALIPER",115,"A","8A065","536-01036",15.00,1,"36AU"

Open in new window

I want it to return this instead; the stock and location columns are concatenated and the quantity is summed when there is more than one result for a particular id:
"G06","WAP (G06)","CALIPER",370,"C","CAE17366, CAD16821","536-01036",1.00,2,"CY31B05, CALIPERCO"
"G21","WNB (G21)","CALIPER",257,"C","NBI17724, NBA18095","536-01036",1.00,2,"R3415, R2804"
"K17","GAAAP (K17)","CALIPER",270,"C","7I1581, 7I1594, 8C1210","536-01036",,3,"B5-A04, B4-B04, [UNKNOWN]"
"N40","WAC (N40)","CALIPER",147,"C","MNA18002","536-01036",1.00,1,"[UNKNOWN]"
"N49","YUPIP (N49)","CALIPER",77,"K","DS180429","536-01036",6.00,1,"UPULL-E"
"V02","CBAP (V02)","CALIPER",1408,"A","CKA1301, CPA1257","536-01036",40.00,2,"[UNKNOWN], BIN.360.A"
"M16","BAP (M16)","CALIPER",196,"A","8A067","536-01036",,1,"LOT-23"
"M23","BA (M23)","CALIPER",115,"A","8A065","536-01036",15.00,1,"36AU"
"M21","BUPI (M21)","CALIPER",115,"A","8A065","536-01036",15.00,1,"36AU"

Open in new window

Can this be done in a single SQL statement?
My shop currently uses both Oracle 11g Single-Instance, and Oracle 12c RAC databases.  A contingent of managers, co-workers and peers are very interested in pursuing a PostGress solution.  Can you point out some of the pros/cons of both database vendors and their solutions?  By the way my application has requirements for 7/24, high availability, load balancing, and the requirement to perform Point-In-Time (PITR) when and if required.  Also database needs to be hosted in an Linux environment.
One of my sql sever cluster index fragmentation keeps hitting 99% every morning. I have rebuild and reorganized and have changed FillFactor from anywhere 75 to 100 with no avail. Any ideas what is going on with this one table.
Hi Team,

I need an help on creating  3 materialized view which will refresh every 1 hour  another every 6 hrs and another every Wednesday of the week. Any help in this regard is really appreciated.

DatabasesSponsored by Jamf Now





Databases are organized collections of data, most commonly accessed through management systems including schemas, tables, queries and processes that allow users to enter and manipulate the information or utilize it in other fashions, such as with web applications or for reporting purposes.