Returning Database Schemas

Jul 20, 2005

Hi, I am storing information being sent to me weekly into a ms sql
database. The one twist I am running into is that later down the line
the information I recieve may require more columns, or columns might
be renamed so having a static database call is out of the question. I
was using mysql but for certain reasons switched to ms sql 2000.
Currently before ms sql, I query the database for show fields which
returns all the database data such as type, column name, etc... then I
use a giant if statement structure to deal with matching and
converting data from my users display to the information into the
database.

So my first question is how do I either query or using datatypes built
into C# return information about a tables setup. I was hoping there
was some sort of table array object which could be returned with names
and types, if not then just an sql statement return.

My second question is I have user data which needs to be displayed
differently then the database raw data, how do I use a C# dataset, and
convert it's column data into my raw database data without having to
create raw insert and update sql strings myself? I would really like
to use the sort of automatic update features of the dataset.

Lastly am I going about this the wrong way? Are there other ways to
map & convert datatypes between a dataset column and a table column.

View 1 Replies


ADVERTISEMENT

Compare 2 Database Schemas?

Nov 17, 2006

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.

Thanks

View 1 Replies View Related

Multiple Database Vs. Schemas

Jul 24, 2007

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???

Course.dbo.table1
Program.dbo.table1

vs.

NEWDB.Course.table1
NEWDB.Program.table1

Thanks

View 5 Replies View Related

Is There A Tool For Creating Database Schemas From SQL 2000?

Sep 30, 2005

Be gentle, I'm new! :o

We have three databases running on SQL 2000 and would like a visual database schema. We'd rather not do it by hand. ;)

The free-er, the better!

Thanks in advance

Rajendrakumar Varsani

View 2 Replies View Related

SQL Server 2005 Express Database Schemas

Jun 29, 2007



Down loaded the help desk starter data schema but do not know how to connect to mdf file using SQL server management studio can anyone help?



Thanks



Kevin

View 1 Replies View Related

Merging Two Different SQL Server 2000 Databases With Same Schemas In A Single Database

Jan 7, 2008

Hi,

I have two databases lets say DB1 and DB2.
Schemas for both databases is same.
In both database schemas there are tables which has identity columns as primary key.
Now i want to merge these two databases in a single database say DB3.
It may also possible that some master records in both databases are common so they should not repeat in DB3

Is there any way so that i can do it quickly and as soon as possible.

Thanks in advance
Rohit

View 1 Replies View Related

Database Schemas And This Statement Has Attempted To Access Data Whose Access Is Restricted By The Assembly.

Jul 14, 2005

Hello.

View 5 Replies View Related

Schemas, Users, Logins, Database Roles, Application Roles

Mar 5, 2006

Hello,

I am new user of SQL Server. I have some problems with these words. I want to make my database works in my specified permissions. I will specify permissions with schemas and these schema wants an owner. I want this owner should be my user. When creating a user it needs a valid login. I am selecting my login and it occurs and error says this login has an different user. I am specifying permissions with roles. But i can't make association all of them. I hope i told my problem to you as well. If you explain these words to me and tell me how can i do my database's works with my own schemas, users and roles i'll be grateful. Thanks for advices.

Happy coding...

View 4 Replies View Related

Returning The Database Column Names

Dec 24, 2003

Hello, { Merry xmas to all few hours early but hey !! }

I'm trynig to create an application that will connect to any database that i specify and return the colums names within any table that i specify.

I have done the code that establishes the connection but im a bit stumped on how to get the colum names from a tabel and was wondering if anybody had any sourse code for this in VB.

Thanks

Rob

ps: have a good new year !!

View 3 Replies View Related

Returning Database Object Names

Jul 7, 2004

hey everyone, need some help

I have a query return all the names of the table in my database via this code:

SELECT MSysObjects.Name
FROM MSysObjects
WHERE (((Left([Name],4))<>"MSYS"));

I need to further refine the search fitting in the critera LIKE 'qry_tbl%' I dont know how to fit this in .. i tried fitting it in to the end, but nothing comes up.. I also tried querying the results of this query with another query :-P but that didnt work either .. any ideas?

In essence i need all the table names in my DB that start with 'qry_tbl' to be in a list for me..

Thx
Doc


This gives me all the names

View 3 Replies View Related

SQL 2012 :: Select Top 100 - A Record Is Not Returning From Database

Aug 24, 2015

I have a strange situation with an select. I've noticed that when I select top 100, a record is not returning from the database, but when doing top 101 the record appears on position 41.

The query is like this:

select top 100 GroupId, count(HouseId)
from House h
group by h.GroupId
order by max([DateCreated]) desc

From all discussions about top 100 vs top 101 I've noticed that everybody is saying that top 101 is using another algorithm and we can have a speed problem, but my problem is not about this. With top 100 I'm missing a record that should appear at index 41.

View 9 Replies View Related

ASP Returning Null Sized Field From MS SQL Database

Jul 20, 2005

