x

Strange problem in Stored Procedure

Below you will find declared stored procedure, which works very well in my PC. I tried to create same procedure at the client DB, but shows me an error where data type is incorrect.

    ALTER PROCEDURE [dbo].[spReturnGrid]
    @GridView GridViews READONLY
    AS
    SELECT * FROM   @GridView
Please advice what is wrong in this procedure and how to correct this SP. Thank you all in avdvance
more ▼

asked Jan 20, 2011 at 11:56 PM in Default

Gogolo gravatar image

Gogolo
323 23 26 27

You really need to include the actual error here...
Jan 21, 2011 at 12:04 AM Matt Whitfield ♦♦
I selected all objects in DB and I got this result: TT_GridViews_7F60ED59 2137058649 TT 4 0 0 0 0 0 2010-11-10 10:24:30.933 0 0 0 TT 0 0 0 2010-11-10 10:24:30.933 0 0 0 0 0 2 0
Jan 21, 2011 at 12:13 AM Gogolo
(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first
From what I understand, GridView is a user defined Table Type. Make sure you you created the table type in the client database before trying to Create the procedure. (BTW, the code you posted is trying to ALTER an existing procedure, not CREATE a new procedure)
more ▼

answered Jan 21, 2011 at 12:03 AM

Håkan Winther gravatar image

Håkan Winther
15.9k 35 37 48

Thank you, you opened my eyes.. it was a user definition tbl, which I forgot to create at client. Thank you very much for your quick response Gogolo. (BTW, the code you posted is trying to ALTER an existing procedure, not CREATE a new procedure) This is obvious.. Thank you
Jan 21, 2011 at 12:18 AM Gogolo
@Gogolo - it may be obvious, but sometimes you can't see the wood for the trees. As such, it was a good addition to Hakan's answer.
Jan 21, 2011 at 12:25 AM WilliamD
@Gogolo - As WilliamD says, it may be obvious. But then, to me it's obvious that if you want to use a user-defined table type then you need to define it.
Jan 21, 2011 at 01:53 AM Matt Whitfield ♦♦
(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:

x1853
x415

asked: Jan 20, 2011 at 11:56 PM

Seen: 656 times

Last Updated: Jan 21, 2011 at 12:04 AM