Showing posts with label adding. Show all posts
Showing posts with label adding. Show all posts

Friday, March 23, 2012

Extending SQL Server Management Studio

I am wondering if it is possible to extend the Sql Server Management Studio
user interface by adding plugins. Similar to the way plugins can be
generated for Visual Studio 2005.Not yet--it's something they are talking about adding to a future release.
Adam Machanic
Pro SQL Server 2005, available now
http://www.apress.com/book/bookDisplay.html?bID=457
--
"Andy S" <AndyS@.discussions.microsoft.com> wrote in message
news:1FFA776D-388F-413E-81C4-B2AA996FD572@.microsoft.com...
>I am wondering if it is possible to extend the Sql Server Management Studio
> user interface by adding plugins. Similar to the way plugins can be
> generated for Visual Studio 2005.
>|||That's what I feared, thanks!
"Adam Machanic" wrote:

> Not yet--it's something they are talking about adding to a future release.
>
> --
> Adam Machanic
> Pro SQL Server 2005, available now
> http://www.apress.com/book/bookDisplay.html?bID=457
> --
>
> "Andy S" <AndyS@.discussions.microsoft.com> wrote in message
> news:1FFA776D-388F-413E-81C4-B2AA996FD572@.microsoft.com...
>
>

Monday, March 19, 2012

Extended Stored Procedure

Hi all,
I'd like some advice on adding an extended stored procedure (XP). I found an article which advises "put the call of the extended prodecure within a database procedure in the database from which it will be called".
http://www.windowsitlibrary.com/Content/77/20/1.html#1
This sounds like what I want to do, where can I find details on "how to" do this, including granting rights to execute the SP, XP?
Running Windows 2000 Server, MS SQL Server 2000.

All comments appreciated.
KK1.
http://www.codeproject.com/database/extended_sp.asp

2.
Creating Extended Stored Procedures
An extended stored procedure is a function with a prototype:

SRVRETCODE xp_extendedProcName (SRVPROC *);

Using the prefix "xp_" is optional. Extended stored procedure names are case sensitive when referenced in Transact-SQL statements, regardless of code page/sort order installed on the server. An extended stored procedure is implemented in a 32-bit dynamic-linked library (DLL). When you build a DLL:

If an entry point is necessary, write a DllMain function.
This function is optional; if you do not provide it in source code, the compiler links its own version, which does nothing but return TRUE. If you provide a DllMain function, the operating system calls this function when a thread or process attaches to or detaches from the DLL.

All functions called from outside the DLL (all extended stored procedure functions) must be exported.
You can export a function by listing its name in the EXPORTS section of a .def file, or you can prefix the function name in the source code with __declspec(dllexport), a Microsoft compiler extension (Note that __declspec() begins with two underscores).

These Open Data Services files are required for creating an extended stored procedure DLL.

File Description
Srv.h Open Data Services header file
Opends60.lib Import library for Opends60.dll

It is highly recommended that all Microsoft SQL Server 2000 extended stored procedure DLLs implement and export the following function:

__declspec(dllexport) ULONG __GetXpVersion()
{
return ODS_VERSION;
}

When SQL Server loads an extended stored procedure DLL, SQL Server checks for the above function.

Note __declspec(dllexport) is a Microsoft-specific compiler extension. If your compiler does not support this directive, you should export this function in your DEF file under the EXPORTS section.

When SQL Server is started with the trace flag -T260 or if a user with system administrator privileges runs DBCC TRACEON (260), then if the extended stored procedure DLL does not support __GetXpVersion(), a warning message (Error 8131: Extended stored procedure DLL '%' does not export __GetXpVersion().) is printed to the error log (Note that __GetXpVersion() begins with two underscores). If you get this message, and you are running an extended stored procedure DLL compiled with headers and libraries from SQL Server version 6.x, refer to Level 1: Handling Discontinued Functionality. If you get this message and are running an extended stored procedure DLL compiled with headers and libraries from SQL Server 7.0, your extended stored procedure DLL is not exporting the function __GetXpVersion().

