Click here to Skip to main content
15,921,716 members
Home / Discussions / Database
   

Database

 
AnswerRe: Sql Server Fetching Data Pin
Groulien12-May-11 22:40
Groulien12-May-11 22:40 
AnswerRe: Sql Server Fetching Data Pin
Simon_Whale13-May-11 0:41
Simon_Whale13-May-11 0:41 
AnswerRe: Sql Server Fetching Data Pin
SilimSayo13-May-11 3:22
SilimSayo13-May-11 3:22 
AnswerRe: Sql Server Fetching Data Pin
jschell13-May-11 9:03
jschell13-May-11 9:03 
AnswerRe: Sql Server Fetching Data Pin
Shameel17-May-11 4:41
professionalShameel17-May-11 4:41 
QuestionDuplicate a record Pin
solomon1300012-May-11 4:28
solomon1300012-May-11 4:28 
AnswerRe: Duplicate a record Pin
SilimSayo12-May-11 8:38
SilimSayo12-May-11 8:38 
QuestionView Pin
Dhyanga12-May-11 3:50
Dhyanga12-May-11 3:50 
AnswerRe: View Pin
Blue_Boy12-May-11 4:26
Blue_Boy12-May-11 4:26 
GeneralRe: View Pin
David Skelly13-May-11 2:22
David Skelly13-May-11 2:22 
GeneralRe: View Pin
Shameel17-May-11 4:45
professionalShameel17-May-11 4:45 
AnswerRe: View Pin
SilimSayo12-May-11 5:46
SilimSayo12-May-11 5:46 
AnswerRe: View Pin
Shameel17-May-11 4:48
professionalShameel17-May-11 4:48 
Questiondatabase function Pin
manoj bhatt 11-May-11 6:14
manoj bhatt 11-May-11 6:14 
AnswerRe: database function Pin
SilimSayo11-May-11 8:08
SilimSayo11-May-11 8:08 
GeneralRe: database function Pin
Peter_in_278011-May-11 15:33
professionalPeter_in_278011-May-11 15:33 
GeneralRe: database function Pin
SilimSayo12-May-11 0:09
SilimSayo12-May-11 0:09 
QuestionWhere is my table created... Pin
Jun Du11-May-11 5:00
Jun Du11-May-11 5:00 
I have a couple of newbie questions for SQL Server. On the SQL Server Management Studio, I used the following script to delete and create a table on the master databse:
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[PARTNOTE]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table [dbo].[PARTNOTE]
GO

CREATE TABLE [dbo].[PARTNOTE] (
	[NUMBER] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[NOTE_NUM] [float] NULL ,
	[NOTE] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

I can run this as many times as I want. Both deletion and creation work well. My first question is "After the creation, where is the table creates?" I couldn't find where the table object from Object Explorer.

Now I modify the script to perform the same tasks not on the master, but on "MyDatabase":
if exists (select * from MyDatabase.dbo.sysobjects where id = object_id(N'[MyDatabase].[dbo].[PARTNOTE]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table [MyDatabase].[dbo].[PARTNOTE]
GO

CREATE TABLE [MyDatabase].[dbo].[PARTNOTE] (
	[NUMBER] [nvarchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[NOTE_NUM] [float] NULL ,
	[NOTE] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

The creation still works but the deletion does not. It couldn't find where the table was creates.

Could someone please explain what goes wrong in the modified script? Thanks!
Best,
Jun

AnswerRe: Where is my table created... Pin
Blue_Boy11-May-11 5:17
Blue_Boy11-May-11 5:17 
GeneralRe: Where is my table created... Pin
Jun Du11-May-11 5:44
Jun Du11-May-11 5:44 
GeneralRe: Where is my table created... Pin
Corporal Agarn11-May-11 8:27
professionalCorporal Agarn11-May-11 8:27 
GeneralRe: Where is my table created... Pin
Jun Du11-May-11 6:37
Jun Du11-May-11 6:37 
GeneralRe: Where is my table created... Pin
Blue_Boy11-May-11 20:47
Blue_Boy11-May-11 20:47 
AnswerRe: Where is my table created... Pin
SilimSayo11-May-11 8:31
SilimSayo11-May-11 8:31 
AnswerRe: Where is my table created... Pin
jschell12-May-11 9:28
jschell12-May-11 9:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.