SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Create Views issue


Create Views issue

Author
Message
psred
psred
SSC-Enthusiastic
SSC-Enthusiastic (155 reputation)SSC-Enthusiastic (155 reputation)SSC-Enthusiastic (155 reputation)SSC-Enthusiastic (155 reputation)SSC-Enthusiastic (155 reputation)SSC-Enthusiastic (155 reputation)SSC-Enthusiastic (155 reputation)SSC-Enthusiastic (155 reputation)

Group: General Forum Members
Points: 155 Visits: 583
The user account has dbo permissions on the database but couldnt create the views not sure what is the issue. Need help.
Steve Jones
Steve Jones
SSC Guru
SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)

Group: Administrators
Points: 63452 Visits: 19115
You should post some DDL code and the error.

If you can script the user, do that and show that as well. Hard to know what might be wrong from your post.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
psred
psred
SSC-Enthusiastic
SSC-Enthusiastic (155 reputation)SSC-Enthusiastic (155 reputation)SSC-Enthusiastic (155 reputation)SSC-Enthusiastic (155 reputation)SSC-Enthusiastic (155 reputation)SSC-Enthusiastic (155 reputation)SSC-Enthusiastic (155 reputation)SSC-Enthusiastic (155 reputation)

Group: General Forum Members
Points: 155 Visits: 583
CREATE VIEW permission denied in database 'medical'
Steve Jones
Steve Jones
SSC Guru
SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)

Group: Administrators
Points: 63452 Visits: 19115
Again, it seems like you don't really want help. Is this an error message, is this the command you ran?

Stop, imagine we have no idea of your environment. list the code you ran, format it as code and tell us this is the code I ran. Then give us the error message, set apart and noted as such.

If you don't put some effort into explaining what you did, we can't, and don't want, to help.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
psred
psred
SSC-Enthusiastic
SSC-Enthusiastic (155 reputation)SSC-Enthusiastic (155 reputation)SSC-Enthusiastic (155 reputation)SSC-Enthusiastic (155 reputation)SSC-Enthusiastic (155 reputation)SSC-Enthusiastic (155 reputation)SSC-Enthusiastic (155 reputation)SSC-Enthusiastic (155 reputation)

Group: General Forum Members
Points: 155 Visits: 583
Create View as
SELECT dbo.CLBALANCN.COMPANY, dbo.CLBALANCN.ACCOUNT, dbo.CLBALANCN.INCIDENTNO, dbo.CLINS.PLANTYPE AS insurance1FinancialClass,
CLINS_1.PLANTYPE AS insurance2FinancialClass, '' AS insurance3FinancialClass, CASE WHEN CLINS.PLANTYPE IS NOT NULL
THEN CLINS.PLANTYPE ELSE CLINS_1.PLANTYPE END AS currentFinancialClass, SUM(COALESCE (dbo.CLBALANCN.YTDCHARGES, 0))
AS totalCharges, SUM(COALESCE (dbo.CLBALANCN.BALEND, 0)) AS accountBalance, SUM(COALESCE (dbo.CLBALANCN.YTDPAYINS, 0))
+ SUM(COALESCE (dbo.CLBALANCN.YTDPAYINS2, 0)) + SUM(COALESCE (dbo.CLBALANCN.YTDPAYINS3, 0))
+ SUM(COALESCE (dbo.CLBALANCN.YTDPAYGUAR, 0)) AS totalPayments, SUM(COALESCE (dbo.CLBALANCN.YTDCHARGES, 0))
- SUM(COALESCE (dbo.CLBALANCN.YTDALLOWED, 0)) AS initialPatientResponsibility, SUM(COALESCE (dbo.CLBALANCN.GUARDUE, 0))
AS outstandingPatientBalance, SUM(COALESCE (dbo.CLBALANCN.YTDPAYINS, 0)) + SUM(COALESCE (dbo.CLBALANCN.YTDPAYINS2, 0))
+ SUM(COALESCE (dbo.CLBALANCN.YTDPAYINS3, 0)) AS insurancePayments, SUM(COALESCE (dbo.CLBALANCN.YTDPAYINS, 0))
AS insurance1Payments, SUM(COALESCE (dbo.CLBALANCN.YTDPAYINS2, 0)) AS insurance2Payments,
SUM(COALESCE (dbo.CLBALANCN.YTDPAYINS3, 0)) AS insurance3Payments, SUM(COALESCE (dbo.CLBALANCN.INS1DUE, 0))
+ SUM(COALESCE (dbo.CLBALANCN.INS2DUE, 0)) AS insuranceOutstandingBalance, SUM(COALESCE (dbo.CLBALANCN.INS1DUE, 0))
AS insurance1OutstandingBalance, SUM(COALESCE (dbo.CLBALANCN.INS2DUE, 0)) AS insurance2OutstandingBalance,
'0.0000' AS insurance3OutstandingBalance, SUM(COALESCE (dbo.CLBALANCN.YTDPAYGUAR, 0)) AS patientPayments,
CASE WHEN CLINS.PLANTYPE IS NOT NULL THEN CLINS.NAME ELSE CLINS_1.NAME END AS payer
FROM dbo.CLBALANCN INNER JOIN
dbo.CLINS ON dbo.CLBALANCN.COMPANY = dbo.CLINS.COMPANY AND dbo.CLBALANCN.INS1CODE = dbo.CLINS.CODE INNER JOIN
dbo.CLINS AS CLINS_1 ON dbo.CLBALANCN.COMPANY = CLINS_1.COMPANY AND dbo.CLBALANCN.INS2CODE = CLINS_1.CODE
GROUP BY dbo.CLBALANCN.ACCOUNT, dbo.CLBALANCN.INCIDENTNO, dbo.CLBALANCN.COMPANY, dbo.CLINS.PLANTYPE, CLINS_1.PLANTYPE,
CASE WHEN CLINS.PLANTYPE IS NOT NULL THEN CLINS.NAME ELSE CLINS_1.NAME END
HAVING (dbo.CLBALANCN.COMPANY = 'Main')




The user has database owner permissions. So when the user run above stmt on the database he is getting popup saying 'CREATE VIEW permission denied in database 'medical'
Steve Jones
Steve Jones
SSC Guru
SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)

Group: Administrators
Points: 63452 Visits: 19115
The user then has deny permission on the CREATE VIEW permission.

Script out the user and look at their permissions.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search