473,395 Members | 1,411 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Creating schemas

hello expert
problem is
i am using mssql 2005 and i have created a procedure that will create schema and tables under that schema
procedure name is "createschema(<schema_name>) .
code is
SET @Schema_Tables=N'Create schema '+ @Schema_Name
EXEC sp_executesql @Schema_Tables
this creates schema but when create table is encountered
code:
SET @Schema_Tables=N'CREATE TABLE '+@Schema_Name+'.UserGroup('
SET @Schema_Tables=@Schema_Tables+N'Group_id int primary key,'
SET @Schema_Tables=@Schema_Tables+N'GroupName varchar(50))'
EXEC sp_executesql @Schema_Tables
it gives an error
either schema not created or you dont have permission to use that schema
now if the procedure is successfully executed table created is not under the schema name i have specified but the user name.tablename is seen
Note:username is the name from which i loggen in

.this runs successfully in local computer but not in remote server.

please help
thanking you
sarabjeet singh
Oct 13 '07 #1
1 977
iburyak
1,017 Expert 512MB
Try changing this:

Expand|Select|Wrap|Line Numbers
  1. SET @Schema_Tables=N'CREATE TABLE '+@Schema_Name+'.UserGroup('
to this:


Expand|Select|Wrap|Line Numbers
  1. SET @Schema_Tables=N'CREATE TABLE '+@Schema_Name+'.dbo.UserGroup('
Oct 13 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Dim St Thomas | last post by:
I am a developer working on a database client program. I am testing this program on a Windows XP machine (1.5 GHz AMD chip, 480 Mb RAM, 60 Gb disk) This machine has Oracle 9.2.0.1.0 and RedBrick...
2
by: John Jenkins | last post by:
Hi, I have a lot of schemas to load into a schema collection. I load them in by reading each one into a XMLTextReader from disk and add them into a schema collection. I have a couple of issues to...
3
by: Kiran | last post by:
Hi, I want to back up my data in some table in SQL server and import it back using Bulk Load of SQL server 2K. I can use the following code to backup the data in XML ...
12
by: enak | last post by:
I have found some code that shows how to convert an html form to Word. The message said to simply put the following in the Page_load: Response.ContentType = "application/ms-word"...
2
by: pshvarts | last post by:
(I'm new in SOAP) I get some wsdl file (from apache service ). I tried creating SOAP client with .NET - trying to add Web Reference and get error like: "Custom tool error: Unable to import...
1
by: Vishuonline | last post by:
Guys, I have had some experience in working with webservices created in .NET but this is the first time I am trying out one made in Java. When I run the wsdl exe to create a proxy class for...
5
by: outstretchedarm | last post by:
I'm extremely new to javascript and to programming in general. I am trying to create an interactive table. I have already created the table with constants, in the key of C (it is for music). ...
1
by: Gerhard | last post by:
How can I create a new contact in exchange server from a vb.net web application?
5
by: fireball | last post by:
please help newbie I need to create a lot of objects the same type (let's say: schemas) I wish to use paramerized block in loop to do so. - how to put names of my objects to such control-flow? ...
1
by: Ronsol | last post by:
Hi, I want to import a XML file into SQL. But i can't find a good example to create an unique id from an higer element. I can create different tables, but a link between them not. I want to...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.