BCP in SQL Server 2008 : can not find stored procedure 'sp_describe_first_result_set' - sql-server-2008-r2

My .bcp file was out from SQL Server 2016.
When I attempted bcp in SQL Server 2008 R2, an error occurred:
SQLState = 37000, NativeError = 2812
Error = [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Could not find stored procedure 'sp_describe_first_result_set'
Can anyone give me some idea?

There's a potentially similar issue described on Connect here: Attempt to use BCP 2016 to export from SQL 2008 or earlier fails with obscure error message.
Try downloading the Windows ODBC driver.

I changed my location to bcp.exe at version 110 and ran ok
cd C:\Program Files\Microsoft SQL Server\110\Tools\Binn
cp <commands>

It's funny but
bcp "$db$..$table$" out $file$.csv -c -t\t -T -S $server$
fails with the error.
SQLState = 37000, NativeError = 2812
Error = [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Could not find stored procedure 'sp_describe_first_result_set'.
But this works OK:
bcp "select * from $table$" queryout $file$.csv -d $db$ -c -t\t -T -S $server$
Server is sql 2008, and client is Version: 13.0.1601.5.

Related

copy (...) from program (gzip '..../data.csv.gz') in Postgresql on windows is failed

My data.csv is a large volume and I don't have enough storage in my system for that.
Because of this, I want to import data.csv.gz into a table of the database in PostgreSQL.
I tried the following code to import that file.
copy origin (...) from program 'gzip D:\Download\data.csv.gz' (format CSV);
But I've got this error:
ERROR: program "gzip D:\Download\origin_visit.csv.gz" failed
DETAIL: child process exited with exit code 1
Origin is my table in PostgreSQL.
My OS is Windows 10.
I installed gzip in my system and added its path to the environment.
How can I run the code in PostgreSQL? Is there any way to import data.csv.gz to PostgreSQL?

Error while try to connect table on DB2 using Python (SQL0332N)

I'm connecting to DB2-LUW database using Python 3.7 and some queries get error : "SQL0332N Character conversion from the source code page "1252" to the target code page "874" is not supported.***".
First I try to test the connection of Python to the database on DB2 by recreating a new table.
I insert 1 record and read it back. When I read the inserted row, I get the error.
Results in interactive python:
import ibm_db_dbi as dbi
print(dbi.__version__)
3.0.2
conn = dbi.connect("DATABASE=<db>;HOSTNAME=<hostname>;PORT=<port>;PROTOCOL=TCPIP;UID=<user>;PWD=<pwd>;", "", "")
c = conn.cursor()
c.execute('create table ibm_db_tst (col1 int)')
Out[5]: True
c.execute('insert into ibm_db_tst values(2)')
Out[6]: True
c.execute('select col1 from ibm_db_tst')
Out[7]: True
print(c.fetchone())
Traceback (most recent call last):
File "C:\Users\2400566\Anaconda3\lib\site-packages\ibm_db_dbi.py",
line 1449, in _fetch_helper
row = ibm_db.fetch_tuple(self.stmt_handler)
SQLCODE=-332lumn information cannot be retrieved: [IBM][CLI
Driver][DB2/NT64] SQL0332N Character conversion from the source code
page "1252" to the target code page "874" is not supported.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "", line 1, in
print(c.fetchone())
File "C:\Users\2400566\Anaconda3\lib\site-packages\ibm_db_dbi.py", line 1475, in fetchone
row_list = self._fetch_helper(1)
File "C:\Users\2400566\Anaconda3\lib\site-packages\ibm_db_dbi.py", line 1456, in _fetch_helper
raise self.messages[len(self.messages) - 1]
SQLCODE=-332_dbi::Error: [IBM][CLI Driver][DB2/NT64] SQL0332N Character conversion from the source code page "1252" to the target code page "874" is not supported.
I'm not sure what's wrong? Need advice.
my Python version is Python 3.7.7 running on Window 10 PC x64
DB2 is on Windows server 2012 x64 .
DB2 version is DB2 v11.1.0.1527.
Database territory : GB
Database code page : 1252
Database code set : 1252
Database country/region code : 44
Thanks in advance.
In case that your python script is using db2dsdriver to connect to database on server, try to set the DisableUnicode keyword to 0 to enforce unicode code page (i.e. 1208) on Windows.
https://www.ibm.com/support/knowledgecenter/en/SSEPGG_11.1.0/com.ibm.swg.im.dbclient.config.doc/doc/r0054636.html

SQL Server 2008 R2 an error occurred during the installation of assembly

SQL Server 2008 R2 : an error occurred during the installation of assembly
Error installing SQL Server 2008 R2
AN ERROR OCCURRED DURING THE INSTALLATION OF ASSEMBLY 'microsoft.vc80..crt.version="8.0.50727.1833", publickeytoken ="1fc8b3b9a1e18e3b" processorarchiteure="x86",type="win32"'.
please refer to help and support for more information.HRESULT:0X80070091
Error log
Overall summary:
Final result: SQL Server installation failed. To continue, investigate the reason for the failure, correct the problem, uninstall SQL Server, and then rerun SQL Server Setup.
Exit code (Decimal): -2068052081
Exit facility code: 1212
Exit error code: 1935
Exit message: SQL Server installation failed. To continue, investigate the reason for the failure, correct the problem, uninstall SQL Server, and then rerun SQL Server Setup.
Start time: 2016-10-18 12:43:18
End time: 2016-10-18 12:54:56
Requested action: Install
Log with failure: C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20161018_124236\SqlSupport_KatmaiRTM_Cpu64_1.log
Exception help link: http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=10.50.4000.0
Machine Properties:
Machine name: TU-KEPEGAWAIAN5
Machine processor count: 2
OS version: Windows 7
OS service pack:
OS region: United States
OS language: English (United States)
OS architecture: x64
Process architecture: 64 Bit
OS clustered: No
Product features discovered:
Product Instance Instance ID Feature Language Edition Version Clustered
Package properties:
Description: SQL Server Database Services 2008 R2
ProductName: SQL Server 2008 R2
Type: RTM
Version: 10
Installation location: d:\3d266eac1900851510714b4790ad\x64\setup\
Installation edition: EXPRESS
Slipstream: True
SP Level 2
User Input Settings:
ACTION: Install
ADDCURRENTUSERASSQLADMIN: True
AGTSVCACCOUNT: NT AUTHORITY\NETWORK SERVICE
AGTSVCPASSWORD: *****
AGTSVCSTARTUPTYPE: Disabled
ASBACKUPDIR: Backup
ASCOLLATION: Latin1_General_CI_AS
ASCONFIGDIR: Config
ASDATADIR: Data
ASDOMAINGROUP: <empty>
ASLOGDIR: Log
ASPROVIDERMSOLAP: 1
ASSVCACCOUNT: <empty>
ASSVCPASSWORD: *****
ASSVCSTARTUPTYPE: Automatic
ASSYSADMINACCOUNTS: <empty>
ASTEMPDIR: Temp
BROWSERSVCSTARTUPTYPE: Disabled
CONFIGURATIONFILE:
CUSOURCE:
ENABLERANU: True
ENU: True
ERRORREPORTING: False
FARMACCOUNT: <empty>
FARMADMINPORT: 0
FARMPASSWORD: *****
FEATURES: SQLENGINE
FILESTREAMLEVEL: 0
FILESTREAMSHARENAME: <empty>
FTSVCACCOUNT: <empty>
FTSVCPASSWORD: *****
HELP: False
INDICATEPROGRESS: False
INSTALLSHAREDDIR: C:\Program Files\Microsoft SQL Server\
INSTALLSHAREDWOWDIR: C:\Program Files (x86)\Microsoft SQL Server\
INSTALLSQLDATADIR: <empty>
INSTANCEDIR: C:\Program Files\Microsoft SQL Server\
INSTANCEID: SQLExpress
INSTANCENAME: SQLEXPRESS
ISSVCACCOUNT: NT AUTHORITY\NetworkService
ISSVCPASSWORD: *****
ISSVCSTARTUPTYPE: Automatic
NPENABLED: 0
PASSPHRASE: *****
PCUSOURCE: d:\3d266eac1900851510714b4790ad\PCUSOURCE
PID: *****
QUIET: False
QUIETSIMPLE: False
ROLE: AllFeatures_WithDefaults
RSINSTALLMODE: FilesOnlyMode
RSSVCACCOUNT: NT AUTHORITY\NETWORK SERVICE
RSSVCPASSWORD: *****
RSSVCSTARTUPTYPE: Automatic
SAPWD: *****
SECURITYMODE: <empty>
SQLBACKUPDIR: <empty>
SQLCOLLATION: Latin1_General_CI_AS
SQLSVCACCOUNT: NT AUTHORITY\SYSTEM
SQLSVCPASSWORD: *****
SQLSVCSTARTUPTYPE: Automatic
SQLSYSADMINACCOUNTS: TU-KEPEGAWAIAN5\tu-kepegawaian5,BUILTIN\Administrators
SQLTEMPDBDIR: <empty>
SQLTEMPDBLOGDIR: <empty>
SQLUSERDBDIR: <empty>
SQLUSERDBLOGDIR: <empty>
SQMREPORTING: False
TCPENABLED: 0
UIMODE: AutoAdvance
X86: False
Configuration file: C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20161018_124236\ConfigurationFile.ini
Detailed results:
Feature: Database Engine Services
Status: Failed: see logs for details
MSI status: Passed
Configuration status: Passed
Rules with failures:
Global rules:
Scenario specific rules:
Rules report file: C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20161018_124236\SystemConfigurationCheck_Report.htm
There are a few options for fixes/workarounds in these issue:
check below links.
Error MS SQL : 1
Error MS SQL : 2
also re install updated Visual C++ 2005 Redistributable Package.
Please let us know if you have any concerns.
I had exact the same error IDs during installtion.
In my case the "Microsoft Visual C++ 2005 Redistributable (x64)" was wrong, so i simply had to install the missing component and afterwards was able to install SQL Server without errors.
Just have a look here: https://cms4j.wordpress.com/2016/12/12/sql-server-2008-r2-installation-failed-2068052081-1212-1935
I had exact the same error for SQL Server 2014. I reinstalled Microsoft Visual C++ 2005 Redistributable (x64) and then it did not install again.
I disabled my antivirus and than reinstalled SQL Server and it is installed.

SQL Server 2008 R2 folder missing in system

During rebuilding master database in SQL Server, I tried the steps mentioned int he link below:
link
But I am getting an error
Error code: 2 error
so as mentioned there and other sources I want to change my command prompt path from:
C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Release
to the path:
C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\SQLServer2008R2
But I don't have this folder SQLServer2008R2 on my PC.

Unable to restore SQL Server 2008 R2 Express backup file onto SQL Server 2012 Express

I have a .bak file which I created using SQL Server 2008 R2 Express .
I tried to restore it to a SQL Server 2012 Express but got the following error messages:
Msg 5133, Level 16, State 1, Line 2
Directory lookup for the file "C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\RealEstate.mdf" failed with the operating system error 3(The system cannot find the path specified.).
Msg 3156, Level 16, State 3, Line 2
File 'RealEstate' cannot be restored to 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\RealEstate.mdf'. Use WITH MOVE to identify a valid location for the file.
Msg 5133, Level 16, State 1, Line 2
Directory lookup for the file "C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\RealEstate_log.ldf" failed with the operating system error 3(The system cannot find the path specified.).
Msg 3156, Level 16, State 3, Line 2
File 'RealEstate_log' cannot be restored to 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\RealEstate_log.ldf'. Use WITH MOVE to identify a valid location for the file.
Msg 3119, Level 16, State 1, Line 2
Problems were identified while planning for the RESTORE statement. Previous messages provide details.
Msg 3013, Level 16, State 1, Line 2
RESTORE DATABASE is terminating abnormally.
Can somebody please help me solve this problem?
For your information,
the .bak file was created from the SQL Server 2008 R2 database running on my old PC which died last month.
I just bought a new PC and decided to install SQL Server 2012 instead.
I would like to restore this .bak file into the SQL Server 2012 running on my new PC.
In SQL Server 2008 R2, the databases are stored in
C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA.
Meanwhile in SQL Server 2012, the databases are stored in
C:\Program Files\Microsoft SQL Server\MSSQL11.SQLEXPRESS\MSSQL\DATA.
I wonder if the original path is indeed stored in the .bak file. Does anybody know about this?
If you are moving from SQL 2008 to SQL 2012 try something like this.
RESTORE DATABASE DBName FROM DISK = 'C:\Path\To\Bak\File' WITH REPLACE;
RESTORE DATABASE RealRestate
FROM DISK = 'C:\PATH_TO\RealEstate.bak'
WITH MOVE '<dataname>' TO 'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\RealEstate.mdf',
MOVE '<logname>' TO 'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\RealEstate_log.ldf', REPLACE
Notice, I already put in the new location
the <dataname> and <logname> can be found with
restore filelistonly from disk ='C:\PATH_TO\RealEstate.bak'
This will restore nothing, but show you the properties of you bak file. In the column Logicalname, you will see the names for <dataname> (where the type is D) and <logname> (where the Type is L)