x

Using SSMS to Reproduce RPC Events?

Is it possible to use SSMS to send a procedure call as an RPC event rather than a SQL batch?

I have tried {call 'dbo.sp01'} which this article indicates used to work in Query Analyser but that doesn't appear to do do the trick any more and just gives the message "Incorrect syntax near '{'."

more ▼

asked Jun 12, 2011 at 09:05 AM in Default

avatar image

Martin 1
203 8 11 16

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

The CALL statement can be used for executing stored proc using the ODBC driver for SQL Server. See How to: Call Stored Procedures (ODBC). So to use the Call Syntax you need to connect to the SQL Server using an ODBC Driver.

You can simulate this in SSMS by registering a System ODBC DSN to your server. Then you can create a linked server using an OLEDB provider for ODBC Drivers and use the OPENQUERY to execute the stored procedure using the CALL statement

more ▼

answered Jun 12, 2011 at 09:53 AM

avatar image

Pavel Pawlowski
22.7k 10 15 26

OK Thanks. I know that SSMS does support the similar syntax for datetime literals though (e.g. select {d '2011-01-01'}) Any idea why that works then?

Jun 12, 2011 at 10:10 AM Martin 1

As you can find in books online on MSDN datetime (Transact-SQL).

There is a part related to ODBC:

The ODBC API defines escape sequences to represent date and time values, which ODBC calls timestamp data. This ODBC timestamp format is also supported by the OLE DB language definition (DBGUID-SQL) supported by the Microsoft OLE DB provider for SQL Server. Applications that use the ADO, OLE DB, and ODBC-based APIs can use this ODBC timestamp format to represent dates and times.

So this concrete ODBC functionality is also supported by the OLEDB and therefore you can use it directly in SSMS.

Jun 12, 2011 at 11:08 AM Pavel Pawlowski
(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x2175
x159

asked: Jun 12, 2011 at 09:05 AM

Seen: 2146 times

Last Updated: Jun 12, 2011 at 09:05 AM

Copyright 2017 Redgate Software. Privacy Policy