SQL - Attempted to read or write protected memory - sql

I'm trying to use a functions on the SQL SSMS2014 and I get the error on the title.
I can create new tables and databases no problem if i do it with a new query, but afterwards i can't edit or use the design function without getting that error on any of the databases that i have.
Most of the similar errors i found were related to connection to the database, but none of the fixes on those worked for me.

My guess is that the error message you are getting is:
the backend version is not supported to design database diagrams or tables
Solution:
This is commonly reported as an error due to using the wrong version of SMSS. Use the version designed for your database version. You can use the command select ##version to check which version of sql server you are actually using. This version is reported in a way that is easier to interpret than than shown in the Help About in SMSS.
Using a newer version of SMSS than your database is generally error free, i.e. backward compatible.

Related

Keywords such as GENERATED are not available on Azure SQL Studio

After discovering the usefulness of Temporal Tables, I have tried to implement it using Azure SQL Data Studio.
However, I get syntax errors when using Keywords such as GENERATED or SYSTEM_VERSIONING.
Is there a fix for this ?
What version of ADS are you using? It looks fine with the latest stable version (1.17.1) for me
[
If you're still seeing this on the latest version please open an issue here https://github.com/microsoft/azuredatastudio/issues and we'll investigate.

Array Out of Index in SQL Server

While trying to generate the diagram for a database (in SQL Server 2017), I am getting an error
Array out of Index
When I restart the application, it works fine for some time, and after few minutes, when I try to add a new table to the Diagram, it shows that same error again.
Is there any solution to avoid this problem?
This sounds like it's a bug with SSMS (v17.4 in my case).
Others have reported similar issues here: https://stackoverflow.com/a/44914581/4768230.
Alternatively, others have suggested making sure you have schema declared for all your tables can possibly help - https://stackoverflow.com/a/44660066/4768230 (I haven't tried this though).
Below is an alternative answer that applies to a very specific situation.
The above answer will most likely solve your problem. However if you run SSMS as a different user than you are logged into Windows as you may get this error.
The workarounds are to either
Use your normal Windows to connect to the SQL Server (which may not be allowed depending on your situation)
User Remote Desktop to connect to a machine with your SQL Account.
Tested with:
Windows 7 64bit
SSMS 17.7
This situation might be related to the computer not being enabled to use Kerberos Double-Hop active directory but this statement is complete conjecture.

Db2 database creation problem

I've just installed DB2 v8.1.18.980. Now I try to create new database. I'm getting the error with the following sql codes:
sqlcode : -902
sqlstate : 58005
Unfortunately the error itself in Russian, as a result, I cannot paste it here. Official site says the following about the problem:
"The statement cannot be processed. The application program is not permitted to issue additional SQL statements. For example, a recovery routine associated with the application program may not issue additional SQL statements.
Programmer response
Rebind the failing application program and try again. If the problem persists, examine your DBRM and make sure it matches your program."
http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/topic/com.ibm.db2z9.doc.codes/src/tpc/n902.htm
But, it's not clear to me. Any ideas, what can be wrong and how to resole it?
I'm using Windows 7 Ultimate if it may be an issue.
The documentation you linked to is for db2 v9 for z/os, not db2 v8 for Windows. So that's the first problem.
The documentation for v8 has this to say about SQL 902:
A system error (reason code = reason-code) occurred. Subsequent SQL statements cannot be processed.
Explanation:
A system error occurred.
User Response:
Record the message number (SQLCODE) and reason code in the message.
If trace was active, invoke the Independent Trace Facility at the operating system command prompt. Then contact your technical service representative with the following information:
Problem description
SQLCODE and embedded reason code
SQLCA contents if possible
Trace file if possible.
Federated system users: isolate the problem to the data source failing the request (refer to the Troubleshooting Guide to determine which data source is failing to process the SQL statement) and take the necessary diagnostic steps for that data source. The problem determination procedures for data sources vary, so refer to the applicable data source manuals.
sqlcode: -902
sqlstate: 58005
Which brings us to the second problem: it's asking you to contact IBM and open a ticket, and as far as I know v8 is out of support so it won't be that easy.
I think installing v9, v9.5 or v9.7 would be your best bet, unless you have a really compelling reason to stick with 8.

Data from UniData to SQL Server 2005/above through SSIS

We are doing a feasibility on what we're going to propose as a solution to a client who wants to migrate to a .NET based solution. Part of the data resides in UniData. What is required can be achieve using the following tool:
http://www.welland.com/export.html
The above product ETLs data from UniData to SQL Server.
As a first step, we want to be sure that there are no hitches in getting the data through SSIS from UniData to SQL Server.
Since we don't have an environment to test this we have to check mostly on the net. But most of the discussions regarding UniDate and SSIS don't look like the problem got solved. The main problem seems to be that people aren't able to get hold of a proper ODBC driver. If the data is converted into XML, then it looks like it's working fine.
Has anyone done this and know that this can go through without any problems?
Cannot say I've done it, but Rocket Software has 2-user license versions of UniData available for download, so at least you would have a system to test on.
We are actually working on this process now -- Unidata to SQL through SSIS. We worked with Rocket Software to get the OLE DB working... ODBC was never fast enough and before there was not OLE DB... Now there is. You have to do some work on the UNIDATA side once the OLE DB is install but that is an answer for another day. So far we have no issues except the work to get it setup.

"Index was outside the bounds of the array" while Compare SQL schema by SQL compare tool

I got one problem from comparing database schema as i use Red gate SQL Compare 6 , after initialization of the compare databases error is coming as following
"Index was outside the bounds of the array".
Please provide your valuable comments to get resolve this issue.
Have you tried upgrading? The latest version released is 8.1, and your issue might have been fixed in the intervening versions. You can also try posting on their support forums...
Don't use version 6 on 64 bit versions of SQL Server... Or 7, it appears.
The computer running SQL Compare is using a 64-bit edition of Windows
One or more of the servers being compared are SQL Server 2005 or higher
The Decrypt encryped objects on SQL 2005 and 2008 databases option is selected
I've been using Redgate stuff since 2003 and don't remember this error.
I really would consider upgrading...
Try dbForge Scheme Compare for SQL server. It can compare and synchronize any database scheme. Quick, easy, always delivering a correct result. See how it flies on your database!