SQL Server 2016 return empty result sometime - search

It is a very normal query like
SELECT *
FROM Products
WHERE CONTAINS(ProductName,'Samsung')
My problem is SQL Server 2016 Express full text search returns an empty result sometimes, and only when I detect it and restart server then it works again.
So far it occurs at least twice. After restarting it seems to work as expected.
I have also check by directly execute the query in SQL Server Management Studio and had the same results. Also, SQL Server FTS seems to run in both case when checking on SQL Server service configuration.
What could cause this issue? Thanks

SELECT * FROM Products WHERE ProductName like '%Samsung%'
I think this will solve your problem

Related

Azure Machine Learning Endpoint SQL Access fails, works in experiement

I've created a classification endpoint using Azure ML, the input for which is a database query to retrieve the database row to classify.
When I run my experiment in the Machine Learning Studio, it works and connects properly to my database. When I submit the same query as a web service parameter on the import data module, I get the following error:
Ignoring the dangers of an SQL query as input, why am I getting this? Shouldn't it work the same?
Sidenote: I've used an SQL query on my training endpoint in the exact same way on the same database, and this didn't cause any problems.
UPDATE: It seems as if this is only a problem when I create a new endpoint for a service. If I use the default endpoint it does indeed work, but any new endpoints do not.
UPDATE 2: It also works when I submit my request as a batch run. If I use Request-Response, it fails.
According to Microsoft this is a known bug and they are working on it. Another workaround, although NOT recommended, is to pass the password in as a web service parameter (but may be ok for test/proof of concept apps)
Here is a link to the thread on the MS forums that states this is a bug.

Can I open a database on a different server from the PostOpen db script event?

I have a couple of servers which replicate. We want to make sure people use the app on the primary server and only use the 2ndary server under certain circumstances.
I added some code in the PostOpen event of the Database Script to check which server the app is open from. If they're not on the right server a prompt comes up telling them they're on the wrong server and asking if they want to continue or not.
What I'd like to do is if they select 'no', not to continue on the 2ndary server, I'd like to close this db and open the one on the primary server.
I tried using the UI Workspace OpenDatabase but that didn't really work. It likely can't be done but I thought I'd ask just in case there is a way to do this.
Thanks
clem
I have the following code running in an application of mine (stripped down) to achieve what you want to do:
strServer = "YourMasterServer"
strFilePath = Source.Database.Filepath
Call Source.Close()
Call ws.Opendatabase( strServer, strFilePath)
The code is in the PostOpen- Event of the Database.

Sybase ASEBulkCopy is not working

Sybase ASEBulkCopy is not working.
I have set the EnableBulkLoad attribute to 1 in the connection string.
It is uploading 1 record at a time even after setting the batch size to 500. The other settings EnableBulkLoad attribute is set to 1 in the connection string.
What other settings am I missing.
Please someone help me with this.
Thanks in advance.
Whether bulk load actually happens depends on other things as well, such as the presence of indexes on the target table. By enabling bulk load you're basically telling the ASE server that it should try to do bulk uploading if it can -- but maybe it cannot so it uses non-bulk.
I'm not sure I understand the details of your question though. What do you mean by "upload"? Does your client app send only 1 record to the ASE server at a time?
Or does it mean that ASE performs regular inserts instead of bulk inserts? If the latter, how did you diagnose that?
I recommend trying it first with the 'bcp' client utility to figure out if bulk loading is possible to start with.

Sql Azure - Timeout on query

I have setup an Azure website with a SQL Server Azure back-end. I used a migration tool to populate a single table with 80000 rows of data. During the data migration I could access the new data via the website without any issues. Since the migration has completed I keep getting a exception: [Win32Exception (0x80004005): The wait operation timed out].
This exception suggests to me that the database queries I am doing are taking more than 30 seconds to return. If I query the database from Visual Studio I can confirm that the queries are taking more than 30 seconds to return. I have indexes on my filter columns and on my local SQL database my queries take less than a second to return. Each row does contain a varchar(max) column that stores json which means that a bit of data is held in each row, but this shouldn't really affect the query performance.
Any input that could help me sole this issue would be much appreciated.
I seem to be around the query timeout issues for now. What appeared to do the trick for me was to update the SQL Server stats.
EXEC sp_updatestats;
Another performance enhancement that worked well was to enable json compression on my azure website.
See: enter link description here

Accessing MySQL DB into Excel 2010 powerpivot

I have a MySQL DB on hostmonster.com and I am trying import data in excel powerpivot, but having hard time connecting to it.
Does anyone know if Excel powerpivot can even connect to MySQL?
Error I am seeing
Unable to retrieve list of databases. Reason: Failed to connect to the server. Reason: Login timeout expired
A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.
Named Pipes Provider: Could not open a connection to SQL Server [53].
I was looking for a way to feed data into MySQL (I know, there are better ways...) when I found this. So I was able to connect via odbc to Excel and using PowerPivot 2010 I was able to create a connection from MySQL to PP just fine. Here are the steps I took:
Select "Get External Data from Other Sources." (It's the db symbol to the right of "From Azure DataMarket.")
In the Connect to a Data Source table import wizard that comes up, select "Others (OLEDB/ODBC)"
Now it wants your connection string to your MySQL box, click on "Build." This brings up the "Data Link Properties" dialog, select the "Provider" tab, then the "Microsoft OLE DB Provider for ODBC Drivers." Select "Next." Now on the "Connection" tab, select "Specify the source of data: - use data source name: MySQL. (if you don't have this, you did not install the MySQL ODBC drivers.)
Click on "Test" and this should succeed if you have your user and password to MySQL correct. Now the "Connection String field is populated: "Provider=MSDASQL;Persist Security Info=False;User ID=root;DSN=MySQL" is what mine was.
The next step was a big one for me. The dialog says "Choose how to import the data" but when I selected "Select from a list of tables and views to choose the data to import" it could not find them for some reason, I selected "Write a query that will specify the data to import."
This brought up a query window and I added "select * from MySQL db.table_Sample
LIMIT 0, 1000"
It validated my SQL statements and imported the data. Very cool.
Try testing the connection trough windows "ODBC Data Source Administrator" first. I'm also having problems with PowerPivot specifically, but using normal Data Connection in Excel -does- work. You could also try that.
EDIT: Just found out that most PowerPivot connection issues get solved by falling back to an older MySQL ODBC driver. Version 3.51.30 does the trick. http://dev.mysql.com/downloads/mirror.php?id=406107
Credit where credit is due: http://www.joyofdata.de/blog/how-to-set-up-powerpivot-and-make-it-talk-to-mysql
I'm not familiar with powerpivot, but here is a link to the ODBC drivers for MySQL DB. Once installed I know you can connect to a MySQL database from Excel. I'm guessing powerpivot is the same. http://dev.mysql.com/downloads/connector/odbc/5.1.html
I've tried the same approach without success. Specifically:
i set up an ODBC connection to MySQL
PowerPivot seems to be able to see it when i use the Build wizard, and
connection test succeeds
when i go to import (via "Select from a list of table"), it fails with
an error in the SQL syntax (which of
course i didn't write).
So something's wrong somewhere under the hood.
Depending on what version of Windows you have, did you also go into Control Panel, administrative tools, data sources (odbc) to add the new MySQL driver you installed?

Resources