Databases

54K

Solutions

38K

Contributors

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,

I read that all MySQL database share the same transaction log, is that right?

it can be a big impact on performance, right ?
0
Free Tool: Site Down Detector
LVL 9
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Step : 1  - I am doing bulk  insert    -- This works

step 2 : I need to retrieve BillId


CREATE TABLE #T (IntCol int, XmlCol xml); 

INSERT INTO #T(XmlCol)  
SELECT * FROM OPENROWSET(  
   BULK 'c:\Testing\Test.xml',  
   SINGLE_BLOB) AS x;  
   
      select * from #t   

<filename>
<Transaction>
<Billid>100</BillId>
</Transaction>
<Transaction>
<Billid>200</BillId>
</Transaction>
</filename>

Open in new window

0
Hi, I'm trying a simple example of populating a gridview from a view in SQL and updating the records displayed  back to database.

This is how im binding the data to the grid...
Data.BindCustomersDataContext db = new BindCustomersDataContext();
           var items = (from x in db.vwCustomers select x);
            this.gvCustomers.DataSource = items;
            this.gvCustomers.DataBind();

Open in new window


 select x);
                // Field to update here
                db.SubmitChanges();

            }
        }

Open in new window


Im having problems with the code above. What I want to do is to update all the records displayed, to the database, with the value from another column from the view.
row. column1 = row.column2
 
Im not sure how to do this. Do I need to query the view every time to get the ID? and how do I get the field to update from the grid??

Thanks!
0
I am creating a simple messaging application using mysql and php.
 
This is my simple database and I have put some example data in it. You can see user 1 and 4 have been having a conversation, then there is a few other single messages.

example
I want a list of who has had a conversation with you... like it does on the iPhone…. Eg...

- user 4 should only see 1 entry for the conversation between himself and user 1.
- Then they would click that conversation to show the full messaging history between the 2 users.
 
From the db above for user 4 I would want to see…..
 
User 1 / Message 5 / 2017-07-23 10:13:00
User 2 / msg / 2017-07-23 10:20:00

Currently my simple query looks like this:

SELECT *
FROM message
WHERE userIDTo = $userID
OR userIDFrom = $userID

Open in new window


but this query shows a list of 8 messages, but i only want it to show the most recent messages... in this scenario it would be 2.

Hope my explanation makes sense and you can help.

Thanks

Steve
0
I'm running a big export (10k plus records) and want to watch the progress.  I'm trying to get it to write out the ID number as it loops, but it doesn't write out any text until the loop is finished.  What am I doing wrong?

do while not conn.eof

Response.Write(ID)
Response.Write ", "

conn.movenext
loop
0
how do I join two queries, join them HORIZONTALLY, i.e. extra columns, second columns query 2 to right of first query



--query 1 OUTPUTS
SELECT a.timeStampKey, t.timeStamp,MAX(CASE WHEN a.PIE2_O_ID = 1 THEN value END) AS 'K_DESIGN_SG_A_AVERAGE_A', MAX(CASE WHEN a.PIE2_O_ID = 2 THEN value END) AS 'K_DESIGN_SG_B_AVERAGE_B'FROM   tblOutputs as a INNER JOIN       tblTimeStamp as t ON a.timeStampKey = t.timeStampKey GROUP BY a.timeStampKey, t.timeStamp
--query 2 INPUTS
SELECT a.timeStampKey, t.timeStamp,MAX(CASE WHEN a.PIE2_I_ID = 10104 THEN value END) AS Flow, MAX(CASE WHEN a.PIE2_I_ID = 10006 THEN value END) AS Head FROM   tblInputs as a INNER JOIN       tblTimeStamp as t ON a.timeStampKey = t.timeStampKey GROUP BY a.timeStampKey, t.timeStamp
0
My database is configured with Full recovery mode and use tools inside MS SQL to backup the database.

Should I need to configure anything to truncate / remove the log after the backup ? Will these logs be removed automatically after the backup ?

Thx
0
Hello!

I have a MS access database that has 4 tables and one form.

On the main form, called TaskList, there is a combo box field that allows the user to pick a "ITP Requirement" from the "MasterDoc" table and that autofills one of the columns in the TaskList table also called ITP Requirement. That all works fine, but I have another box below the ITP Requirement that I want to autofill with the description that is in column 2 beside the "ITP Requirement" in the MasterDoc table.

