Hello All,
i having one DLL which return Keywords.
i want to use that DLL in SQL Server Stored Proc.
as i know it is possible through Extended Stored Proc.
how to create that ? how i can pass Text Stream as input to that DLL in Extended Stored Procedure.
I have a sproc defined many databases. It has the same neme in every databases and does the same in every databases too.
I have a table that lists all the companies where the sproc exists. (BISYMAP) The field that holds the database name is INTERID.
I need to run every instance of the sproc that exists on my SQL server. I did a cursor that returns the database name into a variable and I use an EXEC statement to run the sprocs. I build the name using the variable filled by the cursor. (@TgtCoy)
Here it is. __________________________________________________ __
/*List all companies from system table and put it in @TgtCoy*/ DECLARE @TgtCoy AS CHAR(5)
DECLARE Coys CURSOR FOR SELECT DISTINCT RTRIM(INTERID) FROM BISYMAP WHERE INTERID <> ''
OPEN Coys
FETCH NEXT FROM Coys INTO @TgtCoy
WHILE @@FETCH_STATUS = 0 BEGIN /* Execute biCoMapGlAccount within each company*/ EXEC('EXEC ' + @TgtCoy + '.dbo.biCoMapGlAccount') FETCH NEXT FROM Coys INTO @TgtCoy END CLOSE Coys DEALLOCATE Coys
__________________________________________
This runs fine in SQL Query Analyzer. The issue is when I try to run this from an SQL Task in a DTS package. I can't even save the task. SQL tries to validate the query before saving and returns the following error: ... Could not find stored procedure '.dbo.biCoMapGlAccount'.
I also tried to put this into system stored procedure and call it from my DTS package but I get the same error.
Anybody ever had to deal with such a situation? If so, I would certainly appreciate a hint or two on how you didi it.
Could someone who has done it before be kind enough to post a short example of how to make a call from an extended stored procedure to a .NET DLL? Or even direct me to an example, or tell me that this is possible / not possible, it would help. Thanks,Brian
is it possible to view the source of an extended stored procedure. I know that it is a dll program but i want to know how works one of my extented stored proc
I have a question regarding the extended SPC 'xp_cmdshell'.
Basically I want to determine the username and userdomain in a stored procedure and what I know is that you can get this information in a "DOS-Box" with 'Set username' or 'Set userdomain'.
But if I use the above mentioned extended stored procedure in the following way:exec master..xp_cmdshell 'set username'I don´t get any resultset.
Does anyone know why I get different results depending on the fact if I call the 'set'-command in a "DOS-Box" or with the appropriate stored procedure?
We are on Windows 2000, SQL Server 2000, and a SAN. Our data and backups are located on the Storage Area Network.
I am attempting to restore a database with a backup on the SAN through Enterprise Manager. I selected 'From Device', 'Selected Devices'. SQL appears to hang. After looking at Current Activity, I have identified that it is running 'EXECUTE master.dbo.xp_fixeddrives 2'.
Are there any known problems with SQL Server 2000 and SAN? Has anyone encountered this error?
I have created an Extended Stored Procedure without any error in 'master' database, i.e. sp_addextendedproc @functname = xp_dump, @dllname = 'xp_dump.dll'. In xp_dump.dll, I have written a function with xp_dump name. I have developed this DLL in VB with the following sample code:
Function xp_dump() As Boolean Dim con As New ADODB.Connection Dim auid As String auid = "999-99-9999" con.Open "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Password=*********;Initial Catalog=pubs;Data Source=WASSERVER" con.BeginTrans con.Execute ("INSERT INTO table999(au_id,au_lname,au_fname,phone,address,cit y,state,zip,contract) SELECT '" & auid & "',au_lname,au_fname,phone,address,city,state,zip, contract FROM table999 WHERE au_id='213-46-8915'") con.CommitTrans con.Close
End Function
But when I am trying to EXECUTE the same in Query Analyzer the following error is found:
ODBC: Msg 0, Level 16, State 1 Cannot find the function xp_dump in the library xp_dump.dll. Reason: 127(The specified procedure could not be found.).
I have installed Standard Sql 2000 . However i don't find the ex stored Procedures xp_sqlinventory and sp_sqlregister .. Can anyone Point out here i can get them?
I am using an extended stored procedure that sends email using SMTP. The procedure can be downloaded here (http://www.sqldev.net/xp/xpsmtp.htm). If I execute the procedure in QA and it fails for some reason, the error message is printed in the Messages tab. Is there any way to capture this message/messages when I use the XP in my stored procedures?
Hi, I made some extended strored procedures and they goes well when they are placed at c:windowssystem32 or the same derectory to sqlservr.exe which is usualy in C:Program Files Microsoft SQL ServerMSSQLBinn.
I thought it's OK wherever they are placed as long as I put them to the system path.
But actually they didn't work at all when they were placed to the other path that I had newly added as a system path.
Here is the contents of 'path' valiable:
%SystemRoot%system32;%SystemRoot%;%SystemRoot%Sy stem32Wbem;C:WINDOWSSystem32AmiClick;C:Progra m FilesMicrosoft SQL Server80ToolsBINN:C:Program Files/INC
I just added only "C:Program Files/INC", placed the extended stored procedures there, then called them through a trigger.
Can Somebody tell me what was wrong? Please help me if you have any informations about this issue.
trying to setup a new push subscription and got the following error!
'Error 14053: Cannot load the DLL replincrementlsn extended procedure, or one of the DLLs it references. Reason: 126(The specified module could not be found.). The subscription could not be updated at this time. The subscription could not be created.'
Anyone have any ideas - I think it has some .dll missing or a sp missing but I couldn't find any such file on the CD.
Does anyone know why the Extended Stored Procedure API (formerly Open Data Services) headers and libraries (e.g. srv.h, srvdbtyp.h, opends60.lib) are not in the new Platform SDK? Older versions of the Platform SDK had these tools included, but I installed the new Platform SDK and they're not included. Is there another SDK that I need to download and install now?
Hi allIve got a problem I was hoping someone may be able to help with.Im calling an extended stored procedure provided by a third party(master..xp_OrderHeader).This xp requires 3 inputs and is supposed to provie one output.When I call it in SQL Query Analyser all runs OK and I get a column result(single result) titled "Output_Info" with a value of say 300051Here is an example callexecute master..xp_OrderHeader @CustID, @TodayDate, @OrderID,@Output_Info OUTPUTI would have thought that my variable @Output_Info would hold the output,but all I get is NULL?Any ideas what Im doing wrong. Seems bizarre that the XP Ive been providedis displaying a result (be it a coumn I haven't named) ... but I can get itinto my variable for use.CheersCraig
I am using vs2005, vc++, sql2005 and trying to write a complex extended stored procedure.
It seems I must use switch clrafe for my executable to deploy to sql.
But with clrafe, I can no longer use such c code tools such as typedef structures and pointer manipulation!
But I need to do these things to translate a contiuous block of binary data into a series of field/value pairs to be written to the sql server!!! Doing so externally would mean a severe drop in throughput: going back to the server for each field instead of all as one block!
Is there a technique, or pragma command to allow "unmanaged" c code to reside in a sql extended stored procedure?
NULL, 0, 0, "This is how easy XP's can be!", SRV_NULLTERM);
srv_senddone(srvproc, SRV_DONE_MORE, 0, 0);
return(XP_NOERROR);
}
When I register the DLL in SQL server 2005 and execute it. I get the following error message
Msg 17750, Level 16, State 0, Procedure xp_Easy, Line 1
Could not load the DLL C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLBinnCPPDLL.dll, or one of the DLLs it references. Reason: 14001(This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.).
Hi I have a stored procedure in SQL server 2005. It works fine when I execute it from the Management Studio.But when executing it from ASP.NET code like this: ..... Of course more code is executed before this call .....int retVal = this.odbcCreateDataBaseCommand.ExecuteNonQuery(); retVal is -1. But -1 doesn't really tell me what the problem is? Is there anyway to get extended error information so I can figure out whats going wrong? (The stored procedure was working fine in SQL server 2000 before I upgraded to SQL server 2005. I use .NET Framework 1.1 and ODBC Sql Native Client to access the 2005 server.) Regards Tomas
I am logging into a SQL instance to run the following query:
DECLARE @ReturnCode int EXECUTE @ReturnCode = [master].dbo.xp_create_subdir N'sharemasterFULL' IF @ReturnCode <> 0 RAISERROR('Error creating directory.', 16, 1)
The share in which the folder is to be created has my account added with full permissions to create files. However this command fails unless I add the SQL Service account user with rights to the folder also.
Is this expected behaviour, is this something specific to extended stored procedures?
We have an application that is based on several extended storedprocedures. When we run our application in house, or when most othercustomers run it, they see performance of about X transactions persecond. One customer is seeing performance of about X/5, and I'mhaving a hard time troubleshooting it. The performace bottleneck hasbeen narrowed to the execution of the extended stored procedures. Doesanyone know of tuneable SQL Server parameters that may specificallyaffect the performance of extended stored procedures. I know theprocedures get run by a scheduler. Is there some way the priority orfrequency of the scheduler can be modified? Thanks for any advice.
Hi,First I would like to apologize for cross posting in three groups asI did not know which one would be the appropriate group. If some onepoints me to the correct one I will use that in the future.I am trying to findout the scalabilty of an user written extendedstore procedure. I have created a dll using a C program(modified/plagarized from some of the examples) . The main function ofthis extended SP is to act as a passthru to connect to an third partyODBC driver. All this is supposed to do is take the passthru sqlstatement, userid, passsword and connect to a remote server (IBM 3090Mainframe in our case) using a system ODBC connection and pass thereturned result set back to the stored procedure calling this extendedSP. I am trying to find out the answers for the following questions.1. What are the limitations of this approach.2. What would happen say if 2,000 concurrent calls per minute are madeto the extended SP from the web app.3. What would happen if this continued for say 4 hours. Will the memoryusage increase to point that will cripple the server assuming there isno memory leak in the dll.4. Are there any connection pooling concerns that I should payattention to specifically from an Extended SP point of view.5. Apart from compiling the dll using the "MultiThread" option should Ibe using other options to make sure the dll is threadsafe.SQL server Environment :OS - Windows 2000 Advanced Server SP4SQL - SQLServer 2000 Enterprise edition SP3Hardware - 8 way 2 node cluster with 6Gb RAMAny help regarding this is greately appreciated.Prahalad
Is there any way that I can create a dll file for Extended stored procedure(SQL server) in C# ?
I an able to create that in VC++. in VC++ there is DLLMain which serve as entry point and a paramter can be passed to it using Extended stored procedure. But since C# does not have any such entry point. Hence is there any way that I can achieve this?
I am setting up a transactional replication between two MSSBS2K servers, both running MSSQL2K. Both are on different domains, but are currently in the same network (until all data is replicated, then the subscribe will move to a remote site and pull changes periodically).
Everything is working on the publisher/distributor side, but when I attempt to subscribe to the distributor, I get the following message:
Error 14053: Cannot load the DLL replincrementlsn extended procedure, or one of the DLLs it references. Reason: 126(The specified module could not be found.). The subscription could not be updated at this time. The subscription could not be created.
Has anyone experienced this? I have scoured the Internet for this error, and have come up basically empty. All I found either suggest checking for the existence of the sp_replincrementlsn and sp_replincrementlsn_internal (both of which exist) or suggest an incomplete SP install. Neither of these is the case.
Personally, I tend to suspect a permissions issue when trying to launch the appropriate DLLs is generating this less-than-intuitive error message, but I cannot determine how to go about resolving this. I am using SQL authentication to connect, and both servers use local (to their domain) non-system accounts to log in. This works fine for launching queries across the servers. Could there be a deeper permissions issue at play here?
I'm at a dead end, and I need to get this issue resolved ASAP, as this server needs to be deployed yesterday. Any help you can provide will be most appreciated!
Hello all,I have spend quite some time now but don't manage tofind out how to have the srv_describe function workingproperly for target NUMERIC(x,x) and NUMERIC types.Already tried several alternatives like e.g.// ...PVOID pvdata1;strcpy((char*)pvdata1, "12345.6789");wsprintf(colname, "Score");srv_describe(srvproc, 1 /* column #1 */, colname /* column name */, SRV_NULLTERM /* column name ending */, SRVNUMERIC, (DBINT)sizeof(DBNUMERIC), SRVNUMERIC, (DBINT)sizeof(DBNUMERIC), pvdata1);srv_setcoldata(srvproc, 1, pvdata1);srv_setcollen (srvproc, 1, strlen((char*)pvdata1));// ...but obviously does not work, I get an empty resultset.I could only manage by converting the numeric valueto string from C and then sending only strings but theSQL side expects actually a number(x,x) and is a customer, in which case, I would never propose to be casting thething from TSQL.Any ideas how to do it? The documentation and examples isquite limited in this area.Thanks in advance,Best Regards,Giovanni
We have a secuiry review and they have recommended dropping several xp_ stored procedures. I have tried the drop procedure with no luck, Error 3701, or right click delete in Man Studio, same error. I have granted the user alter permission to the master database and when I try to delete get Error 4606. I try to grant CONTROL permission of the stored proc to the user and get another 4606 error.
Do I just have to control the permissions of these procedures tightly?
web searches give no end of how extended stored procedures can only be written in C++ ( or maybe vb also) .
And that extended stored procedures should be abandonded in favour of CLR framework procedures.
And how most articles explain how to convert ESPs to CLR procedures!!!!!
But I need to pass a non-discript block of binary data, extract pieces of data identified by its offset into the block, data type inferred by offset; into data to be written to the SQL database. These offsets are determinede by mapping (C UNION) to C typedef structures.
This cannot be done by managed code, therefore cannot be done by C++ CLR.
It is also ill suited for C# .
Sounds like a job for C++ extended stored procedure.
But how does one create and deploy an ESP with Visual Studio 2005? All wizards seem to insist on CLR.
I have created an extended stored procedure (that executes a DLL file) in SQL Server 2005 Express. When I execute this procedure the execution enters an infinite loop and hangs there. When I execute the same procedure on SQL Server 2000 it executes correctly. I wonder if the problem relates to SQL Server 2005, since no problem occurs with SQL Sever 2000. And if so, how could I repair it?