473,425 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,425 software developers and data experts.

Call a procedure

Hello,
Slowly with me plz; I'm new to T-SQL :)
I hope someone can help with this. I created a stored procedure that is meant to generate a table, but when I call it (EXEC procedure_name) nothing happens (i.e.: checked to see if the table was created but couldn't find any).

- The SQL statements in the procedure seem OK (no error messages)
- The procedure doesn't take any parameters

Did I call the procedure correctly?

Zied
Jul 13 '10 #1
5 1729
It looks like there is an error in t-sql syntax...
Can anyone see an error here please:

IF EXISTS (SELECT name
FROM sysobjects
WHERE name = N'CreateTransitiveClosure'
AND type = 'P')
DROP PROCEDURE CreateTransitiveClosure

GO
CREATE PROCEDURE CreateTransitiveClosure

AS

declare @sql varchar(1000)

select @sql='insert into tClosure SELECT CONCEPTID1, CONCEPTID2, 1 AS steps FROM Relationships where RELATIONSHIPTYPE=3'
execute (@sql)

GO

EXECUTE CreateTransitiveClosure
GO
Jul 13 '10 #2
code green
1,726 Expert 1GB
Looks like this is wrong
Expand|Select|Wrap|Line Numbers
  1. WHERE name = N'CreateTransitiveClosure' 
Can't have N their
Jul 14 '10 #3
Actually, it does not appear to be wrong. The Store procedure was indeed created and saved. If I run the script again it does not tell me that the procedure already exists so the problem shouldn't be there. Any help?
Jul 14 '10 #4
ck9663
2,878 Expert 2GB
Your sample did not generate a table, the table is already existing. If the table is not existing, your SP would return an error. Check which database you created your SP and which database you created your table. If all is working well, that means there are no relationshiptype = '3' on your Relationships table.

Good Luck!!!

~~ CK
Jul 14 '10 #5
I feel stupid :) Thx kindly, ck9663, you hit the nail right on the head! Need to create the table first. Cheers, Z
Jul 16 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: serge | last post by:
I am a little confused. If i have an SP like: CREATE PROCEDURE ABC (IN ID Integer, OUT TEST1 Integer, OUT TEST2 Integer) .... How do you call this SP? CALL ABC(varID, varTEST1, varTEST2);
13
by: Marcin Wasilewski | last post by:
Hi, How to call procedure, which is on SQL Server from Access using visual basic? Thanks, mw
3
by: Marcin Wasilewski | last post by:
Hi, I have a problem with calling procedure with parametrs. After run this code: .... Set strCommand = New ADODB.Command strCommand.ActiveConnection = cnn strCommand.CommandText =...
1
by: simonZ | last post by:
How can I call sub from aspx page? If I have on aspx page grid view and I call procedure from item Template: <asp:GridView ... .... <ItemTemplate> <%# test()%> and in code behind:...
5
by: wpellett | last post by:
I can not get the SQL compiler to rewrite my SQL UPDATE statement to include columns being SET in a Stored Procedure being called from a BEFORE UPDATE trigger. Example: create table...
4
by: clamps | last post by:
I've been doing different sqls for a while but I'm a super n00b to access. Is there a way to call a procedure/function when a change in a 'cell' from the table view occurs? Thanks for the help...
1
by: rick | last post by:
Hi I m facing a weird problem when i m executing a procedure with different IDs, The procedure has a select statement , and a codition. when the conditon is met an update statement is ran to...
1
by: csharpula csharp | last post by:
Hello, I would like to know how can I call to some procedure once in X time which will be designed by user? Is there some kind of scheduler or timer for this purpose? Which code do I need for...
0
by: susan | last post by:
Hi, I'm using Accrss 2003. I try to build a GUI using the Webpage-option in Access. Now I want to call a procedure by placing a CommandButton on the webpage. Doing so I find the following in thr...
3
by: chirag1989 | last post by:
hi i have some textboxes in my form wat i want to do is wheever the user clicks the button the data in text boxes must be stored in database i have written my insert query like this ...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.