.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Business explainfor tables and hierarchy in AdventureWorks database and REAL_Warehouse_Sample_V6 cub

Posted By:      Posted Date: August 31, 2010    Points: 0   Category :Sql Server
AdventureWorks (ProductModel table, what is this table for) ------------------------------ REAL_Warehouse_Sample_V6 (Periodicity(only have one attribute:period)) (Replen Strategy(three level hierarchy(strategy type:backlist,frontlist);(strategy:Modeled,Buyer Managed,No replenishment,Store Managed)) Another one is what is the difference and relation between buyer and customer in cube REAL_Warehouse_Sample_V6? -------------------------------------------- I can not understand the business meaning behind these tables and architecture,can any one help explain the meaning for upper hierarchy and table? happyMan

View Complete Post

More Related Resource Links

sql server 2008 adventureworks database


dear Friends

For my MCTS 70 -433 examination, I recently installed sql server 2008 and installed the sample databases too. but my issue is, in that book they have mentioned a database called "AdventureWorks2008" and the nice thing is I don't have a such a database with me in my sql server 2008. 

And the query is 

-- MERGE Statement
USE AdventureWorks2008
MERGE INTO	Sales.SalesOrderDetailHistory AS SODH
USING Sales.SalesOrderDetail AS SOD
ON SODH.SalesOrderID = SOD.SalesOrderID
AND SODH.SalesOrderDetailID = SOD.SalesOrderDetailID
INSERT (LineTotal, SalesOrderID, SalesOrderDetailID, CarrierTrackingNumber, OrderQty
, ProductID, SpecialOfferID, UnitPrice, UnitPriceDiscount
, rowguid, ModifiedDate, Cancelled)
VALUES(LineTotal, SalesOrderID, SalesOrderDetailID, CarrierTrackingNumber, OrderQty
, ProductID, SpecialOfferID, UnitPrice, UnitPriceDiscount
, rowguid, ModifiedDate, DEFAULT)
UPDATE SET SOHD.Cancelled = 'True'
OUTPUT $action , inserted.* ;	

Please help me to overcome this issue and let me know where can I download that database too.

Thanking you

happy Coding

insert new records in tables from dataset to database


I have 2 tables in SqlServer 2008.

Table1: T1id, SomeData

Table2: T2id, T1id, SomeData

I am using DataAdapter.FillSchema to create shema of tables in DataSet. I created DataRelation on columns T1id in both tables.

Now when i try to Update Sql Database T1id in Table2 remains 0 and not the value of T1id in Table1.

I can successfully update Sql Database if i fill DataSet with records first (Using DataAdapter.Fill), but that's not what i want to do. I don't need "old" records in my dataset. I want to use dataset just to store all imputs from user until the proccess is done and then insert all those records "at the same time".

I think i'm getting it wrong with ForeignKeyConstraints, maybe UpdateRule is not set to cascade, i just don't know.

I have been trying to work this out for 6 days now and i'm about to break something on half.

Can someone please guide me to right direction, maybe post some sample, anything.... please!

My old post regarding this:

How to update Sql Server related tables from Dataset(SchemaFill)

SqlDataAdapter.Update related tables

Select column from all tables in database

I want to retrieve the name and phone columns from all the tables in my database not in systables....   Ok this works but i dont want to get it from just the test table I want to get it from all the tables that I create "USE mrpoteat SELECT name, phone FROM mrpoteat.dbo.test where name = name and phone = phone"

DataAdaptor/Dataset problems when no row present in database tables

Hi All, I'm trying to use a DataSet to maintain some rows for a table, and when I've finished my changes, send all changes to the database using a SqlDataAdapter.    I find if there are no rows in the table in the database then I am getting a 'Object reference not set to an instance of an object' when I try to access the table in the Dataset. Is there a way to work with a Dataset like this ie. I start off with an empty table and I wish to add rows, to access the structure of the table rows, build rows, then add them and do the update on the SQLDataAdapter. Thanks, Sinead Here is my code: protected SqlDataAdapter memberDA = new SqlDataAdapter(); protected DataSet memberDS { get { if (ViewState["memberDS"] != null) return (DataSet)ViewState["memberDS"]; else return new DataSet(); } set { ViewState["memberDS"] = value; } } protected SqlDataAdapter getDataAdapterForMembers() { SqlConnection conn = new SqlConnection(); conn.ConnectionString = ConfigurationManager.ConnectionStrings["SiteDBConn"].ConnectionString; memberDA = new SqlDataAdapter("usp_GetMembers", conn); memberDA.SelectCommand.CommandType = CommandType.Stored

Create view that amins to tables of another database on the same sql server instance

Hi to everybody, I found a situation ever met before. I develop on Dynamics NAV 5.01 and I have developed a method to be able to see some particular tables of an external database. In substance it deals with a property of tables of Dynamics NAV. When I create a table in NAV, I can create it in 3 different ways: table common to all the companies table  for company or table linked to a view.    This last case is mine, on the same db of NAV I have created a view with some fields, I have created in NAV a table linked with equal fields and types. Until here all normal.    The view, however, aims to another database that doesn't center anything with NAV but that it is on the same intance of SQL server.    The consumer that accesses NAV is a consumer type database SQL Server and has the permitted db_public and db_datareader on both the database. Then he can read the views on the db of nav both on the db of the other database.    When it tries to enter from the console of sql server, with the consumer database, all it works, if I do it by NAV, it show me an error "The server principal "username" is not able to access the database "some_database_name" under the current security context. (Microsoft SQL Server, Error: 916) "    If I add on the database NAV to the consumer, the role db_owner,

Search a word in all the tables(all columns) of a database

Dear Friends, I am developing the Home page of a Client. Apart from various things on this home page I have a text box and search button.Having said that, I have a database in which I have almost 12 tables with varying number of columns.Now my question is,Is there anyway to search a word typed by a user in the textbox to search it in all the tables(all columns) of the database.A simple,concise and easy to follow solution would be a great help.

Backup & share database tables

Ηι, What is the best solution for back up and sharing specific sql compact database tables to a central remote site. Hundreds of users will run an application using the same database structure, but each one will have his own data.  We need  each user to be able to synchronize his data to a central remote server,and to share them only with other users that he chooses by their ID code. Please suggest ways and technologies to implement the above.   Regards, Thank you, Viron.  

Newbie question about adventureworks database


Hi Guys,

I downloaded the Adventurworks2008 database and the AdventureworksDW2008 database for practice with SSIS.  I was wondering what the difference between the two databases is, because in the exercises im following it is stating that i will need to extract data from  the Adventureworks2008 database to the AdventureworksDW2008 database.

Is the the AdventureworksDW2008 an empty database and we are just extracting OLTP data to it? Please any help in clarifying this will be highly appreciated. Thanks!

Microsoft SQL Server Management Studio 2008 does not list all tables in database

When logging into SSMS 2008 to a SQL2008 database when I expand the tables in a database I only see a few tables listed.  I can login to the same instance with SSMS 2005 and all of the tables are there.  Is there a reason why this is this way?

I can do a select * from in a query window for any of the tables in the database via SSMS 2008 as well and it work fine.  It just does not display the tables.

query all tables in the database with slightly different query


Declare @Table_Name varchar(50)

FROM sys.Tables

OPEN table_cursor

FETCH NEXT FROM table_cursor
INTO @Table_Name

While @@FETCH_STATUS = 0
  SELECT * FROM @Table_Name

 FETCH NEXT FROM table_cursor
  INTO @Table_Name

CLOSE table_cursor
DEALLOCATE table_cursor

The above code gives error, maybe I am mistaken about the way cursors work.


But how can I acheive the same pirpose


I want to query all tables in the database with the same query in which the where condition will slightly vary.

The above gives this error


Msg 137, Level 15, State 2, Line 8
Must declare the scalar variable "@Table_Name".
Msg 1087, Level 15, State 2, Line 13
Must declare the table variable "@Table_Name".
Msg 137, Level 15, State 2, Line 16
Must declare the scalar variable "@Table_Name".



ALTER DATABASE AdventureWorks SET ENABLE_BROKER takes too long to finish, how long does it run

try to run ALTER DATABASE AdventureWorks SET ENABLE_BROKER ;
but still running after 8mins, is this normal, what is approximate time? can it be cancelled?

How to add a Database Connection on Sharepoint Designer 2007 to access SQL 2005 tables?


I've tried and looked on many sites with different solutions for which non of them resolved my issue. I've a blank Sharepoint site and want to view data from an SQL DB. It says that a Server Error occurred and that the Data Retrieval Service didn't worked out while listing the DB's.

I tried using the 3 methods... using the also the connection string in different ways... when I do it using VB, Office and Java... I can see the data from that DB... why on Sharepoint Designer it doesn't? It supposed to be more easier than other tools.

I'm really desperate. Any help is very welcome.



comparing two database tables to all find matching columns



is there any query to find matching columns from two database tables(not system tables).




Thanks and regards, Rishabh

Database tables


Hi guys,

I'm developing Web Desktop like Glide or Icloud.

It's gonna be a web application that gives the real world desktop application functions.

The DBMS I'm goin' to use is SQL Server.

Now, I'm designing the database schema, but having some problems with it.

I've no idea what tables I've to include.

So far I've only Users, Folders, Files, RecycleBin, Contacts, ContactGroups tables, but it seems very few. May be I've missed something.

Can you guys suggest me tables that I could include in my db, please? 

Need Urgent Help in Creating a Dynamic Textboxes according to database Tables


I need some help very urgent. I need create a table with Textboxes dynamically according to the database table.
Example: we have different articles in a database like cars, jewelery, boats. The data related to these articles is different in the tables. I have to show that data in a textboxes and let the user change those data and update. I can do the update and reading the data from database. But the problems is for each item the no.of columns and rows will differ.

My task is I need to get the data according to the use selection in the table with textboxes. I dont know which container (gridview, formview or etc) will suites for my requirement. please send me any sample code or any tutorial related to this. I am in real need guys.. I really appriciate your help.

Note: showing the data in a table should be a constraint. Because I should show data row wise (each row contains 3 textboxes and 3 labels (DB table column names))

Copy Tables From 1DataBase to Another DataBase



I have a Table in SQL Server DataBase with 200 + Rows

OriginDest(OID, DID)

I want to Copy all the row from OriginDest Table, DataBase1. To OrginDest, DataBase2 with Same Name

Can any tell me Query For that Thanks...

I need help with adding membership tables to app_data folder database


The following code is used to add the asp membership tables to an already existing database instead of creating a seperate database for membership and having two databases in the application.

aspnet_regsql.exe -S .SQLEXPRESS -U username -P password -d databsename -A all

It works fine by adding the membership tables to the existing database that is located in the c drive, program files  sqlserver folder.

But my database however is not in the c drive but located in my asp website app_data folder, so the above code does not give any error and the tables are not added after I run it.

Please how can I now add the membership tables using the above code when my database is located in the website app_data folder, thanks

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend