I have two diferents hosts with sql server 2000: server1, server2
with two diferents bbdd database1, database2
with two diferents schemas owner1,owner2
with the same set of tables table1,table2,table3,...
these tables have fk a pk with identity columns
I need pass only all rows from
server1.database1.owner1.table1
to
server2.database2.owner2.table1
but
I need preserve pk values and i need advance
identity values y dest tables
I try use dts services but i don`t good results
How I can migrate all rows between owner1 and owner2.
I'm trying to understand the schemas in SQL Server 2005. I have a script which was given to me by someone as follow and I'm trying to run the script but it gave me an error at the create view section:
Assume an empty database has been created.
CREATE SCHEMA [mySchema] AUTHORIZATION [dbo] GO
CREATE TABLE [tblABC] ( ... ) /*note: it didn't bind the table to the above schema*/
create view mySchema.vwMyView as SELECT * FROM mySchema.tblABC GO
However I'm confused because the above CREATE VIEW made a reference to the table with the schema. Can someone help clarify. When i tried to create the view, it gives me an error that it is unable to find the mySchema.tblABC table. To me, the error is correct as per my understanding of binding a table to a schema ---> If you do not create a table and bind it to a schema, you are not able to call it together with the schema.
What I'm trying to understand is, without explicitly stating [mySchema] during the table creation, is there a way where it is mysteriously binded thus the CREATE VIEW somehow understood that tblABC has been binded therefore it called the table in the view? or is this just a script error.
Btw, this script was generated from a working database.
Hi,Anyone know an online source for database schemas, or schemas for singletables i.e. where can I download a schema for an addresses table?--Richhttp://www.badangling.com -= Sea fishing badly explained =-
Is there any way to create a local database cache from an SQL 2005 database that uses non standard schemas (like AdventureWorks). I have tried in Visual Studio 2008 but any database that does not use .dbo will not allow any tables to be copied locally. Even setting the default schema for my login does not enable adding any tables in the Configure Data Synchronization dialog box. If it is not possible via Visual Studio is there any other way? I notice all examples with Sql Compact conveniently use Northwind. Seemingly Compact edition does not support non .dbo schemas.
I have schema called [sitex] for some tables . I have to perform insert or update operations in to these tables through views only and these views were created with [site] schema
All stored procedures are written in the point of view only ( all DML operations into the tables are through views).and these stored procedures has schema same as views.
Now come to the permissions and authorization.
We have some users like sa,112,janu
These users must have permissions only on site schema not on [sitex]. I have a role called €œtestrole€? with 112,janu users and I gave authorization on site schema on for testrole
ALTER AUTHORIZATION ON SCHEMA::[site] TO [testRole] Now I€™m getting error select permessions are denied on [sitex] schema.
But our requirement is 112 must don€™t have any type of permissions on tables
And also is there schema to schema permissions. (that mean [site] schema has permissions on [sitex] schema .
Can anyone give an introduction to the use of schemas i SQL Server 2005. If have noticed the feature, but i would like to know why and how the use of schemas is a good thing.
If anyobe has a link to a whitepaper or practical insight that would be nice.
We're using Sql Server 2000. The one database contained tables and stored procedures which were possibly updated with some script information. Is there an application(commercial or free) or script I can use to compare the base database against this updated database to confirm there schema information is the same.
I'm trying to find some documentation or procedures that will allow me to xfer existing users' roles, etc from sql2000 to sql2005. When our sql 2005 database was restored on a new server (from sql2000), all of the database users were orphaned. I need to create identical server logins and then make the logins database users. It is also important to understand the significance of the new schema concept. The Microsoft SQL2005UpgradeTechRef.doc white paper does not explain any of this. Ultimately, I would like to create a script for the above scenario once a sql2005 db is restored from a sql2000 db. Could someone please help me out on this?
Is there a way to create a table in SQL Server Management Studio under a different schema? I've tried setting my default schema and adding a table, but that didn't work. I know I could do it with a SQL statement, but wanted to know if I could do it with the designer.
I have some tables sitting in schema "A", then I created a view in schema "B" based on the tables in schema "A". Then I gave the user just access to schema "B" to only run the view but not see the tables in schema "A".
Could it be that if the user tried to ODBC to that db, they would only see the view in schema "B" and not the tables in schema "A"?
I'm looking to gather ideas on this before I start the project; so what better way to start than to ask here? ;)
The situation is this: we are in the process of replacing a large data driven application with a new one. Before turning the old'un off (that's not for a minimum of 6 months), we need to migrate data between the two entirely different schemas, and I've been tasked with writing the interfaces.
Now, here comes the kicker; they don't just want a "straight-forward data conversion", they want to run a period where they can still update both databases and any changes in the old one are to be pushed into the new db.
Because the schemas are not the same, I believe replication is out of the question so I was looking for advice as to what possibilies I have ahead of me to achieve this.
I fear I may not have expained this well enough; so as always if there are holes in the detail let me know and I'll do my best to fill them in :)
Hi eveyone, I'm reading about namespaces and schemas in MS SQL 2005, and that's exactly what I was looking for for the structure of my database.
I've a database and 4 different applications that will use it, and every application will create a new database every year, for example, i'd like to use the following schema:
MainDatabase.MyApplication.MyYear.MyTable
In MS SQL i've created my main schema using:
USE Mydatabase; CREATE SCHEMA MyApplication GO
Now I want to add sub-groups (in this example, I need to create Year2006, Year2007, and so on).
Even If i create those schemas, how can I "add" them inside the Salary main schema? I've tryed with ALTER SCHEMA MyApplication TRANSFER Year2006
but it doesn't work since Year2006 is not an object.
We have a system with multiple modules, for each module we have a separate database. Is it better to have multiple databases or have multiple schemas. Performance, advantages, disadvantages... When is too much too much, 10-25-50-100 Schemas???
I am looking for some advice on securing a sql 2005 database.
I have a database to which I want to grant 3 different users access.
The first users, who we will call 'public' should have access to a set of stored procedures, and no access to tables without using the stored procedures they have access to.
The second users have again got access to a certain set of stored procedures, along with the stored procedures for 'public'. These should be called 'moderator'.
Finally the third set of users 'admin' should have access to all stored procedures, but again no access to the database unless its through a stored procedure.
Questions :
Using SQL 2005, how do I assign access to particular stored procedures to a user?
How do I ensure that a 'user' cannot access stored procedures I don't want them to access?
Some of the stored procedure use dynamic sql within them, will this affect my setup. If I deny direct access to the tables to all three users, but allow them access the stored procedures, can the stored procedures access the tables?
If schemas are the answer, how on earth do I set them up, Ive never seen something so badly documented online in my experience! In my development environment im using sql express, so will probably working through the query analyzer.
Hi, I am storing information being sent to me weekly into a ms sqldatabase. The one twist I am running into is that later down the linethe information I recieve may require more columns, or columns mightbe renamed so having a static database call is out of the question. Iwas using mysql but for certain reasons switched to ms sql 2000.Currently before ms sql, I query the database for show fields whichreturns all the database data such as type, column name, etc... then Iuse a giant if statement structure to deal with matching andconverting data from my users display to the information into thedatabase.So my first question is how do I either query or using datatypes builtinto C# return information about a tables setup. I was hoping therewas some sort of table array object which could be returned with namesand types, if not then just an sql statement return.My second question is I have user data which needs to be displayeddifferently then the database raw data, how do I use a C# dataset, andconvert it's column data into my raw database data without having tocreate raw insert and update sql strings myself? I would really liketo use the sort of automatic update features of the dataset.Lastly am I going about this the wrong way? Are there other ways tomap & convert datatypes between a dataset column and a table column.
My problem is very simple and that is that I'm trying to copy some tables between databases, but these tables are in different schemas. let's say I have
dbo.tableA sch1.tableA sch2.tableA sch3.tableA And I just want to copy let's say sch1.tableA to a Different DB. If I use Transfer SQL Server Object task and select the table and save the package and try to open the task again, all the tables with name TableA will be selected!! it seems like although it does show the schema ( when I am selecting the table manually ) but it doe snot store the schema detail in the tablelist collection property of the task. Would please recommend any other way to achieve this. Many Thanks in advance
I have 2 different databases and an import tool that reads from one and fills the other one and then whenever we run it, it should synch the two databases and its kind of a heavy task. I was wondering if i can replace it with replication between these databases. I defined publisher and subscriber, but i cannot find anywhere that i can say which field in source maps to which field in destination.
Is it possible at all to have a replication between 2 databases with totally different schemas? If so, please let me know how.
I'm trying to find some documentation or procedures that will allow me to xfer existing users' roles, etc from sql2000 to sql2005.
When our sql 2005 database was restored on a new server (from sql2000), all of the database users were orphaned. I need to create identical server logins and then make the logins database users. It is also important to understand the significance of the new schema concept. The Microsoft SQL2005UpgradeTechRef.doc white paper does not explain any of this.
Ultimately, I would like to create a script for the above scenario once a sql2005 db is restored from a sql2000 db.
I have noticed that some folks create a user to own a schema, with both having the same name (ex: userowner = pfm schema = pfm) and others make dbo the owner for all their schemas. From what I can tell, it doesn't really matter; what does matter is if your database users are granted access to the schema. Since most users only have public rights and dbo has database owner rights, is there any particular reasoning to use one scenario over the other?
Hi there; i've recently designed a new db for my portal website, and wanna move the old data from former db to the new one. The problem is that for the 'News' table, for instance i have two different schemas:Old >>News(id,title,summery,text,date, ... , (old columns) , ...)New >> News(id, title , summery , text , date, lastUpdated, ... , (new columns) , ...) i want to copy the bolded columns, and want to have 'lastUpdated' & 'date' in the new table to be the same as 'date' in the former one.as i googled, i just found materials on copying dbs to production servers, or cross db scenarios. thanks in advance
I have an application using SQL server 7.0 and have it installed at numerous sites. At the moment when an upgrade is carried out it generally includes changes to the database schema, at the moment these changes are tracked by saving lots of change scripts and running them as batch files. This process of update is quite time consuming and any errors that occur are not obvious so the upgrades must be carried out by our own staff. I was wondering two things:-
1) How do people manage this kind of problem. 2) Are there any tools that help to cope with this problem.
I have a SQL Server 2012 Enterprise Edition install that I am needing to do the following:
- Provide db_owner access to a single user. Have the db_owner privilege apply for the user in all Schemas of the database (this is a generic AD account that is being used for an application).
They are wanting me to do this because they do not want to get so granular as to tell me all of the objects that the user will need specific access to in any of the given Schemas of the database(s).I have 8 databases, and each one has additional Schemas. These are all contained in a Default instance.I am finding that without explicitly applying permissions to the various objects in the Schemas that are not the default Schema for this user, I am a bit stuck.Is there any way to have the db_owner permission apply to the single user for all the Schemas in a given database (without making them a Sysadmin)?