How to turn off CommandBehavior=SequentialAccess in SSMS? - sql-server

How can we turn off CommandBehavior=SequentialAccess in SQL Server Management Studio so as to avoid this error ?
An error occurred while executing batch. Error message is: Retrieving
encrypted column 'DATA' with CommandBehavior=SequentialAccess is not
supported.
Background : I am using SQL Server 2016 CTP 3. I have a table with nvarchar(max)columns encrypted using Always Encrypted.

We're currently working on getting this fixed. You can use https://connect.microsoft.com/SQLServer/feedback/details/2413024 to track the status of that - but the current target is for the next monthly release of SSMS.
-Charles Gagnon (chgagnon#microsoft.com)

This issue has been addressed. SSMS now supports decrypting nvarchar(max) columns.

Related

Cannot run JSON_VALUE in SQLite database (.db file) in SQL Server Management Studio

I want to update some JSON data in SQLite database (.db file) and I met a problem.
I work in Microsoft SQL Server Management Studio where I added SQLite/SQL Server Compact Toolbox through Visual Studio Extensions. I'm succesfully able to connect to this file and I'm also able to run a query on this database (create table, insert data etc.). The only problem is that a table I want to update has a JSON column and I need to use the JSON_VALUE function to get some data from that column. And when I run SELECT JSON_VALUE([data]) FROM myTable, I get an error message:
ErrorCode : 1
Message : SQL logic error
no such function: json_value
Result : Error
for a query SELECT sqlite_version I got a result 3.24.0.
What am I doing wrong? What should I add to system to make this thing working? In standard SQL everything is working fine. SSMS is version 14.0.
I also tried programs "DB Browser for SQLite" and "SQLiteStudio" and also did the same example in Visual Studio and got exactly the same error.
Any hints (please step by step, I'm totally new to SQLite) would be appreciated.

ERROR: Target table [X] does not allow UPDATE Row # [0] in bad file

We are getting this error on Informatica when executing a simple UPDATE command while connecting to SQL Server 2016 SP2. We've tested the service account from SQL Server Management Studio manually and it works fine.
Here is the version of SQL Server we have installed.
Informatica error:
Informatica drivers:
From the error message it looks like you do not have the "Update" enabled for the target under the mapping tab in Session properties. Please select the "Update as Update" for the target as in the below snapshot.
If you are using update strategy you can point to data driven option in session level properties. Make sure you have a primary key available in the target. If you are rejecting any records, use a filter/router to reject the data.
Thank you

SQL Server Transactional replication - The process could not bulk copy into

So I have setup T-replication from Publisher (SQL Server 2014) Distributor (SQL Server 2014) Subscriber (SQL Server 2008 R2) and initialized it using a snapshot.
Checking in the replication monitor I find that the Snapshot agent has completed successfully and Log Reader agent is running.
Now in 'Distributor to Subscriber History' tab just beside the 'Undistributed Commands' Tab
I get the following error:
The process could not bulk copy into table '"dbo"."BEAMDATA"'. (Source: MSSQL_REPL, Error number: MSSQL_REPL20037)
Get help: http://help/MSSQL_REPL20037
End of file reached, terminator missing or field data incomplete
To obtain an error file with details on the errors encountered when initializing the subscribing table, execute the bcp command that appears below. Consult the BOL for more information on the bcp utility and its supported options. (Source: MSSQLServer, Error number: 20253)
Get help: http://help/20253
bcp "LOWIS_BUCT"."dbo"."BEAMDATA" in "C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\ReplData\unc\LOWISBUCT_CSSQLDB_BUCT_CSSQLDB_BUCT_ALL_TABLES\20160826064516\BEAMDATA_34#1.bcp" -e "errorfile" -t"\n\n" -r"\n<,#g>\n" -m10000 -SLOWISTSTSQL -T -w (Source: MSSQLServer, Error number: 20253)
Get help: http://help/20253
I thought this could be some kind of data overflow and hence checked the schema of the table at both Publisher and Distributor and they match exactly.
I cleaned the whole replication setup completely and re did it but still stuck at the very same place for the same table.
Has anyone encountered this before? Ask me if you need more information from my end which I can furnish.
I found the reason for this. It was due to the schema mismatch at the publisher and subscriber.
In the said table, column had the datatype (date(datetime) and when replication scripted the schema for this table it was scripted as date hence at subscriber when the snapshot was applied, the field had the data type of date.
When data was being copied from datetime to date field it resulted in the said error.
I did the necessary changes in the data type at the subscriber end and things got fixed,
I had a similar error and Problem "sql replication repl20037 field size too large". What i found is this. I setup the subscription with my local Sql Management Studio v18.10 on a SQL Server 12.0. This caused the the Bulk copy problem and a field mismatch. Solution: setting up the Publication directly on the Mgmt Studio on the source server and setting up the subscription directly on the Mgmt Studio on the destination server.

SQL Server 2012 error: object reference not set to an instance of an object

I use SQL Server 2012 and I have some databases on it. The problem is I suddenly get an error saying,
object reference not set to an instance of an object
I get this error when:
Going to write a new query
Select previously entered data by right click the table name ->
Select top 1000 rows
What I can do without getting error message:
Log into my instance successfully using both Windows Authentication mode and SQL Authentication mode.
Edit the table data by right click the table name -> Edit top 200 rows
Create a new database
I'm using:
Microsoft SQL Server Management Studio: 11.0.3128.0
Microsoft .NET Framework: 4.0.30319.34014
Operating System: Windows 8.1
Here are some snapshots of the error.
Please give me a solution to fix this problem. Your help will be highly appreciated.
I fixed the problem by running SSMS as administrator.
I could solve the error.
Repair the SQL Server.
Go to Add/remove programs Microsoft SQL Server 2012(x64) -> Uninstall/Change -> Repair.
Select the instance that you want to repair here.
For me, after repairing the instance, the error was solved.
Thanks for all who spent their valuable time to reply my question.
I got the same error message. Problem was 0 bytes free on the C: drive.
Its may be late, but i get the same error in SQL SERVER 2016, i resolved it by assigning full access to the back up folder.
I faced the same error once in my project. This is purely due to SSMS(sql client) is corrupted. Just for cross check that server is fine and client is corrupted, try to connect to the sql-server in this machine from any other server if you have access and query the tables. If it returns data, just uninstall and reinstall the client(ssms) to solve the issue
Thanks
I got the same error for SQL 2016 and the only solution for me was to completely uninstall (in appwiz.cpl) all entries Visual Studio + SQL. Then I executed VisualStudioUninstaller and I reinstalled SQL and after Visual Studio.
I got the same message when I try to alter table to add new column . Issue is I haven't enclosed data types using '[' datatype ']' . Its Real data type. But It got fixed when I enclosed in using square braces.
My solution for this was to extract the csv file with the python library pandas rather than saving it with Excel. Further, I removed columns that I didn't need as a few columns caused formatting errors during the import.
For those who are unable to modify their SQL configuration due to administrative restrictions at work:
I was able to open a new query page by creating a SQL Server Scripts project and adding a new query through the solution explorer
I got the message after deleting a database. The database was gone, so I moved on.

Unknown token received from SQL Server

I got this error when trying to run a query in SQL server query analyzer.
What is the reason?
If you're using cursors, then you've probably closed the cursor. Check out MSDN for more information (http://support.microsoft.com/kb/151693)
If you're not using cursors, then it could be an issue with the server, check the log.
And before it's lost to the sands of time, the KB article:
Article ID: 151693 - Last Review: October 3, 2003 - Revision: 3.0
FIX: Err Msg "Unknown Token Received from SQL Server"
Symptoms
When you set the statement options to use a server-side cursor and prepare a select statement on a SQL Server system table, the first execution of the select creates the cursor successfully. After you close this cursor, if you execute the prepared statement again, the following error message appears:
unknown token received from SQL Server.
Workaround
Use a forward-only cursor instead of a static, keyset, or dynamic cursor on the system tables. Note that the problem does not occur if a server-side cursor is created on a user-defined table or view.
If a forward-only cursor is unacceptable, prepare the select statement again on the system table and execute it to create a server-side cursor. Note that the first execution works fine and applications typically do not need to create a cursor on a system table repeatedly.
Status
Microsoft has confirmed this to be a problem in Microsoft SQL Server version 6.50.0201. This problem has been corrected in U.S. Service Pack 1 for Microsoft SQL Server version 6.5. For more information, contact your primary support provider.

Resources