I do not need this description box to autofill into the main TaskList table with the selected ITP Requirement, I just want it to autofill the textbox with the corresponding description from the chosen ITP Requirement. The Combo box for the ITP Requirement is named ITP1 and the field that I want to autofill after that (which is presently a text box) is named Des1.

I tried using the following code as the Control Source in the expression builder of the Des1 text box:

=DLookUp("[Description]","SFICode","[SFICode].[ITP Requirement] = " & Str([ITP1].[Des1]))

But it is not working... Does anyone have any idea why? Thanks for the help! I would attach the database but it contains cost codes etc that are confidential. Please let me know if I need to be more clear with my question.
0
We are converting our databases from mysql to sql on a windows server. I am slowly figuring out the small changes in php coding but can't get it to pull date or time fields.

If I have a simple "Select PName from info" and echo $PName it works. but once I add in "Select PName, SCHTM, SDate from info" and try to echo $PName - $SCHTM - $SDate I get a blank page. SCHTM is a time(7) field with data like 12:45:00 and the SDate field is a date field with things like 2017-08-17    

During the conversion process the SCHTM field now shows 12:45:00.0000000 instead of just 12:45:00
0
I am just filling out and IT security review questionnaire  and not sure how to answer the following questions.
This is regards to an database over a secured internet connection using RSA.  I don't work in IT security and wondering if someone could explain me some basics  regarding  SSL and Two factor authentication.   I have read the RSA has a 128bit algorythm

Any network connection is encrypted through SSL or IPSec mechanisms when possible and symmetric encryption used is restricted to algorithms with a minimum key size of 128 bits..  

Thanks
0
Get MySQL database support online, now!
LVL 3
Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

Hi Experts,

