calling C# code from SQL Server procedure.
-
Hi From SQL procedure, I need to call a .NET function (which is part of .NET assembly and loaded in SQL Server 2005). 1. What is the maximum length of STRING which can be passed as parameter? 2. I only saw the samples of basic types (like int, string) but can we pass XML datatype or other complex custom objects? Please advise. Thanks Pankaj
-
Hi From SQL procedure, I need to call a .NET function (which is part of .NET assembly and loaded in SQL Server 2005). 1. What is the maximum length of STRING which can be passed as parameter? 2. I only saw the samples of basic types (like int, string) but can we pass XML datatype or other complex custom objects? Please advise. Thanks Pankaj
pankazmittal wrote:
1. What is the maximum length of STRING which can be passed as parameter?
I wouldn't expect there to be a max. There is no limit on the size a string can be apart from the physical limit of how much memory you have available.
pankazmittal wrote:
2. I only saw the samples of basic types (like int, string) but can we pass XML datatype or other complex custom objects?
Don't see any reason why not. Give it a try. Let me know what happens.
Simon
-
Hi From SQL procedure, I need to call a .NET function (which is part of .NET assembly and loaded in SQL Server 2005). 1. What is the maximum length of STRING which can be passed as parameter? 2. I only saw the samples of basic types (like int, string) but can we pass XML datatype or other complex custom objects? Please advise. Thanks Pankaj
pankazmittal wrote:
1. What is the maximum length of STRING which can be passed as parameter?
I don't know exactly, but it would be something like 2 or 4 million characters. If you have a 32 bit operating system, the limit would be that no process can use more than 4 GiB of memory.
pankazmittal wrote:
2. I only saw the samples of basic types (like int, string) but can we pass XML datatype or other complex custom objects?
I don't see how you could create any object like than in T-SQL?
Despite everything, the person most likely to be fooling you next is yourself.
-
Hi From SQL procedure, I need to call a .NET function (which is part of .NET assembly and loaded in SQL Server 2005). 1. What is the maximum length of STRING which can be passed as parameter? 2. I only saw the samples of basic types (like int, string) but can we pass XML datatype or other complex custom objects? Please advise. Thanks Pankaj
Yes we can what you need to do is to add your assembly under the database programmability folder in assemblies and then call it in your query.