Saturday, February 25, 2012
[howto] write a function that process row collection
help please!!!SQL Server doesn't extend that level of functionality to end users yet.
-PatP|||thank you.
another question:
is it avaliable in the most recent sql server version(v2005)?|||I can't answer that question. Sorry.
-PatP|||thanks
i found something here
http://msdn.microsoft.com/data/sqlsolutions/sql2005/default.aspx?pull=/library/en-us/dnsql90/html/sql_ovyukonnetprogfeatures.asp|||looks great
==========================================
using System.Data.SqlServer;
using System.Data.Sql;
public class T {
[SqlFunc]
[SqlFunction(DataAccess = DataAccessKind.Read)]
public static int ReturnOrderCount()
{
SqlCommand sqlComm = SqlContext.GetCommand();
sqlComm.CommandText = "SELECT COUNT(*) AS 'Order Count' FROM SalesOrderHeader";
return (int) sqlComm.ExecuteScalar();
}
}
------------------------
Using System.Data.Sql;
Using System.Data.SqlServer;
Class T {
[SqlProcedure]
public static void HelloWorld()
{
SqlPipe sp = SqlContext.GetPipe();
sp.Send("Hello world! It's now " + System.DateTime.Now.ToString()+"\n");
SqlCommand cmd = SqlContext.GetCommand()
cmd.CommandText = ??SELECT ProductNumber FROM ProductMaster??
SqlDataReader rdr = cmd.ExecuteReader();
Sp.Send(rdr);
}
}
Friday, February 24, 2012
[Fwd: Tryiing to write to excel destination]
besides microsoft.public.sqlserver.programming.
I assume you don't expect an answer, as nobody is going to open an
attachment and the post has no details.
"doofy" <nope@.notme.com> wrote in message
news:468d6513$0$27172$742ec2ed@.news.sonic.net...
> Ok, I'm desperate so I"m forwarding this to a couple of other groups
> besides microsoft.public.sqlserver.programming.
>
Thursday, February 16, 2012
[DBNETLIB] 2147467259(80004005) [Connection Write (Send()),] General Network Error
HI all
I am facing a problem on sql server 7 Desktop Engine with front end VB6 and ADO 2.8 my OS is windows 2000 Professional.
ie. I am doing appendchunk to add image files on SQL Table it works fine for Approximately 130 MB, But i am trying to add 249 MB size file it will be showing these error Message.
[DBNETLIB] 2147467259(80004005) [Connection write(send()),] General Network Error check your network documentation.
I do so many way to correct this problem but it stuck up overthere.
In vb appendchunk is completed and the error when Updated command starts (update command also going a long way then show the above mentioned error.
Any body have any idea or clue just tel me for experiment. and complete my project.
Once again I request you please help me.
Thanks in advance.
Note : it is working with Access Database very fine I am tested it But in Access not allow me to store me lots of images its only allow 2 GB storage totally in a table.
Error code 0x80004005 is a generic error that indicates something failed. Either the client or server broke the connection.
Two things you should try:
1. Attach SQL Profiler to trace the execution to determine if it is the client or server that is terminating the connection.
2. Check the ERRORLOG if there are any problems with the server.
Saturday, February 11, 2012
@return_status from SQLCLR stored procedure
s
to 0 or 1 depending on whether the CLR was successful or not. How do I do
that? Basically I want to use the following T-SQL code to call my CLR and
set the @.return_status
declare @.return_status int
EXEC @.return_status=My_CLR_SP
select @.return_statusI would like to know how to do this as well. Can anyone help us?
Greg Larsen wrote:
> I'm trying to write a VB CLR stored procedure that will set the return sta
tus
> to 0 or 1 depending on whether the CLR was successful or not. How do I do
> that? Basically I want to use the following T-SQL code to call my CLR and
> set the @.return_status
> declare @.return_status int
> EXEC @.return_status=My_CLR_SP
> select @.return_status|||Greg,
I found this at http://msdn2.microsoft.com/en-us/library/ms131094.aspx.
I tried it out and it works great.
Here is a really simple example:
<Microsoft.SqlServer.Server.SqlProcedure()> _
Public Shared Function TestProc() As Int32
TestProc = 1
End Function
And the test script:
DECLARE @.result AS int
EXEC @.result = TestProc
PRINT @.result
Tom
Greg Larsen wrote:
> I'm trying to write a VB CLR stored procedure that will set the return sta
tus
> to 0 or 1 depending on whether the CLR was successful or not. How do I do
> that? Basically I want to use the following T-SQL code to call my CLR and
> set the @.return_status
> declare @.return_status int
> EXEC @.return_status=My_CLR_SP
> select @.return_status|||Thank you for the VB example.
I got mine to working by writing it in C # and doing the following:
[Microsoft.SqlServer.Server.SqlProcedure]
public static int TestProc()
{ return=1;}|||You're welcome. Thanks for posting the C# example.
Tom
Greg Larsen wrote:
> Thank you for the VB example.
> I got mine to working by writing it in C # and doing the following:
> [Microsoft.SqlServer.Server.SqlProcedure]
> public static int TestProc()
> { return=1;}