I would like to transfer over a DB to someone.
1-What is the command to execute to make a bak of that file to a given destination?
2- Will that person be able to restore that db without having my login/pwd?
3- In order to create that backup I had to run the following (as all views were converted by the import utility as tables with the view's names..)
select 'sp_rename ''['+name+']'', '''+replace(name,'view_','')+''';'+ char(10)+CHAR(13)+ 'go' + char(13) from sys.tables where type='U';

Open in new window

However the I had to go to every single line and click enter before the GO, how can I avoid that?

Thanks in advance
0
I watched a video of MariaDB which stated  on a power point

data comparison and synchronization
-comparing and synchronizing data I'm databases of any size
-generation of data synchronization kit
- comparison reports in HTML and EXCEL

the last one is what stopped me.
I'm building a web app that will store numbers and other data daily over a large geographic region each month this data is manually entered into Excel via a CSV file.

is what Maria is proposing better or worse overall for us. approx 10,000 customers but and we're not expecting any probaleks from the MySQL.

it's nice to know I can port to it.

personally I love MySQL Object Oriented because it still lets you count rows so easy. been up coding going to do some CSS.
0
Hi Guys,

I have got two databases on a server. Both of them have got the same amount of data, structure and stored procedures are also the same. One is for my internal testing and the other is for the dev testing.

For some reasons the same query on dev testing database calle (Spaces_SBDeployment) is very slow as compared to my own dev/test database (Spaces).

Please find below the images of the query execution results and time taken from both the databases using the same stored procedure.

This is the shared dev database which is very slow takes 21 seconds to bring back results
Shared dev database
This is the database for my own dev/test  takes 3 seconds to bring back the results for the same query and from the same amount of data
Internal dev/test database
Kind regards
0
I have an MS Access Database connected to the application. I want to be able to install the application on several computers. I want to give the users an option to "Compact and Repair" the database. I have included a copy of the database in my resources folder of the application.

I know I need the Microsoft.Office.Interop.Access.Dao.DBEngine, but I am unsure of where to start.

what would be the best way to do this? Should I copy the file from my resources or what?
0
I have an existing Access 2010 database with a lot of VBA code.  I'd like to be able to add a couple very simple webforms so that users can submit data to the database but I am not sure how to accomplish this.  I know a hybrid access database can be built but I guess I'm concerned that I would have to start with a "web database" and I dont want to recreate this whole thing. Is there a way for me to add a simple web form for use through my company intranet without recreating the whole database?
0
We have 2 Citrix servers and both have Access on them.  The users use accde to open the frontend.  For some reason today on one of the servers we are getting the message "The database is in an unrecognized format"  
I tested the users frontend directly from the database server it is stored on and it opens fine.
I also tested it from the Citrix server and it gets the error.
The accdb open fine, just not the accde

I did a Compile and created a new accde and placed it in the users folder.  I did a repair of Office on the server.

The server is 2016 and the database is 2013 Professional

What could be the cause
0
Help for a newbie

I have a form that has two tabs. On the first tab I have a drop down called category. One the second tab I have a field called datehired along with an unbound textbox called Service. The Service text box has the following: DateDiff("yyyy",[DateHired],Date())+(Format(Date(),"mmdd")<Format([DateHired],"mmdd"))

This gives me an employees number of years employed. My last unbound text box is named TestPTO. I then created a Module called GETPTO with the following simple code:

Option Compare Database
Option Explicit

Public Function PTO(Category, Service, ) As Integer
If Category = "Manager" Then
    TestPTO = 200
End If
End Function

The issue I am having is when I look at a record that has a category of "Manager" my TestPTO text box is empty where I would expect it to populate with 200. What am I doing wrong?
0
i am finding it difficult to get radio button value in php using jquery ajax. every thing work fine if i comment the radio button variable in the php file  below, but if i remove the comment , nothing works. i have been on this for more then a day now. thanks for the help!!!

here is the html and jquery file :
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <title>Form Validation</title>
	<style>
		.error{
			color:red;
		}
		
		.emai{
			border: solid 2px green;
		}
		
		.error2{
			color: green;
		}
		.textBoxError{
			border: solid 2px red;
	       color: red;
		
		}
	</style>
</head>
<body>



<form method="POST" id="form" name="form" action="">
    <label for="email" >Enter your email</label>
    <input id="email" class="emai" name="email">
	<p id="result"></p>
	<label for="email">Enter your first name</label>
	<input id="firstname" name="firstname">
	<label for="address">address</label>
	<input id="address" name="address">
	 Yes: <input type="radio" name="opt" value="yes">
    No: <input type="radio"  name="opt" value="No" checked="checked">
	<p id="result2"></p>
    <button id="submitform">Submit</button>
	<p id="result3"></p>
</form>

<script src="https://code.jquery.com/jquery-3.1.0.js"></script>
<script>
$( document ).ready(function() {
    $(function(){
        $('#submitform').on('click',function(e){
            e.preventDefault();  // do not allow the default form action
            var 

Open in new window

0
I need to copy the database structure of one db onto another server.  I don't need the data, just the schema. I went to tasks and generated scripts.

Here is a portion of the script I have a question on.  Why did it create the .mdf file on the F:\\ drive?  Since I am running the script on a different server I get an error.  
Directory lookup for the file "F:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\ProLaw.mdf" failed with the operating system error 3(The system cannot find the path specified.).
CREATE DATABASE [ProLaw] ON  PRIMARY 
( NAME = N'ProLaw_Data', FILENAME = N'F:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\ProLaw.mdf' , SIZE = 19710784KB , MAXSIZE = UNLIMITED, FILEGROWTH = 10%)
 LOG ON 
( NAME = N'ProLaw_Log', FILENAME = N'F:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\ProLaw_log.ldf' , SIZE = 7616KB , MAXSIZE = UNLIMITED, FILEGROWTH = 10%)
GO
ALTER DATABASE [ProLaw] SET COMPATIBILITY_LEVEL = 90
GO
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [ProLaw].[dbo].[sp_fulltext_database] @action = 'disable'
end

Open in new window

0
Percona Live Europe 2017 | Sep 25 - 27, 2017
LVL 3
Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

I have an access database file that I use to query a few different sources.  One of those sources recently changed from an access mdb file to a SQL database.  I successfully added the new SQL database using a DSN and can view the data from within Access.  The old mdb data source was named "Associates" and the new SQL connection it's named "dbo_Associates".  I thought that I would only need to change Associates to dbo_Associates in my queries, but I'm getting a "Syntax error in JOIN operation"
0
A handful of users have recently started getting "ODBC -- connection to 'abcd' failed" errors when trying to run queries in Microsoft Access.  If I go into C:\Windows\SysWOW64\odbcad32.exe and test the connection under System DSN, it connects successfully.  The database file is fine and connects on other computers.  Usually after a reboot the query will run, but once Access is closed you can't open it and run the query again without rebooting.  I have tried completely uninstalling and reinstalling the ODBC driver but this makes no difference.  The same driver, same database, same version of Access, all work on other computers.  I can't figure out what is causing these couple of computers to have this issue.  

The issue happens with multiple drivers and system DSNs.  

OS is Windows 7, 64-bit
Access is 2016, 32-bit
0
Hello, Experts,

I built a PHP script that queries a database and outputs the results in JS/HTML form. If you could review the code below, I need help how to make the result field URL clickable.

Example:

Name: John Doe
URL: http://google.com

When results display for John, he is able to see the result set for his name and click on http://google.com

Let me know if you need further clarification.

<?php
//fetch.php
$connect = stuff
$output = '';
if(isset($_POST["query"]))
{
 $search = mysqli_real_escape_string($connect, $_POST["query"]);
 $query = "
  SELECT * FROM emp_details 
  WHERE dept LIKE '%".$search."%'
  OR fname LIKE '%".$search."%' 
  OR lname LIKE '%".$search."%' 
  OR pkid LIKE '%".$search."%' 
  OR url LIKE '%".$search."%'
 ";
}
else
{
 $query = "
  SELECT * FROM emp_details;
 ";
}
$result = mysqli_query($connect, $query);
if(mysqli_num_rows($result) > 0)
{
 $output .= '
  <div class="table-responsive">
   <table class="table table bordered">
    <tr>
     <th>pkid</th>
     <th>fname</th>
     <th>lname</th>
     <th>department Code</th>
     <th>url</th>
    </tr>
 ';
 while($row = mysqli_fetch_array($result))
 {
  $output .= '
   <tr>
    <td>'.$row["pkid"].'</td>
    <td>'.$row["fname"].'</td>
    <td>'.$row["lname"].'</td>
    <td>'.$row["DEPT"].'</td>
    <td>'.$row["url"].'</td>
   </tr>
  ';
 }
 echo $output;
}
else
{
 echo 'Data Not Found';
}

?>

Open in new window

0
I am learning ASP.NET Core using somebooks and tutorial, but nearly all of them use a localdb for the database. I would like to create the database into the local Instance of SQLServer Installed on my machine and need help with the syntax for providing the connection string for this purpse.
 protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
             // This is the connection string I am using currently for mssqllocaldb
             optionsBuilder.UseSqlServer("Server = (localdb)\\mssqllocaldb; Database = BookPost; Trusted_Connection = True; ");
         );
            //  This is the connection string that use I a WPF application to connect to SQLServer intance on my machine
    //< add name = "LibraryEntities" connectionString = "metadata=res://*/Fish.csdl|res://*/Fish.ssdl|res://*/Fish.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=FAHEEMPC\SQLEXPRESS;initial catalog=Library security info=True;user id=sa;password=abcepassword;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName = "System.Data.EntityClient" />

}

Open in new window


Thank you for your help.
0
I had this question after viewing How to show a web linked image on a report.

In the trial database I have got the following errors:


Screen-Shot-2017-08-13-at-09.39.29.png
and

Screen-Shot-2017-08-13-at-09.39.21.png
can you help?
0
I am getting an error that i cannot fix.  I have changed the database to UT8MB4 and have used every script in my arsenal to fix the problem and still get the same error.  Please advise how to fix.

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's 2-Handset Cordless Answering System is packed with features. There's a 50-name' at line 1' in /home/electronics/download.php:347 Stack trace: #0 /home/electronics/download.php(347): PDO->query('UPDATE `Do...') #1 {main} thrown in /home/electronics/download.php on line 347


$query68 = $conn->query('SELECT DISTINCT Sku, Title, DescriptionBottom  FROM `ProductScrape` WHERE Sku IN (SELECT VENDORSKU FROM Download)');



while ($row68 = $query68->fetch(PDO::FETCH_ASSOC))
    {

	

$NewTitle = $row68['Title'];
$NewFullDesc = $row68['DescriptionBottom'];

//$NewFullDesc = w1250_to_utf8($NewFullDesc);
//$NewTitle = w1250_to_utf8($NewTitle);
$NewImage = $row68['Sku']."-0.jpg";
$Sku = $row68['Sku'];

$NewTitle = preg_replace('~&([a-z]{1,2})(acute|cedil|circ|grave|lig|orn|ring|slash|th|tilde|uml);~i', '$1', htmlentities($NewTitle, ENT_COMPAT, 'UTF-8'));
$NewTitle = preg_replace('/[\x00-\x08\x10\x0B\x0C\x0E-\x19\x7F]'.
 '|[\x00-\x7F][\x80-\xBF]+'.
 '|([\xC0\xC1]|[\xF0-\xFF])[\x80-\xBF]*'.
 

Open in new window

0

Databases

54K

Solutions

38K

Contributors

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.