Click here to Skip to main content
15,880,972 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my sql server if i write a create table query and execute it, the table is placed in some were else, i want that table in particular database .
thanks .
Posted

Try this

SQL
USE [DataBaseName]
GO

CREATE TABLE tableName
(
    columnName datatype,
     columnName datatype,
    columnName datatype

)

GO
 
Share this answer
 
Comments
prasadhp 10-Jul-13 6:03am    
is it necessary to writ go
Adarsh chauhan 10-Jul-13 6:09am    
No its not necessary to write 'go'.

GO is used to signal the end of a batch.
GO is not a Transact-SQL statement; it is a command recognized by the sqlcmd and osql utilities and SQL Server Management Studio Code editor.
Pls try this


SQL
CREATE TABLE [MyDatabaseName]..[TestTable]
(
	ID VARCHAR(50) NOT NULL,
	NAME VARCHAR(50)
	
)


hope this helps...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900