?
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
Medium Priority
?
265 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 3

Accepted Solution

by:
john M earned 2000 total points
ID: 37839890
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

How Blockchain Is Impacting Every Industry

Blockchain expert Alex Tapscott talks to Acronis VP Frank Jablonski about this revolutionary technology and how it's making inroads into other industries and facets of everyday life.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Welcome to my series of short tips on migrations. Whilst based on Microsoft migrations the same principles can be applied to any type of migration. My first tip Migration Tip #1 – Source Server Health can be found here: http://www.experts-exchang…
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…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

801 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