If the extended stored procedure DLL exports __GetXpVersion(), but the version returned by the function is less than that required by the server, a warning message (Error 8132: Extended stored procedure DLL '%' reports its version is %d.%d. Server expects version %d.%d.) stating the version returned by the function and the version expected by the server is printed to the error log. If you get this message, you are returning an incorrect value from __GetXpVersion(), or you are compiling with an older version of srv.h.

Note SetErrorMode, a Microsoft Win32 function, should not be called in extended stored procedures.

For more information about creating a DLL, see the development environment documentation and the Microsoft Win32 SDK documentation.

To create an extended stored procedure DLL by using Microsoft Visual C++

1. Create a new project of type Win32 Dynamic Link Library.

2. Set the directory for include files and library files to C:\Program Files\Microsoft SQL Server\80\Tools\DevTools\Include and C:\Program Files\Microsoft SQL Server\80\Tools\DevTools\Lib, respectively.
On the Tools menu, click Options.

In the Options dialog box, click the Directories tab and set the directory for include files and library files.
On the Project menu, click Settings.

In the Project Settings dialog box, click the Link tab. Click the General category, and then add opends60.lib to object/library modules.

Add source files (.c, .cpp, and .rc files, and so on) to your project.

Compile and link your project.

Sunday, February 26, 2012

Express remote connection on a LAN help

I have recently installed SQL Server Express on a desktop machine for a program that we use. I am in need of adding additional machines to gain access to the server for the database. Right now, the program is working on the local machine fine. What do I need to do or enable for access on a local LAN? All machines are XP Pro on a workgroup. Also, the software we use has a remote connection manager that requires inputting the server address for the machine. Is it better to use the computer name or IP address, and then what is that format? SQL Instance name is 'uesafh' if that helps. Any other information that I can provide, please let me know.

Thanks!

"What do I need to do or enable for access on a local LAN?"

enable remote connections first, launch Sql Surface Area Config tool (comes with Express) and select the connections and services link. you will then see a Remote Connections setting, set it to enabled.

"Is it better to use the computer name or IP address, and then what is that format?"

either is fine, though I find the probabilty of renaming a server is higher than assigning it a new IP, so I generally will use IP.

TCP/IP protocol connection format: ServerName or IP[\NamedInstance][,Port# (defaults to 1433)]

if you intend on using tcp/ip just ensure it is enabled and part of the protocol rotation in Sql Config Mgr. (another tool that ships with Express)

|||Ok, thanks for the help so far.

So for the server name to connect to on the remote systems in the LAN, would the format be:

'\\192.168.0.30\uesafh' ? I had tried that before and it would connect, however the connection would drop after a couple of logins and then would not be restored by even rebooting when attempting to login.

The program we use allows for multiple users to log into it, using their own login for the program that is kept and verified in the db. Should I use a 'sa' login with a password as part of the remote connection instead of Windows Authentication?|||

192.168.0.30\uesafh (this is the correct format assuming its listening on 1433)

you should be able to use either but be aware that windows authentication is using your currently logged on account so you should be in the same domain/workgroup and have assigned access. If you are just testing it you may want to use sql authentication as opposed to windows, but i believe in sql 2005 sql authentication is also of by default.

|||Ok, thanks for the help so far. I have been reading however, that I need to install SQL express on each client computer? Is that right? Is there any necessary software installs that I need to make these connections work? I was wondering particularly about .NET 2.0, MSXML 6.0, or do I need anything to get the connection to work? I have also read that I needed to install the 213 m.b. SQL server express toolkit?

Thanks again for the help!|||

http://msdn.microsoft.com/vstudio/express/sql/download/

SQL Server Management Studio Express

SQL Server Management Studio Express is installed by running the setup program for either SQL Server Express with Advanced Services or SQL Server Express Toolkit. Before you install SQL Server Management Studio Express, you must install MSXML 6.0.

thats all you need