[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x

Databases

56K

Solutions

40K

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

I have the below SQL statement which works as expected on my local machine WAMP server using MySQL, but when I upload to the live server using MariaDB, it doesn't work as expected anymore. The SQL statement is used for post and comment display. Any post or comment with latest postdate should be on top of the displayed list. As I said, it worked perfectly with MySQL on my local WAMP server, but when I upload to live server using MariaDB, no matter what I tried, it reverses the order by showing latest post/comment at the bottom of the list and old post/comments at the top. Please help me as I'm now confused on why it's behaving this way.

The SQL statement is shown below:

SELECT * FROM 
(SELECT once.id, message, audio, audio_desc, accepted, postdate, tag, broadcast, once.mobile, once.username1, state, users.username, users.firstname, users.lastname, users.fullname, users.avatar, users.alias, useroptions.aliascheck, content_provider.content_type, comment.comment_date as c1 FROM once LEFT OUTER JOIN users ON once.username1 = users.username INNER JOIN useroptions ON once.username1 = useroptions.username LEFT OUTER JOIN content_provider ON once.username1 = content_provider.provider LEFT JOIN comment ON once.id = comment.post_id AND once.tag = comment.post_tag WHERE once.username1='logusername' OR once.username1='myusername'
UNION ALL
SELECT daily.id, message, audio, audio_desc, accepted, postdate, tag, broadcast, daily.mobile, daily.username1, state, users.username, 

Open in new window

0
Determine the Perfect Price for Your IT Services
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

I have a spread sheet that connects to an outside database and draws data from predetermined views.

This spread sheet has 20 connections.

When I first start the spread sheet up it almost completely locks up.  The database slows down horribly as well.

After about 5-10 minutes the spread sheet finally delivers an error message like the following:

The following data range failed to refresh:
datasets.mydomainname.com program 2017 product
Continue to refresh all?

If I click "yes" it finishes its data refresh and all is well.

If I look under data, connections, this connection does not seem to exist.  I would love to find this connection and delete it.  This spread sheet is supposed to be 2018 and all 2017 data is outdated.

I am using Excel 2013 and am connecting to SQL server 13.0.4451

Thoughts??
0
I want to do some work that states it needs SQL Enterprise. I would think either SQL2012 or SQL2016. The task is irrelevant. I know it is more expensive than SQL Standard. We use VMware on blade servers that have numerous physical Intel CPUs and of course have hyperthreading. I know MS changed their licensing not long ago.

Let's say (to keep numbers round) i want to assign 10vCPUs to this new SQL2012/2016 VM. If my blade server happens to have 20 physical sockets with hyperthreading enabled, how would MS charge me for that VM?  If - let's say just to make it easy - MS charged $100 per whatever Ent SQL metric they now use to charge for SQL - how much would that cost me?  These are notional amounts, but you understand what i'm asking. How much would this situation cost me with those make-believe numbers - so i can then take that process and apply it to my real-world hardware/software?

If you would be so kind, please try and provide the notional $$ amount and a link for actual info as well. This is a side-project and was hoping not to investigate too much - time wise :)
0
Dear expert

I would like to improve the code below. the half of the code is from oBdA, but the CustomerID is first from a table in the database, I would like to first extract it with another query from a database table then add it to the oBdAs query, SSN is a number we already know. Using that we can extract the CustomerID. I tried abit but that didn't work.  
I think the finding CustomerID part is to put the CustomerID into a powershell data table, so I tried with $CustomerID.gettype(), it showed me DataRow. This $CustomerID.customerID only showing up the prop of the datarow, it didn't change to a string, so I tried several way: like [string]$CustomerID.customerID didnt work.
Anyone got a idea?
Thx

$SSN= "879785668"
$tempCsv = 'c:\test\test.csv'

Function Get-customerID {
[CmdletBinding()]
Param(
	[string]$SQLServer = "SQLT01\MIR",
	[string]$SQLDBName = "Preprod",
	[string]$SSN,
	[string]$UserId = "View",
	[string]$Password = "xxxxx"
)

$SqlQuery2 = "
Select CustomerID from Data_Person WHERE SSN = '$SSN'"


	$SqlConnection2 = New-Object System.Data.SqlClient.SqlConnection
	$SqlConnection2.ConnectionString = "Server = '$($SQLServer)'; Database = '$($SQLDBName)'; user id = '$($UserID)'; password = '$($Password)'"

	$SqlCmd2 = New-Object System.Data.SqlClient.SqlCommand
	$SqlCmd2.CommandText = $SqlQuery2
	$SqlCmd2.Connection = $SqlConnection2

	$SqlAdapter2 = New-Object System.Data.SqlClient.SqlDataAdapter
	$SqlAdapter2.SelectCommand = $SqlCmd2
       
	$DataSet2

Open in new window

0
Hi, from yesterday I'm unable to access my database. It indicating Suspect mode there. Kindly suggest how to make my SQL database online from Suspect mode?


Thanks
0
Hi ,
I have a table table A having column col1,col2,col3,col4

I want to select the data in the table which has null values but with a statement which shows that what are the column having null values as below example:

INPUT:

col1 col2 col3
A               B
         X      B
A              

OUTPUT:

col1 col2 col3  statement
A               B      NULL IS COL2
         X               NULL IS COL1,COL3
A                        NULL IS COL2,COL3
0
I have an Oracle 11g database with table TB_Doc  and column DocNo ( and there are more columns
 
Following are some sample values for DocNo
  10-123-Doc
  10-123-Doc_DH
   MyDoc1
   AnotherDoc
   AnotherDoc_DH
   DH_GoodDoc
I need a view with additional column DocNoDerived in which all the _DH  in the end should go as  follows
   10-123-Doc
  10-123-Doc
   MyDoc1
   AnotherDoc
   AnotherDoc
   DH_GoodDoc
0
Need help with stripping out the city and State name from the Customer Name field (TKSuppliers (ABCity, TX)

SELECT   CustomerName
        ,LEFT(CustomerName, CHARINDEX(',', CustomerName) - 1) AS [Surname]
        ,REPLACE(SUBSTRING(CustomerName, CHARINDEX(',', CustomerName), LEN(CustomerName)), '(', '') AS CitySt
FROM    Sales.Customers CUST 

Open in new window


what am I missing?
1
Hi Team,

iam new to Java , I need to write a program which involves a multi threading . I have an input file ,   from this file I need to read data line by line and then after reading a line , I need to write the logic to store in DB .  This line read needs to be split into individual fields and then stored into database.

I know how to read and split the data , bu tthe logic of simultaneously doing the task using thread is what i want help.

Any help with any sample program is really appreciated.
0
Hi

I am trying to update tables using the dbms_execute_parallel but it does not update table.  The things already checked are "job_queue_processes" it is 1000. The "parallel_min_servers" is 16. The "parallel_server" is FALSE is this the reason?

The table is CKP_PARALLEL. In this the column PPREM needs to be updated. Step1_CheckAmountAtStart The PPREM is 180.
Then executed the dbms_execute_parallel.
-------------------- PARALLEL STEP 1 ------------------------------------------
exec DBMS_PARALLEL_EXECUTE.CREATE_TASK('Update_TASK');
exec DBMS_PARALLEL_EXECUTE.CREATE_CHUNKS_BY_ROWID('Update_TASK','VM1DTA','CKP_PARALLEL',TRUE,1);
------------------------------------------------------------------------- 
DECLARE
 l_sql_stmt VARCHAR2(1000);
BEGIN
  l_sql_stmt := 'update CKP_PARALLEL set PPREM = PPREM + 10 WHERE ROWID BETWEEN :START_ROW_ID :END_ROW_ID';
  dbms_parallel_execute.run_task(
    task_name        =>'Update_TASK',
    sql_stmt         => l_sql_stmt,
    language_flag    => dbms_sql.native,
    parallel_level   => 5);
  
END;
/

Open in new window

Step2_Exeuted
And then checking the premium (after commit).Step3_StillSame
What could be hte reason of this?
Oracle version 12C:Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

Kindly suggest!
0
Big Business Goals? Which KPIs Will Help You
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

I'm exploring backup policies such that if there's insiders quietly
altering them, we can skip the 'bad' changes:

Day 1: the initial good build
Day 2: legit/good updates were made
Day 3: an insidious/malicious update were made
Day 4: good legit updates/changes were made

We want to restore till Day 2, skip Day 3, restore Day 4.


https://www.acronis.com/en-us/support/documentation/AcronisBackup_12.5/#37575.html
Was told a GFS scheme as above will help but I tend to think
a mix of incremental plus differential backups is needed.
Pls comment.


Q2:
For DB, is it better to backup the OS files of the DB or take dumps & backup
the text dumps?
0
Hi,

I am trying to connect to MYSQL but get attached error.
can you see anything wrong with the settings on attached png file ?
Thanks
Ian
localhost.png
0
I work with Delphi Rad seattle 10.
My program needs to get the real date from the internet.
It would be better if could get the date from the server of my site
I am using FireDac which  enables me to connect to external server.
0
Searching in an Oracle database, one of my parameters for exception of the record is conditional on one field.  Here is the SQL:

select tax_id, mcal_code, taxonomy_cd
from ODW.PRV30_SERVICE_PRV a JOIN odw.prv301_abs_service_prv_npi b ON b.prv301_tax_id = b.prv301_tax_id
WHERE mcal_code = '50' and taxonomy_cd not IN ('261Q00000X', '261QP0904X')
ORDER BY a.prv30_mcal_code desc

In the where clause the two fields, mcal_code  and  taxonomy_cd are linked as both field values have to be present.  
In pseudo code:  When the mcal_code = 50 and if the taxonomy_cd =  '261Q00000X' or '261QP0904X' then that record is skipped
So in the results I will see records that have mcal_code 50 and taxonomy_cd '261Q00000X' and '261QP0904X', but not on the same record.
What is the SQL that will allow me to do this?

Thanks,
Scott
0
Database Migration from HP Storage to DELL EMC:
After renaming of SQL Server 2008 R2 Default instance, We are unable to connect Management Studio from remotely for Windows Authentication users. It is working fine for SQL Server Authentication users.

Error: The target principal name is incorrect. Cannot generate SSPI context.

Meantime for SQL Server 2014 it is working fine.

Scenario 1:
Server : SQLCL (SQL Server 2008 R2) - We have build new server with the name as SQL2 then migrated the databases, added alias name as SQLCL. In this scenario, we faced same mentioned above error.
Server:  DBCL (SQL Server 2014): We have build new server with the name as SQL1 then migrated the databases, added alias name as DBCL. In this scenario, we have no issues.

Scenario 2:
Again We have renamed the server from SQL2 to SQLCL and SQL1 to DBCL but Still we are getting same error for SQL Server 2008 R2 version installed.

But we have no issues jobs and every thing fine. Please help us.

Thanks,
Chandra
0
Hello Experts,
I have a mysql database with a table tbl_participants
this table has two indexes.
a numeric primary on-field aa1  autoincrement
and another numeric primary on-field cc5

I have noticed when I update using only field aa1 on the 'where' statement the search takes around 0.03 secs
But the same update using only field cc5 lasts around 5 secs

Is this something I can tune better or why is there such a difference?

Best regards,
0
Hello, experts, I have a table in MySQL database
this table has a numeric primary index autoincrement on field 'reg_cod'

When I insert a new register is there a way
to retrieve the new value automatically assigned to the field 'reg_cod'?

So I don't have to do a separate select just to find out this new 'reg_cod' value for this new register?

Best Regards,
0
Escaping a Character.  I have a database with the name: Ç in it. It is in a Turkish name.  That name will not return because I think the C is a special Character.  What Character is that and how do I find special HTML code for it?
0
I have a long running query because it is reading a very large database.  The issue is there is a string of codes that each have an order number.  There can be as many as 30 on a  line. The order is then matched to another table to get the actual value.  What is the best way to loop through this row to get the codes for all of the 20 values.  This is an SQL statement.
0
Become a Certified Penetration Testing Engineer
LVL 12
Become a Certified Penetration Testing Engineer

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

Experts:

I require some assistance/guidance with a general data management scenario. Allow me to provide some background first.

Background:
• I have a spreadsheet that may include thousands of records across approximately 25+ columns.   Columns can be of types [date], [number], [text].   Attached XLS is a very simplified version that only contains only 14 records across four columns.
• My actual worksheet, however, may contain 2,000 rows/records (+ header row).   And, I will have duplicate records (for a reason that doesn’t need to be covered in this thread) for each single record.  
• So, essentially, in the actual data set, I may have only 1,000 unique records (based on 3 or 4 key fields).   In the example data set, however, I only included 14 records where seven records are unique records (not across all fields though).
• Again, there are “slight differences” in each of the seven (7) paired records.   Please refer to additional notes in cell range B17:D31 that specifically explain details on the record variances.

What I Would Like to Achieve:
• In essence, I want to review the 14 records and remove their associate 2nd duplicate record and ultimately end up with only 7 records.
• The trick is though, there’s no “general algorithm” that states that I will always keep the 1st record and trash the 2nd one (or vice versa).   Instead, I want to **merge** two records into one but let the user decide that, e.g., for the record dated “07/15”, I will …
0
I am designing a database to hold information about students and projects within a school.
  A student may work on any number of projects, and multiple students may work on the same project.
  Each project will have at least one student designated as the project leader.
  Multiple co-leaders on the same project are allowed.
  Similarly, each project will have at least one project sponsor (again, possibly more than one).
  Finally, each project may have additional assigned students (with no specific role).
 
What tables would you propose for this system, and how would they relate to one another?
0
HI.  I have a shared access database that tracks returned goods and actions taken\pending.  I had some old email code that sent a separate email to each user where action was required.  This means a lot of email processing.  I am changing that to send out a single distinct email for action users and they can  now log into the database to view a report showing their specific actions.  To make this possible,  I turned all of the email alert code into a series update queries that  write to a table called RGAlerts.  I can run the refresh manually but I'd really like to refresh it each time the users either open or close the report, I'm not sure which would be best.  I have all of this working except for the report-driven table refresh.  I'm concerned about user updating simultaneously.  It would only hurt this one table that will get refreshed anyway but I think it could cause some confusion as that table could show duplicate entries if users happen to trigger the refresh at the same time..  
What is a good way to manage simultaneous updating in ACCESS 2010 and 2016?  Both clients are in place.  Is record locking possible to use in this situation?

thanks
0
I am getting the following error while running a t-sql results as an email attachment by using  msdb.dbo.sp_send_dbmail.  I can run the query fine in a query window.

Msg 1038, Level 15, State 4, Line 6
An object or column name is missing or empty. For SELECT INTO statements, verify each column has a name. For other statements, look for empty alias names. Aliases defined as "" or [] are not allowed. Change the alias to a valid name.


Here is my query

Truncate Table OE_Alerts
DECLARE @query NVARCHAR(MAX), @Count INT
SET @query = N'select  t.WO_NUM as WorkOrder#, t.PARENTWOID as ParentTicket#, max(a.LogicalName) as AttachmentFileName, t.TASK, max(t.OPENDATE) as OpenDate, t.OPENBY,  t.ATTACHCOUNT, a.LastModifiedBy
from TASKS t, Attachment a
where t.PARENTWOID = a.AttachmentOwnerId
and a.AttachmentOwnerId = t.PARENTWOID
and t.WO_NUM = t.PARENTWOID
and t.LOOKUP1 <> ""
and t.LOOKUP2 = "OE - Level 3" or LOOKUP2 = "OE - Level 4" or LOOKUP2 = "OE - Level 5"
and t.OPENDATE >= DATEADD(MINUTE, -30, GETUTCDATE())
and t.ATTACHCOUNT <> "0"
group by t.woid,  t.WO_NUM,t.TASK,t.OPENBY,  t.PARENTWOID,t.ATTACHCOUNT,a.LastModifiedBy'
INSERT INTO OE_Alerts
EXECUTE SP_EXECUTESQL @query
SET @Count = @@ROWCOUNT
IF @Count > 0
EXEC msdb.dbo.sp_send_dbmail
      @profile_name = 'DatabaseAlerts',
@recipients = 'Alerts@abc.org',
@subject = 'There is a new attachment to the parent ticket',
@execute_query_database = 'TRACKIT_DATA',
@body_format = 'HTML',
      @query = 'SELECT * …
0
Hi we had a "first time" Nessus scan done on our network. There appeared to be some database connection drops - so I got them to stop scan

They came back and did scan after hours. it completed
We have a Oracle sun server running VMs for all our Oracle software and databases.
Now issue is that we have subsequent to the scan a poor performing oracle environment

After sometime I determined that the ping times to the oracle sun server were slow - im talking few at  <1ms most >8ms and higher some up to 1000 ms - no dropped pings
but consistently slow. this is all on a 10gb LAN.
I'm almost certain that Neussus scan has done something to the server in its scan. They appeared to have the safe scan option ticked. I dont know much at all about nessus scans
Is it possible that the server could perform poorly POST the scan - requiring a server reboot. No other changes on the LAN
could nessus have done something to the network layer of the sun server code. The server is not under any extra load perf monitor is limited on oob interface gui
everything we use sits on a database and is slow for entire business. ANy nessus experts out there?
0
Does MariaDB & MongoDB (I mean the Enterprise Edition) have
commercial support (just like RedHat Linux has while CentOS
is user-community support only)?

Concern is if there are security vulnerabilities (which may result
in data leaks) or DB corruption/integrity.  I've heard of banks
using MariaDB but I'm not sure if they house critical data but
I certainly would not want to house critical data on databases
that are non-commercially supported or even if it's commercially
supported by vendors with low track record (I deem Oracle &
MS as good-track record DB vendors).

I think MongoDB is a non-relational (ie network) DB.

Concern is if a database is hosting critical data, user-community
support is not non-committal & patches are not released as
regularly as commercially-supported softwares, though it's
noted MS release patches monthly, much more than any other
commercial vendors
0

Databases

56K

Solutions

40K

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.