Winsock error when running SQL Server Stored Proc
I have a SQL Server stored procedure that is trying to read emails from an IMAP server (I am using mail.dll from www.limilabs.com).
The SP works fine on my local computer/db, and the code also runs fine when run from a console application on my remote server. When I try to run it from SQL Server however I get this error message:
Msg 6522, Level 16, State 1, Procedure GetEmails, Line 0A .NET Framework error occurred during execution of user-defined routine or aggregate "GetEmails": Limilabs.Client.ServerException: The requested name is valid, but no data of the requested type was found ---> System.Net.Sockets.SocketException: The requested name is valid, but no data of the requested type was foundSystem.Net.Sockets.SocketException: at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6) at System.Net.Dns.GetHostAddresses(String hostNameOrAddress) at System.Net.Sockets.Socket.Connect(String host, Int32 port) at Limilabs.Client.ClientBase.Connect(String host, Int32 port, Boolean useSSL)Limilabs.Client.ServerException: at Limilabs.Client.ClientBase.Connect(String host, Int32 port, Boolean useSSL) at StoredProcedures.GetEmails()
I suspect it is something to do with permissions (??) but it is beyond my knowledge of SQL Server. Anyone have some pointers? I am using the IP for the IMAP server, I have switched off the firewall.
Thanks
Reading emails in a stored procedure? Hm...
Unless you are impersonating the actual user in your CLR procedure, the access will be under the service account for SQL Server. If this is Local Servic or similar and may not have the permission or configuration to access whatever System.Net.Dns.InternalGetHostByName
is trying to access.
Try running SQL Server under a domain account to see what happens.
Erland Sommarskog, SQL Server MVP, [email protected]
Similar Messages
-
ORA-03113 error when running the Java stored proc demos
Hi there,
Has anyone else run into this issue. When attempting to transfer an object type from Java to Oracle - through a Java stored proc - the session crashes with:
ORA-03113: end-of-file on communication channelLooking in the trace file generated the error message looks something like:
ksedmp: internal or fatal error
ORA-07445: exception encountered: core dump [0x8fe04468] [SIGTRAP] [unknown code] [0x8FE59034] [] []
Current SQL statement for this session:
select pointruntime.jdistance(point(1, 2), point(2, 3)) from dual
----- Call Stack Trace -----
calling call entry argument values in hex
location type point (? means dubious value)
ksedmp+764 call ksedst 0 ? 2C4F4A ? 2C ? 98968000 ?
DB02C ? 27A50000 ?
ssexhd+956 call ksedmp 3 ? 0 ? 8FE5E790 ? 5905870 ?
8FE0434C ? 40895E4 ?
0x9012c860 call ssexhd 5 ? BFFEEF70 ? BFFEEFB0 ? 0 ?
0 ? 0 ?As you can see from the trace snippet above, I was attempting to run one of the Oracle Java stored procedure demos. Has anyone successfully run those demos? Specifically the ones where complex types (table objects or the Point object) are passed back to Oracle from the JVM.
I would appreciate some help with this. The code works fine in a Windows or Solaris environment but barfs on Apple. Truly annoying....
Anyone?
Thanks in advance,
AlexYes,
Apologies for not stating that information, Steve. Was a bit naughty of me! I guess the reason I didn't was because I just wanted to hear if anyone else running Oracle on Mac received such errors when executing the Java stored proc demos (specifically, the execution of PointRuntime.jDistance). Nevertheless, here's the relevant info from the trace file:
Dump file /Users/oracle/admin/sandbox/udump/sandbox_ora_1861.trc
Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - Production
With the Partitioning, Oracle Label Security, OLAP and Data Mining Scoring Engine options
ORACLE_HOME = /Users/oracle/product/10.1.0/db
System name: Darwin
Node name: maczilla.local
Release: 8.3.0
Version: Darwin Kernel Version 8.3.0: Mon Oct 3 20:04:04 PDT 2005; root:xnu-792.6.22.obj~2/RELEASE_PPC
Machine: Power Macintosh
Instance name: sandbox
Redo thread mounted by this instance: 1
Oracle process number: 10
Unix process pid: 1861, image: [email protected] for the Java version, according to the readme file in the javavm directory, I am running 1.4.1:
1.5 Java Compatibility
This release has been thoroughly tested with Sun's Java Compatibility
Kit for the JDK 1.4.1. Oracle is committed to OracleJVM keeping pace
with Java and other Internet standards. -
MS VC++ Runtime Library error when running SQL Server Profiler
Environment:
- Windows Server 2008 R2 Standard
- SQL Server 2008 R2 Enterprise with SP2 and CU11
When starting up the SQL Server Profiler tool, I faced the following issue
Event log:
Faulting application name: Profiler.exe, version: 2009.100.1600.1, time stamp: 0x4bb679f5
Faulting module name: MSVCR80.dll, version: 8.0.50727.6229, time stamp: 0x4ec352ab
Exception code: 0x40000015
Fault offset: 0x000046b4
Faulting process id: 0xb60
Faulting application start time: 0x01cfb084ee490685
Faulting application path: C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\Profiler.exe
Faulting module path: C:\Windows\WinSxS\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.6229_none_d089f796442de10e\MSVCR80.dll
Report Id: 311be94c-1c78-11e4-af71-463500000031
Any advises?
Thanks.Thanks Erland. Not sure what I am missing and need to apply. As said my environment was already applied SP2 and CU11. Please can you give me more information? A link to download or things like that would be much appreciated.
SQL Server engine might be patched but profiler may not be. Check the file properties of PROFILER.EXE.
The error which you are seeing an exception due to VC++
Can you please run .net verification tool and make sure they are consistent?
http://blogs.msdn.com/b/astebner/archive/2008/10/13/8999004.aspx
Balmukund Lakhani
Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
This posting is provided "AS IS" with no warranties, and confers no rights.
My Blog |
Team Blog | @Twitter
| Facebook
Author: SQL Server 2012 AlwaysOn -
Paperback, Kindle -
Error when call sql server stored procedure
hello everybody,
I'm working with MII 14 and I want call a SqlServer stored procedure provided from my customer.
I configured a FixedQuery like this:
[dbo].[spElencoEntrateUscite_AV] @delta = 0, @daquando='130101', @CompanyID='000002', @Elenco = @MyCursor OUTPUT
but when i test the query i have back the error:
com.microsoft.sqlserver.jdbc.SQLServerException: Must declare the scalar variable "@MyCursor".
I tried also to set the query like this:
[dbo].[spElencoEntrateUscite_AV]
and pass Parameters:
0
130101
000002
OUTPUT
but i have this error:
com.microsoft.sqlserver.jdbc.SQLServerException: Procedure or function 'spElencoEntrateUscite_AV' expects parameter '@Elenco', which was not supplied.
Any suggestion?
thanks in advance
Alexhello Kuldeep!
yes i solved.
I used fixed query in MII and declared the cursor:
example:
DECLARE @MyCursor CURSOR
EXEC [dbo].[spElencoEntrateUscite_AV] @delta = 0,@daquando='[Param.1]', @CompanyID='[Param.2]', @Elenco = @MyCursor OUTPUT
I hope this may help u
Alessandro -
An error when registering SQL server driver
Hi
I have got the following error when register SQL server drive
"RemoteMsDataBase.java": Error #: 302 : cannot access class com.microsoft.jdbc.sqlserver.SQLServerDriver; neither class nor source found for com.microsoft.jdbc.sqlserver.SQLServerDriver at line 19, column 63
the code that cause error
// register the SQL driver
DriverManager.registerDriver(new com.microsoft.jdbc.sqlserver.SQLServerDriver());
// connect to the DB by using the driver.
String connString = "my_dbserver:1433;databasename=my_database";
String strDBConnect = "jdbc:microsoft:sqlserver://" + connString;
conn = DriverManager.getConnection(strDBConnect, userName, passwd);
To include jars to my classpath do this:
javac -deprecation -classpath msbase.jar;msutil.jar;mssqlserver.jar *.javajavac -deprecation -classpath msbase.jar;msutil.jar;mssqlserver.jar *.javaSpecify the full path for jar(s), example,
javac -deprecation -classpath .;c:\myjars\msbase.jar;c:\myjars\msutil.jar;c:\myjars\mssqlserver.jar *.java
Hope it works.
Sudha -
This is the error message I receive; "SQL Server setup media does not support the language of the OS or does not
have the SQL Server-English language version installation files. Use the matching language-specific SQL Server
media, or install both the language specific MUI and change the format and system locales through the regional settings in the control
This is the error message I receive; "SQL Server setup media does not support the language of the OS or does not have the SQL Server-English
language version installation files. Use the matching language-specific SQL Server media, or install both the language specific MUI and change
the format and system <span style="color:#333333;font-family:'Segoe UI', Arial, sans-serif;font-sizHello,
Please go to Control Panel->Regional Setting and change the “Format” language to the same language of the setup media. After
that, re-run SQL Server setup program.
For more options/workarounds, please read the “Workaround” section on the following link:
https://connect.microsoft.com/SQLServer/feedback/details/556958/sql-server-setup-media-does-not-support-the-language-of-the-os
Hope this helps.
Regards,
Alberto Morillo
SQLCoffee.com -
Getting Error when running sql from concurrent program in R12
Hi All,
I created concurrent program and attached EXECUTABLE which executable method as SQL plus .
Using this program I am running one SQL file in R12 when I am running I am getting below error .
Same king of program I have define in 11i and running it is running can anyone please help me if I need to do any set ups or security thing to resave this problem.
ERROR:
ORA-01017: invalid username/password; logon denied
SP2-0306: Invalid option.
Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}]
where <logon> ::= <username>[<password>][@<connect_identifier>] | /
SP2-0306: Invalid option.
Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}]
where <logon> ::= <username>[<password>][@<connect_identifier>] | /
SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
Concurrent Manager encountered an error while running SQL*Plus for your concurrent request 3162719.
Review your concurrent request log and/or report output file for more detailed information.
Executing request completion options...
Finished executing request completion options.
Regrds,
Sridhar.user12000862 wrote:
Hi all,
Thanks a lot giving replay below simple code I have put in my SQL file for testing Eventhough it is giving error .
Table which i am using in Apps schema only.
declare
BEGIN
insert into BRCD_HZ_DNB_XTBL_TEST values (666,'Y','547','Y','12254','TESTING','N','Y');
commit;
END;
/Try this instead
WHENEVER SQLERROR EXIT FAILURE ROLLBACK;
WHENEVER OSERROR EXIT FAILURE ROLLBACK;
insert into BRCD_HZ_DNB_XTBL_TEST values (666,'Y','547','Y','12254','TESTING','N','Y');
commit;
exit;HTH
Srini -
I am at my wits end. I've been developing on Windows for 20 years but have never run across something like this. On Windows 7 Pro I need to install the SQL Server 2014 demo (SQLServer2014-x64-ENU) with the SQL Server 2012 community data mgmt
package demo (SSDTBI_VS2012_x86_ENU) to develop my MSBI/SSIS skills. Somewhere along the line one of the prerequisite updates causes the Windows update process to quit working giving me and error code beginning with 8 (sorry didn't write it down, stupid)
that says I don't have permissions to update. Have not been able to isolate it farther than that. Have done all the fixes I've been able to find online and none of them have worked. For whatever reason, when I install the same thing under
VMware it's runs fine. I've had Microsoft log onto my machine and he told me I needed to buy a $99 piece of software to fix the problem. At this point I'm more than ready to do so.I am at my wits end. I've been developing on Windows for 20 years but have never run across something like this. On Windows 7 Pro I need to install the SQL Server 2014 demo (SQLServer2014-x64-ENU) with the SQL Server 2012 community data
mgmt package demo (SSDTBI_VS2012_x86_ENU) to develop my MSBI/SSIS skills. Somewhere along the line one of the prerequisite updates causes the Windows update process to quit working giving me and error code beginning with 8 (sorry didn't write it down,
stupid) that says I don't have permissions to update. Have not been able to isolate it farther than that. Have done all the fixes I've been able to find online and none of them have worked. For whatever reason, when I install the same thing
under VMware it's runs fine. I've had Microsoft log onto my machine and he told me I needed to buy a $99 piece of software to fix the problem. At this point I'm more than ready to do so.
>> I've had Microsoft log onto my machine and he told me I needed to buy a $99 piece of software to fix the problem.
I do not understand and never seen a log that tell you what to buy or what it cost.
according to your explanation I would probably try to restore to point in time before the first installation which star the problem. If you do not have a backup then it is a great lesson for life :-)
In this case:
Please provide us more information from the log file during the installation that stopped + the errors that you get in current attempt to install.
C:\Program Files\Microsoft SQL Server\<folder name according your installation>\MSSQL\Log
Ronen Ariely
[Personal Site] [Blog] [Facebook] -
SQL Server Stored Proc/Database Permissions
First of all, I'm not sure that I'm posting this in the correct place. I'm a Windows/Active Directory Engineer, looking for some guidance on how other companies are managing/maintaining what I'm about to describe.
We have a rather complex SQL Server environment with multiple two node clusters running multiple databases on each. On their own, rather simple. On each database there are different stored procedures that are being accessed by different service
accounts for different (mainly) web services.
Up until recently, we were running into issues deploying proper accounts and groups for this process. We've got a multi-domain environment with trusts between them. We follow IGDLA (AGDLP) to grant permissions... That is..
Account -------- Global Group --------- Domain Local Group
WebSvcAcct --- WebSvcAcct_Group ------ MyService_Group
The Global group is granted the permissions cross-domain, following AD Group Scoping. We currently track this, per service, in a Database access Spreadsheet, where we list the following in each successive column:
Service, Account, Global Group, Domain Local, Database Server, Database Name, Database Role, Stored Procs
Is there a tool/utility that can maintain this and allow Role-Based Access to it? How do other companies maintain database permissions?
Thanks in advance!!Hello,
Are you asking if there is something that can maintain your list or something that can help you with security?
Most companies use groups, much like you have there and either give access to the group or use it in combination with database roles. This simplifies many different aspects of reporting and auditing.
If you're asking about a utility, I don't know of any specifically for this but it shouldn't be too hard to make a powershell utility script to do this for you, interrogating AD, SQL, etc.
-Sean
The views, opinions, and posts do not reflect those of my company and are solely my own. No warranty, service, or results are expressed or implied. -
Sql server stored procs migration to oracle
Can't I migrate only the stored procedures alone of sql server db to Oracle using sql developer? How to load the .ocp files with the stored procs I have?
Hi,
I don't know how to manually update the generated captured files (bat, ocp) with other information or even if it is possible, as the bat files extract data from the SQL*Server data dictionary information to populate the files for the load. If the stored procedures have already been created in the SQL*Server database then they will added to the generated OCP information. If you want to manually change the files then you'll have to work it out for yourself, I'm afraid.
If they are not in the SQL*Server database and exist only as the create statements in text files then you have 2 options, as far as I can see -
- either run the scripts to create the stored procedures in the database before running the migration
- use the translation scratch editor and put the procedure create SQL into that to convert to Oracle format -
Tools > Migration >Translation Scratch Editor
You need to be aware that translation of stored procedures isn't always automatically 100% completed and manual intervention is sometimes needed, depending on the complexity of the procedure and how it is written.
Regards,
Mike -
Error when installing SQL Server 2014 Express
I am running a Win 8.1 desktop 64bit (fully updated) with already installed SQL Server 2012 and Visual Studio 2010 and 2013 (non Express versions). I need to keep SQL Server 2012 for development purposes but also need SQL Server 2014 for a database
provided to me by others which needs this version. I found out it should be possible to run the two versions side-by-side. During installation of SQL Server 2014 Express I selected all features except 'Local Db' and used a named instanc
e. The setup runs through without any notice of problems but at the end fails with error code 1638 the reason being 'Error installing Microsoft Visual Studio 2010 Redistributables'. Also at the end a window pops up mention 'The working of SQL Server
2014 stopped - Trying to find a solution'. Doing nothing on my part the window disappears and nothing else happens. So I uninstalled any 'Redistributable' and ran setup again. Same result though both 'Microsoft Visual C++ 2008 Redistributable
- x86 9.0.30729.4974' and 'Microsoft Visual C++ 2010 x64 Redistributable - 10.0.40219' re-appear in Control Panel as being
p
roperly installed! All features are marked as 'failed' with one and the same error 1638. Even tried just upgrading to see if that would work but also here same error.
I have not been able to find the proper solution so I am now stuck. Hopefully someone can give me the right steps to take? Ruud van der SpoelHello,
Error 1638 means another version of the product is already installed. Probably you have a 32-bit version installed but
the installation requires a 64-bit version of VC.
Try to manually install both 32-bit and 64-bit versions of each VC.
Hope this helps.
Regards,
Alberto Morillo
SQLCoffee.com -
Error when installing SQL Server 2008 R2 after downloading
Hi -I hope somebody can help me.
I have tried to install nopCommerce with no luck. I am not able to establish the SQL database. I have tried to solve the problem for a very long time, also with no luck. Now I think it has to do with an error that come when I installed the SQL Server 2008
R2.
I have tried to load a picture here, but was denied.
with hopes for help
Regards Egil Ryengen
The error text is as followed:
Unhandled exception has occured in your application. If you click Continue, the application will ignore this error and attempt to continue. You click Quit, the application will close immediately.
An error occurred creating the configuration section handler for userSettings/Microsoft.SqlServer/Configuration/LandingPage/Properties.Settings: not load file or assambly "System, Version =4.0.0.0,
Culture=neutral. Public Key Token=b77a5c561934e089" or one of its dependencies. The system cannot find the file specified.
(C:/Users/EgilRyengen/AppData/Local/Microsoft_Corporation/LandingPage.exe_StrongName_ryspccglaxmt4nhllj5z3thycltsvyyx/10.0.0.0/user.coUnhandled exception has occured in your application. If you click Continue, the application will ignore this error and attempt to continue. You click Quit, the application will close immediately.
An error occurred creating the configuration section handler for userSettings/Microsoft.SqlServer/Configuration/LandingPage/Properties.Settings: not load file or assambly "System, Version =4.0.0.0,
Culture=neutral. Public Key Token=b77a5c561934e089" or one of its dependencies. The system cannot find the file specified.
(C:/Users/EgilRyengen/AppData/Local/Microsoft_Corporation/LandingPage.exe_StrongName_ryspccglaxmt4nhllj5z3thycltsvyyx/10.0.0.0/user.co
Did you read hardware and software requirements before installing SQL Server 2008 R2. I guess you are missing .Net framework. AS per
This Doc
You need to download and install .Net framework 3.5 SP1 and requirement is more if you are installing express edition. Its all mentioned in link
You can also refer to
this Thread it has same issue as you are having
Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it
My Technet Wiki Article
MVP -
Converting MS Sql server stored proc to Oracle stored procedure
I need to convert this MS SQL Server 200 stored procedure to Oracle stored procedure. Any help great appreciated.
Thank you,
set nocount on
declare @sp varchar(100)
set @sp = '<< stored procedure name goes here >>'
declare @oid int
select @oid = o.id from sysobjects o where o.name = @sp
declare @last int
-- function signature
select @last = max(c.colid)
from dbo.syscolumns c
where c.id = @oid
select case c.colid
when 1 then '[ SqlCommandMethod(CommandType.StoredProcedure) ]'
+ char(13) +
'public static SqlCommand ' + @sp + '(' + char(13) +
' [ NonCommandParameter ] SqlConnection
' connection '
+ char(13) +
else ''
end
+ ' ' +
case t.name
when 'char' then
'[ SqlParameter(' + convert(nvarchar(10), c.length) + ') '
when 'varchar' then
'[ SqlParameter(' + convert(nvarchar(10), c.length) + ') ] '
when 'nchar' then
'[ SqlParameter(' + convert(nvarchar(10), c.length / 2) + ') ] '
when 'nvarchar' then
'[ SqlParameter(' + convert(nvarchar(10), c.length / 2) + ') ] '
else ''
end
+
case t.name
when 'char' then 'string'
when 'nchar' then 'string'
when 'varchar' then 'string'
when 'nvarchar' then 'string'
when 'bit' then 'bool'
when 'datetime' then 'DateTime'
when 'float' then 'double'
when 'real' then 'float'
when 'int' then 'int'
else 'object /* ' + t.name + ' */'
end
+ ' ' + lower(substring(c.name, 2, 1)) + substring(c.name, 3, 100)
+
case c.colid
when @last then ')' + char(13) + '{'
else ','
end
from dbo.syscolumns c
left outer join dbo.systypes t on c.xusertype = t.xusertype
where c.id = @oid
order by c.colid
-- call to generator
select case c.colid
when 1 then
' return SqlCommandGenerator.GenerateCommand(connection,' +
char(13)
else ''
end
+ ' ' + lower(substring(c.name, 2, 1)) + substring(c.name,
3, 100)
+
case c.colid
when @last then ');' + char(13) + '}'
else ','
end
from dbo.syscolumns c
where c.id = @oid
order by c.colidIt would have helped if you had posted your code.
To create tables in procedures, you can use EXECUTE IMMEDIATE. For example, if within a procedure, you want to:
CREATE TABLE table_name
(column1 NUMBER,
column2 VARCHAR2 (30),
column3 DATE);
Then, from within a procedure you can:
CREATE OR REPLACE PROCEDURE procedure_name
AS
BEGIN
EXECUTE IMMEDIATE 'CREATE TABLE table_name
(column1 NUMBER,
column2 VARCHAR2 (30),
column3 DATE)';
END procedure_name;
EXEC procedure_name
For the procedure to count the number of business days between two input dates, see the following link:
http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:91212348059 -
Applescript to run SQL Server stored procedure on Mac
Hello All,
I'm new to applescript. I've a stored procedure in SQL server that generates a uniqque Jobnumber. I need to run this stored procedure from applescript and display the new job number to the user. How can I achieve this using Applescript? Is there any other alternative? Any suggestion/inputs are welcome.
ThanksThere's no simple, direct MySQL interface within AppleScript - that is, you can't (easily) connect to your database directly and execute the stored procedure.
The commonest solution to this is to use the command line mysql interface via do shell script.
set myData to (do shell script "/usr/local/mysql/bin/mysql -u USERNAME -pPASSWORD -e '<SQL statement here>'")
There's a lengthy discussion, including examples, at http://macscripter.net/viewtopic.php?id=24721 -
2032 error when connecting SQL server with Xcelsius
Hi,
Here are the short note about it
1)The dashboard is directly linked to database using aspx page
2)the data in the database refreshed using the aspx script.
3) we have a accordion menu and a 5 levels of filter and 10 charts
Problem Description
receiving 2032 error when the dashboard is kept idle for 5-10 min and if i select/change any option in the accordion menu or the filter i am receiving this error
Can anyone please help me out of this hell.Itu2019s a security error message. Open your swf file and click with mouse right Button. Follow:
Settings/ Privacy/ Advanced/ Global Security Settings Panel/ Add Location.
Add your server address.
After select location, click u201CCloseu201D button and restart swf file.
Maybe you are looking for
-
Unable to print from my iPad to HP Photosmart 6520
I recently purchased this Photosmart 6520 printer so that I can print from my iPad. I do not have a laptop that works in order to install the software that is included. The salesperson who sold this printer to me said that I didn't need a computer
-
Asset accounting depriciation calculation for subsequent acquisition
hi, i have problem while running the depreciation for asset sub sequent acquisition my asst master is 4000 first acquisition on 01.04.2011 for rs 100000/- we calculated depreciationwdv method for april month it's working fine my client had done secon
-
A possible bug related to the Cisco ASA "show access-list"?
We encountered a strange problem in our ASA configuration. In the "show running-config": access-list inside_access_in remark CM000067 EXP:1/16/2014 OWN:IT_Security BZU:Network_Security JST:http_access access-list inside_access_in remark CM000458 EXP:
-
How can I find out what apps I've purchased are stored in the cloud
I changed phones and am trying to find out if the apps that I have purchased on my iPhone are stored in the cloud so I can bring them down to my ipod touch.
-
Alphabetize conditional text tags
Is it possible to rearrange the tags in the Conditional Text pod so that they are alphabetized?