Solved

I execute a stored procedure in Microsoft SQL Server Management Studio 2005 and I don't know why the table doesn't get created?

Posted on 2012-04-12
1
257 Views
Last Modified: 2012-04-16
I execute the following stored procedure in Microsoft SQL Server 2005.

I don't know why the table doesn't get created.

I use 'dbo' as the owner for the stored procedure and "empdwmsq" as the owner for the tables.
-------------------------------------------------------------
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go

CREATE procedure [dbo].[sp_action_group]
As

If  Exists(SELECT * FROM dbo.SYSOBJECTS WHERE NAME = 'tblAction_Grp' AND TYPE = 'U')
DROP TABLE empdwmsq.tblAction_Grp

create table empdwmsq.tblAction_Grp
(PRINCIPAL_GROUP_TYPE varchar(255),
 PRINCIPAL_GROUP_VALUE varchar(255),
 ELEMENT_TYPE_VALUE_PAIRS varchar(255)
)

insert into empdwmsq.tblAction_Grp (PRINCIPAL_GROUP_TYPE,PRINCIPAL_GROUP_VALUE,ELEMENT_TYPE_VALUE_PAIRS)
values ('RIGHTS', 'Everything', NULL);
insert into empdwmsq.tblAction_Grp (PRINCIPAL_GROUP_TYPE,PRINCIPAL_GROUP_VALUE,ELEMENT_TYPE_VALUE_PAIRS)
values ('RIGHTS', 'Security Administrator', NULL);
insert into empdwmsq.tblAction_Grp (PRINCIPAL_GROUP_TYPE,PRINCIPAL_GROUP_VALUE,ELEMENT_TYPE_VALUE_PAIRS)
values ('RIGHTS', 'User', NULL);
insert into empdwmsq.tblAction_Grp (PRINCIPAL_GROUP_TYPE,PRINCIPAL_GROUP_VALUE,ELEMENT_TYPE_VALUE_PAIRS)
values ('RIGHTS', 'View', NULL);
0
Comment
Question by:zimmer9
1 Comment
 
LVL 3

Accepted Solution

by:
john M earned 500 total points
Comment Utility
i think it  cause you only created it and not ran it

CREATE procedure [dbo].[sp_action_group]
create the proc

alter procedure [dbo].[sp_action_group]
will run the proc
0

Featured Post

Why do Marketing keep bothering you?

Is your marketing department constantly asking for new email signature updates? Are they requesting a different design for every department? Do they need yet another banner added? Don’t let it get you down! There is an easy way to manage all of these requests...

Join & Write a Comment

My previous article  (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Server/Windows_Server_2008/A_4466-A-beginners-guide-to-installing-SCCM2007-on-Windows-2008-R2-Server.html)detailed one possible method to get SCCM 2007 installed an…
Remote Apps is a feature in server 2008 which allows users to run applications off Remote Desktop Servers without having to log into them to run the applications.  The user can either have a desktop shortcut installed or go through the web portal to…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now