Error: 0xC002F210 (can't import a database in my SQL Server) - sql-server

I have SQL Server 2014 installed on my PC, working on a same project in my company, a worker send me a database to import.
I followed the steps described here, but I get this error :
Error 0xc002f210: Preparation SQL Task 1: Executing the query "CREATE TABLE [dbo].[~TMPCLP14521] (
[Champ1] nvar..." failed with the following error: "Culture is not supported.
Parameter name: culture
3072 (0x0c00) is an invalid culture identifier.".
Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
What is wrong?

Solved , after reading this issue i found that in order to make the import work ,apparently ,the sqlserver and the system should have the same language format ;
My Sql Server is in french ,my windows was in english format changing it to french format in setting>region>region format solved my problem.

Related

MSSQL Linked Server error: The OLE DB provider "OraOLEDB.Oracle" for linked server supplied inconsistent metadata for a column

I was trying to pull data from Oracle to MSSqlserver database using Linked server.
select * from [LINK_NAME]..SCHEMA.TABLE;
But it was failing with the below error:
The OLE DB provider "OraOLEDB.Oracle" for linked server "LINK_NAME"
supplied inconsistent metadata for a column. The column "COLUMN_NAME"
(compile-time ordinal 6) of object ""SCHEMA"."TABLE"" was reported to
have a "LENGTH" of 100 at compile time and 200 at run time.
I also need to pass argument at run time in where condition. I found OPENQUERY as a solution but it does not support arguments at runtime.
Try using the OPENQUERY Syntax to see whether that helps..
SELECT * FROM OPENQUERY(LINK_NAME, 'SELECT * FROM db.Schema.Table')
More about OPENQUERY ...
I found solution:
The error was coming due to database column type mismatch.
ORACLE was using NVARCHAR for datatype but in case of SQLSERVER it was VARCHAR.
As NVARCHAR is double the size of VARCHAR that is why it was showing size mismatch error.
Changing the data type to same worked for me.
I have found a solution posted by this blogger. Try it out!
This tool from Sysinternals/Mark Russinovich is the best, and my only regret that day was not launching it earlier instead of scouring Google and going insane. I’ve limited Procmon to just sqlservr.exe, as it’s the SQL Service itself that loads/handles the providers and not the ssms.exe. Also of note is that the sqlservr.exe is a 64bit process while the management studio is still just 32bit. As the server service is loading the provider, and the service process is 64bit, the provider must also be available in 64 bit format.
The ODAC112021Xcopy_x64.zip was installed to C:\Oracle. What Procmon showed me however is that sqlservr is attempting to find the oci.dll in any folder but his! (It iterates through the %Path% sysvariable). When it finally gives up on find the dll, the SQL Service is in a unstable shape and the only way to stop the service was to kill it via taskmgr/procexp. Clearly I can see that the “xcopy” deployment – while not giving me any error messages – it also did not set the PATH variable! And this is what this post is really about… adding C:\Oracle and C:\Oracle\Bin to the Path variable or maybe it’s about employing investigative tools earlier in the process instead of relying on your search engine skills.
sqlservr.exe can now find the relevant DLL’s. The OCI.DLL in the root and the OraOLEDB11.DLL in the Bin subfolder. At this point I could query the database! If you did my steps as above and you still get the same error, I strongly suggest using Procmon.exe as I have instead of jumping to the next search result.
Full post is here with more details.

How to turn off CommandBehavior=SequentialAccess in SSMS?

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.

Query with SQL Server 2008 R2 with FireDAC

I'm new to Firedac but not with Delphi
I can make a connection with SQL Server, and when I connect, there is no problem. I get connection OK. It works with code, with the wizard and with the FireDAC explorer.
The name of the database is :
C:\PROGRAM FILES (X86)\MICROSOFT SQL SERVER\MSSQL.1\MSSQL\DATA\3410b539-431f-4dff-ad0d-a574d1b13498.MDF
I'm stuck with a simple query.
SELECT *
FROM Account;
This query works from within the FireDac explorer but not from my program, I'm getting the following error:
[FireDAC][Phys][ODBC][Microsoft][SQL Server Native Client 11.0][SQL Server]Could not find server 'C:\PROGRAM FILES (X86)\MICROSOFT SQL SERVER\MSSQL' in sys.servers. Verify that the correct server name was specified. If necessary, execute the stored procedure sp_addlinkedserver to add the server to sys.servers.'
I'm also also getting the same error, when I try to do it from the UI within Delphi.
To try the query, I dropped onto the form a TFDQuery, the connection property was set automatically to the unique connection on the form. Then I set the query with the query editor, I get the error when I click on execute.
With code it like this :
FDConnection1.Connected := true;
FDQuery1.Close;
FDQuery1.SQL.Text := 'select * from Account;';
FDQuery1.Active := True;
When I debug the program, I get the error when setting the query active.
I see that the name of the DB is not complete in the error message. But it's complete in the component settings
Please advise,
I tried some extra test :
If I run the query from the UI editor (double-clicking on the FDConnection, Tab SQL Script), type the query, it works :-).
But when I try to do it on the FDQuery component, with the connection assigned to previous FDConnection, I get the same error. It' like some parameters are missing.
You are using the location of the SQL data file, instead of the name of the SQL Database.
If you do not know the name you can use the wizard to try and find it.
(Sorry could not add comments yet. This is also mentioned by Jens in the comments)
Update: if that is really the name, try enclosing it in [ ].
I got this response from an Embarcadero engineer:
The problem is not in FireDAC, but in SQL Server ODBC driver
SQLPrimaryKeys function. It fails to work with a catalog name
containing a dot. FireDAC uses this function to get primary key fields
for a result set, when fiMeta is included into FetchOptions.Items. So,
as a workaround / solution, please exclude fiMeta from
FetchOptions.Items.

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.

SQL Server SSIS : ADO.net date issue

I have created an SSIS package that pulls the data from Oracle 10g server and pushes them in SQL Server 2008. I have date datatype field in Oracle named admission_date.
Below is my query in Oracle.
select pt_id,admission_date
from stays
It works fine.
When I tried to pull the data in SQL Server through ADO.net via an SSIS package. I get the below error messages.
Error: 0xC02090F5 at STAYS, ADO NET Source [1050]: The component "ADO
NET Source" (1050) was unable to process the data. ORA-01843: not a
valid month
Error: 0xC0047038 at STAYS, SSIS.Pipeline: SSIS Error Code
DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on component "ADO NET
Source" (1050) returned error code 0xC02090F5. The component returned
a failure code when the pipeline engine called PrimeOutput(). The
meaning of the failure code is defined by the component, but the error
is fatal and the pipeline stopped executing. There may be error
messages posted before this with more information about the failure.
Any input on this would helpful.
Use something like this TO_CHAR(addmission_date,'yyyy-mm-dd HH24:MI:SS') to format your oracle date into a format that SQL likes.
Also be aware that Oracle has a much larger valid date range than SQL so depending upon your Oracle data you may have valid oracle dates that don't come across as valid SQL dates.
See Dealing With Timestamp/Datetime when copying from Oracle to Sql Server using SSIS
And Oracle to SQL2005 DATETIME field overflows in SSIS
Well, the issue was the Oracle table was a view and not a table , the admission_date was extracted from the decode command for SQL. I pulled as it is and it is resolved my issue.

Resources