Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
SQL Server is ASP Classic ?
Old 05-15-2008, 07:55 PM SQL Server is ASP Classic ?
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
http://msdn.microsoft.com/en-us/library/ms189763.aspx

That could just as well be describing Server.CreateObject. What this means is that you could create a VB 6 component, and use it from within SQL Server. You can write VB 5 sprocs! Maybe this .NET stuff isn't so terribly new as they make it sound?

I know about extended procedures, but I stopped using C++ almost 2 decades ago! I've been using a little bit of SQL CLR, but sparingly. It's only just today that I learned you can use COM and OLE Automation, from your T-SQL code.

Heck, here's a Microsoft code sample that lets you poke around inside your database, while at the same time pretending it's not a database at all!

-- Get the AdventureWorks Person.Address Table object.
EXEC @hr = sp_OAGetProperty @object,
'Databases("AdventureWorks").Tables("Person.Addres s")',
@table OUT

-- Get the Rows property of the AdventureWorks Person.Address table.
EXEC @hr = sp_OAGetProperty @object,
'Databases("AdventureWorks").Tables("Person.Addres s").Rows',
@rows OUT

-- Call the CheckTable method to validate the
-- AdventureWorks Person.Address table.
EXEC @hr = sp_OAMethod @object,
'Databases("AdventureWorks").Tables("Person.Addres s").CheckTable',
@checkoutput OUTWe can tell what's going on, right? We're fetching property values, and invoking a method. I'm sure Tables(X).CheckTable translates to a DBCC call under the sheets.

But that needs an object reference. Which translates to Server.CreateObject - here's another Microsoft sample for how to do that, even if you don't know the friendly string name for what you want

DECLARE @object int;
DECLARE @hr int;
DECLARE @src varchar(255), @desc varchar(255
EXEC @hr = sp_OACreate '{00026BA1-0000-0000-C000-000000000046}',
@object OUT;
IF @hr <> 0
BEGIN
EXEC sp_OAGetErrorInfo @object, @src OUT, @desc OUT
raiserror('Error Creating COM Component 0x%x, %s, %s',16,1, @hr, @src, @desc)
RETURN
END;
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-16-2008, 01:46 AM Re: SQL Server is ASP Classic ?
tamar's Avatar
Webmaster Talker

Posts: 507
Name: Tamar Weinberg
Location: New York
Trades: 0
I wanted to respond and say something useful since you had a number of views and no responses thus far, but all of that went over my head
__________________

Please login or register to view this content. Registration is FREE
tamar is offline
Reply With Quote
View Public Profile Visit tamar's homepage!
 
Reply     « Reply to SQL Server is ASP Classic ?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.09987 seconds with 12 queries