We currently have an SQL db running on a web server.One of these fields is a large(ish) amount of text data – up to 400characters – and has been cast variously as varchar, nchar and texttype to overcome a problem. The problem appears to be in retrievingthe data via ASP. I understand that ASP can handle string data of thissize so I am okay there.When the records are retrieved from the db, the data string length =0.I know the data is there because I have written a Delphi data managerwhich interrogates the db and shows all records and their contents.So if ASP can handle strings this size and the data is there, why do Iget a data length of zero bytes returned when I interrogate the recordset?Whichever way I cast this field I get the same result.I know the code is sound as it works locally through a MS SQL serveron my PS.Anyone have this problem or know what's causing it? I have logged asupport call with my hosting company, but they haven't replied as yetand I am stuck on an urgent project.Any suggestions?CheersGrant

View 1 Replies View Related

Returning Success Message To User - Access Database

Apr 26, 2008



Hi all,

I have a SSIS package that copies data from one database, into another, makes a backup, and then FTP's up the backup to a web server. In Sql Server I've made a job to run the package and a Stored procedure to activate the job from an Access database front-end.

Can anyone tell me how I might return a success/failure message to my access user?

Thanks
Melt

View 2 Replies View Related

SQL XML :: Importing Data From XML Into Database And NULL Returning Results

Sep 16, 2015

I have a xml file downloaded from webAPI which i want to import into my database.There are several sub childnodes and need to combine data between nodes.

<?xml version="1.0" encoding="UTF-8"?>
<classes type="array">
<class>
<class_id>3S</class_id>
<class_pk type="integer">3900</class_pk>

[code]....

View 4 Replies View Related

SQL 2K5 Schemas

Jan 28, 2008

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.

View 5 Replies View Related

Comparing Two Schemas

Mar 1, 2001

Hi Guys,

I'm afraid the schemas of the Development and Production versions of a database are in fact diferent.

How may I compare two database schemas?

Thanks in advance !-)

View 1 Replies View Related

Differentiating Between Two Schemas

Dec 12, 2011

Is there anyway to differentiate between two schemas between two SQL server instances?

View 2 Replies View Related

Standard Schemas?

Aug 15, 2007

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 =-

View 4 Replies View Related

Using Non Standard Schemas

Mar 25, 2008

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.

View 1 Replies View Related

Need T-sql Statement For Schemas

Dec 27, 2007



Hi,

I wanted to find out what the statement is for finding out the number of schemas in all your databases.

I know in 2005 the you can do a select * from sys.schemas

but how do you achieve the same thing in sql server 2000 ?

Please let me know..

Thanks,

View 1 Replies View Related

Number Of Schemas

Dec 26, 2007



Hi,

How do I find out the number of schemas in sql server 2000 and 2005 for each database?

Also, how can i find the number of tables in each database?

I'm trying to figure this out but can't find anything on google.

Please help.

Thanks,
Kapinak

View 4 Replies View Related

Schemas And Permessions

Apr 25, 2007

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 .

PLZ help me

View 3 Replies View Related

Schemas - A Brief Introduction ?

Jan 7, 2006

Hello

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.

View 4 Replies View Related

A SqlDataReader Is Returning An Int, When It Should Be Returning A Tinyint

Sep 25, 2007

I am opening a simple command against a view which joins 2 tables, so that I can return a column which is defined as a tinyint in one of the tables.  The SELECT looks like this:
 SELECT TreatmentStatus FROM vwReferralWithAdmissionDischarge WHERE ClientNumber = 138238 AND CaseNumber = 1 AND ProviderNumber = 89
 The TreatmentStatus column is a tinyint.  When I execute that above SQL SELECT statement in SQL Server Management Studio (I am using SQL Server 2005) I get a value of 2.  But when I execute the same SQL SELECT statement as a part of a SqlDataReader and SqlCommand, I get a return data type of integer and a value of 1.
Why?

View 5 Replies View Related

Users/Roles/Schemas

Nov 27, 2006

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?

View 1 Replies View Related

SQL Server 2005 Schemas

Dec 10, 2007

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.

View 1 Replies View Related

Moving Views Between Schemas...

Mar 27, 2008

Is there an easy way to move a view from one schema to another?

View 2 Replies View Related

Schemas, Views, And ODBC

Mar 28, 2008

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"?

Thanks!

View 2 Replies View Related

Synchronising Databases With Different Schemas

Apr 28, 2008

Hey folks,

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 :)

Old db = SQL Server 2000
New db = 2005

Thanks,
George

View 13 Replies View Related

Some Questions About Namespaces And Schemas

Jun 20, 2007

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.

Thank you!

View 6 Replies View Related

Questions On Users/Schemas

Oct 24, 2007

Hi,

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.

Thanks in advance.

Conor

View 2 Replies View Related

Transfer Table With Schemas Other Than Dbo

Jan 25, 2007

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

View 1 Replies View Related

Can I Have Replication Between Two Completely Different Schemas?

Feb 22, 2007

Hi SQL guys,

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.

Thanks,

Sina

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved