Click here to Skip to main content
15,896,153 members
Home / Discussions / Database
   

Database

 
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 
Questionshowing column data as header Pin
Ramkumar_S10-May-11 15:23
Ramkumar_S10-May-11 15:23 
AnswerRe: showing column data as header Pin
PIEBALDconsult10-May-11 15:25
mvePIEBALDconsult10-May-11 15:25 
GeneralRe: showing column data as header Pin
Ramkumar_S10-May-11 16:31
Ramkumar_S10-May-11 16:31 
AnswerRe: showing column data as header Pin
Simon_Whale10-May-11 23:44
Simon_Whale10-May-11 23:44 
AnswerRe: showing column data as header Pin
J4amieC10-May-11 23:59
J4amieC10-May-11 23:59 
AnswerRe: showing column data as header Pin
mhwasim11-May-11 7:53
mhwasim11-May-11 7:53 
QuestionSet variable values from queried data Pin
MAW3010-May-11 9:50
MAW3010-May-11 9:50 
AnswerRe: Set variable values from queried data Pin
David Mujica10-May-11 10:40
David Mujica10-May-11 10:40 
AnswerRe: Set variable values from queried data Pin
Simon_Whale10-May-11 11:39
Simon_Whale10-May-11 11:39 
AnswerRe: Set variable values from queried data Pin
SilimSayo11-May-11 3:13
SilimSayo11-May-11 3:13 

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.