Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
viperbyte
Posting Yak Master
132 Posts |
Posted - 2010-04-09 : 19:53:41
|
| Hi everybody. There's a script that I have to use. But when I hover the mouse over the red squiggly underlined "[develop_develop]" the help note says "The schema [develop_develop] does not exist... I created the database named develop but I don't know how to do the schema part. Can someone please help me with this?GOIF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[develop_develop].[CMRC_Brand]') AND type in (N'U'))BEGINCREATE TABLE [develop_develop].[CMRC_Brand]( [BrandID] [int] NOT NULL, [BrandName] [nvarchar](50) NOT NULL, [BrandDescription] [nvarchar](250) NOT NULL, [SortOrder] [int] NOT NULL, [ButtonLink] [nvarchar](50) NOT NULL, [AltButtonLink] [nvarchar](50) NOT NULL, [Hide] [bit] NOT NULL) ON [PRIMARY]END |
|
|
dinakar
Master Smack Fu Yak Hacker
2507 Posts |
Posted - 2010-04-09 : 22:02:15
|
| If you dont know what a schema is then you probably are not using it and dont have the schema named develop_Develop. Just remove that part and put dbo.[CMRC_Brand].The 4 part convention is Servername.Databasename.Schema.Object. So when you write CREATE TABLE [A].[B], A refers to schema and B is the table name.Dinakar Nethi************************Life is short. Enjoy it.************************http://weblogs.sqlteam.com/dinakar/ |
 |
|
|
slimt_slimt
Aged Yak Warrior
746 Posts |
Posted - 2010-04-10 : 12:31:20
|
| or create a schema.with schema [develop_develop] you are telling the system who can autorize this table under this schema and what rights user has against this schema.table ([develop_develop].[CMRC_Brand]).If you use dbo.[CMRC_Brand] where dbo stands for DataBaseOwner, you have default access against this table (usually: READ,WRITE, DELETE, DROP), whereas, creating table under [develop_develop] schema, you can tell that users can only SELECT (READ) and nothing else. |
 |
|
|
viperbyte
Posting Yak Master
132 Posts |
Posted - 2010-04-10 : 13:58:41
|
| Thanks for the input guys. The asp.net project I'm working on is using a third party dll that is accessing the database. The app used to create the dll is also used to create the vb classes, the stored procedures, and the create table script. My app complains about an object not being present. The name of the object has a table name. When I created the tables since I didn't know how to create a schema were created without the schema. Now I have to iron out that variable in the troubleshooting process to see if the app is choking because it's expecting the schema as part of the table name. I can't find much on how to create a schema in books or even on the internet. The little bit I could find didn't spell it out good enough for me on how to create the schema. Can one of you folks or anyone else show me a little code on how to create a schema that is very loosey goosey and allows anyone full permissions on everything like if they were the owner on all objects? Nothing fancy. I just need to march along with this project and get it going. This snag is really holding me up. Please. |
 |
|
|
|
|
|
|
|