question

Gogolo avatar image
Gogolo asked

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
sql-server-2008stored-procedures
2 comments
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

You really need to include the actual error here...
2 Likes 2 ·
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
0 Likes 0 ·

1 Answer

· Write an Answer
Håkan Winther avatar image
Håkan Winther answered
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)
3 comments
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

@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.
2 Likes 2 ·
@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.
1 Like 1 ·
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
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.