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
262 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 500 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

Increase Agility with Enabled Toolchains

Connect your existing build, deployment, management, monitoring, and collaboration platforms. From Puppet to Chef, HipChat to Slack, ServiceNow to JIRA, Splunk to New Relic and beyond, hand off data between systems to engage the right people.

Connect with xMatters.

Question has a verified solution.

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

Case Summary: In this Article we introduce the new method to configure the default user profile using Automated profile copy with sysprep rather than the old ways such as the manual copy of a configured profile to default user profile Old meth…
Every system administrator encounters once in while in a problem where the solution seems to be a needle in haystack.  My needle was an anti-virus version causing problems with my Exchange server. I have an HP DL350 with Windows Server 2008 Stand…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

691 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