Can't Open Adventure Works Example
May 15, 2006
after running msi, can't open this solution
C:Program FilesMicrosoft SQL Server90ToolsSamplesAdventureWorks
Analysis Services ProjectStandard, select the file Adventure Works
DW.sln
---------------------------error msg
Microsoft Visual Studio
The application for project 'C:Program FilesMicrosoft SQL Server90ToolsSamplesAdventureWorks Analysis Services ProjectstandardAdventure Works DW Standard Edition.dwproj' is not installed.
Make sure the application for the project type (.dwproj) is installed.
---------------------------error msg
View 6 Replies
ADVERTISEMENT
Aug 27, 2005
The Data Mining Tutorial accompanying the June CTP includes mention of a table DimProspect. Despite the csv file existing in the Program FilesMicrosoft SQL Server90ToolsSamplesAdventureWorks Data Warehouse path containing the data for the table, the instawdwdb script doesn't include any reference. Can someone supply me with the necessary script for this table?
View 6 Replies
View Related
Jan 3, 2007
Hey All,
I'm new to the whole DB thing so I wanted to start off easy and download SQL Express. That part worked fine so I tried to install the Adventure Works DB to get some practice using the SQL commands. The problem is every time I click on a table in Adventure Works and choose Open Table I get a Microsoft SQL Server Management Studio box that pops up. The error says: Class Not Registered (Exception from HRESULT: 0x80040154 REGDB_E_CLASSNOTREG))
(Microsoft.SqlServer.SqlTools.VSIntegration)
Help!! Any ideas out there how to get the Adventure Works DB working? Thx much.
View 1 Replies
View Related
May 6, 2007
When I am trying to process the dimension "Clustered Customers"
I get an error of the following words, ...
OLE DB error: OLE DB or ODBC error: The following system error occurred: The token supplied to the function is invalid .; File system error: The following error occurred while reading from the file 'Compressed stream'..
SELECT 1 AS [dbo_FactInternetSalesReason0_0],[SalesReasonKey] AS [dbo_FactInternetSalesReasonSalesReasonKey0_1]
FROM [dbo].[FactInternetSalesReason]
)
AS [dbo_FactInternetSalesReason]
Processing Mining Structure 'Customer Mining'.
Start time 5/6/2007 1:45:40 AM
Processing Cube 'Customer Clusters ~MC'.
Start time 5/6/2007 1:45:40 AM
Processing Measure Group '~CaseDetail ~MG'.
Start time 5/6/2007 1:45:41 AM
Processing Partition '~CaseDetail ~MG'.
Start time 5/6/2007 1:45:41 AM
Processing Measure Group 'Internet ~1 ~MG'.
Start time 5/6/2007 1:45:41 AM
Processing Partition 'Internet ~1 ~MG'.
Start time 5/6/2007 1:45:41 AM
SQL queries 1
SELECT DATAID ( [Adventure Works].[Internet Sales].[$Customer.Customer] )
AS [Sales0_0], AGGREGATE ( [Adventure Works].[Internet Sales].[Internet Sales Amount] )
AS [Sales0_1], DATAID ( [Adventure Works].[Internet Sales].[$Product.Subcategory] )
AS [Sales0_2]
FROM [Adventure Works].[Internet Sales]
GROUP BY [Sales0_0],[Sales0_0],[Sales0_2]
ORDER BY DATAID ( [Adventure Works].[Internet Sales].[$Customer.Customer] )
ASC
Error Messages 1
OLE DB error: OLE DB or ODBC error: The following system error occurred: The token supplied to the function is invalid .; File system error: The following error occurred while reading from the file 'Compressed stream'..
Any ideas what could be causing this error occurred while reading from the file 'Compressed stream'.. problem?
Thanks.
AIMDBA
Andre_Mikulec
View 11 Replies
View Related
Oct 14, 2006
Hello Everyone,
I am very new to SQL and just completed an install of SQL 2005 Express. After install, I downloaded the Adventure Works database and attempted to attach through both the Object Browser (right-click 'Databases'--->'Attach') and by running the script that is located on the SQL download page where I got the Adventure Works db.
Here's the error that I get:
"Could not find row in sysindexes for database ID 8, object ID 1, Index ID 1. Run DBCC CHECKTABLE on sysindexes."
I have attempted to go through the help files, but unfortunately the above message is too cryptic for me and I have no idea what it's telling me.
Can someone help?
Thanks!!
View 6 Replies
View Related
May 19, 2015
I was studying the Adventure Works database because I read it contains good examples of best practices.
It has an ID column for each table that is auto-incrementing Primary Key. There is also a row guid which seems redundant since the ID PKs are identity columns that increment automatically and should be unique in a given table.
What is the purpose of the row guid being used in conjunction with the ID which should be unique in a given table?
View 2 Replies
View Related
Jun 12, 2006
Hi, all here,
I am trying to locate the solution file for the Adventure works DW included as part of the installation of SQL Server 2005 to be opened in Business Intelligence Development Studio, But where is the solution file saved? I can see its database from Management studio but I need to know its solution file to locate it in Business intelligence studio. Please could anyone here give me some idea about that. Thanks a lot in advance for any help and guidance for that.
View 3 Replies
View Related
Jul 21, 2015
I have got sql server developer 2014 64 bit, but i cannot attach the adventure works 2014 or 2012, keeps giving me errors. so is their an exe file or another way to install this to the database.
Using windows 8.1 64 bit enterprise, jaws 16, and sql server 2014 developer 64 bit.
[URL] ....
View 10 Replies
View Related
Jan 22, 2007
All,
I'm running Windows Xp Pro With SQL 2005 Dev edition with Adventure Works sample db installed. I am the local administrator on my desktop, the services are up and running and I specified local connections only since this is the DEV edition of SQL05.
When I try either one of these connection strings: Data source=(SQLDEV05); initial catalog=AdventureWorks or Data source=(local); initial catalog=AdventureWorks.
I receive this error message:
TITLE: Microsoft Report Designer
-----------------------------
A connection cannot be made to the database.
Set and test the connection string.
----------------------------
ADDITIONAL INFORMATION:
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=2&LinkId=20476
================================
Thanks in advance!
>Scott
View 3 Replies
View Related
Dec 12, 2005
This may not be correct request but I have SQL Server Management Studio Express. How do I connect the Adventure Work Database to the console?
View 14 Replies
View Related
May 15, 2006
Downloaded the file for the Adventure Works DB Sample. Which folder do I need to install it in to have show up in SQL Server Express 2005??
View 5 Replies
View Related
Sep 14, 2015
I am trying to create a Adventure Works Tabular cube in my developing machine and im having problems deploying the tabular cube (the DW database was firstly attached without problems)
So I'm having problems processing Adventure Works Tabular Cube, the problems are somewhere between SSAS project configuration and running privileges, i think. I'll describe exactly where i am:
- in SSMS 2012, connections, tables and roles and roles are empty, i only have the full name of the database when I try to process i get an error "the table with id of "product category 92583829......", Name of Product Category refereced by the model Cube, does not exist. An error ocurred when loading the model cube, '?c:program filesmicrosoft
sql serverMSAS11.MSSQLSERVEROLAPDataAdventureWorks Tabular model SQL 2012.0.dbModel.21.cub.xml'. (Microsoft AnalysisServices.)"
- in SQL Server configuration Manager, I have
Sql Server (MSSQLSERVER) running with account NT ServiceMSSQLSERVER
Sql Server Analysis Services (MSSQLSERVER) running with account .L.ABCDE , which is my account, i've changed because i've read somewhere that i could have problems with privileges.
(Note: it's strange because SSAS is tabular, i can see a blue rectangle (sort of) in SSMS but in configurator manager seems to be a cube.)
- in SSAS Project i unzip a clean copy of the project and the first error is that BIM file can't be found, it try's to find server TOSHIBA_S50_BTAB, but as i have only tabular SSAS running, i replace for TOSHIBA_S50... And some time ago it worked, now it doesn't even found TOSHIBA_S50_B?!!!!
View 3 Replies
View Related
Jan 24, 2008
Hi
I have three questions about several topics.
In this code:
public string ConnectionString
{
get
{
return "Provider=MSOLAP.3;Data Source=localhost;Initial Catalog=Adventure Works DW";
}
}
What is data source and initial catalog and what does this code do? And if I want to use other database how can change this code? (This code is for data mining viewer client project)
And in this code:
SqlConnection cn = new SqlConnection("Data Source=localhost;Initial Catalog=AdventureWorks;Integrated Security=True");
SqlCommand cm = new SqlCommand("Select AddressID,AddressLine1 from Person.Address", cn);
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = cm;
DataTable dt = new DataTable();
da.Fill(dt);
this.comboBox1.DisplayMember = "AddressLine1";
this.comboBox1.ValueMember = "AddressID";
this.comboBox1.DataSource = dt;
what is comboBox1.DisplayMember and comboBox1.ValueMember ,and what is difference between those ?
and other question:
in adventure works dw project for data mining predicting ,in forecasting model ,if I want to show the result of this query in the combobox in c# how can I show that?
SELECT
PredictTimeSeries(amount)
From
[Forecasting]
And again in this code ,it has a result which has two culomns ,on of them is for amount and other column is for time ,in sql I can save this result in exsiting table or neew table with wizard,but I want to
Do this work in c#,that€™s mean with a adomdconnection I connect to forecasting model and write this query then in a datagridviwe ,Iwant to see the values of prediction in adventure works dw database.
Other question:
In €œdataminingviwerclient€? project I change this code and you can see it,for this code I have a form that give servername and catlogname in that and then with clcking on a button I want to show the chart of model in a child form ,but I can€™t.
public Form1 form1 = new Form1();
public string m_ServerName;
public string m_CatalogName;
public Form3()
{
m_ServerName = "";
m_CatalogName = "";
InitializeComponent();
}
public string ConnectionString
{
get
{
return "Provider=MSOLAP.3;Data Source=localhost;Initial Catalog=Adventure Works DW";
}
}
public void button1_Click(object sender, EventArgs e)
{
connectingtoserver();
AdomdConnection conn = new AdomdConnection();
try
{
this.Cursor = Cursors.WaitCursor;
conn.ConnectionString = this.ConnectionString;
conn.Open();
}
catch (System.Exception ex)
{
MessageBox.Show(ex.Message, "Connection Failed");
}
this.Cursor = Cursors.Default;
conn.Close();
ShowModel(panel1, form1.comboBox1.Text);
}
public void connectingtoserver()
{
LoadCatalog();
}
private void LoadCatalog()
{
AdomdConnection conn = null;
try
{
conn = new AdomdConnection(this.ConnectionString);
this.Cursor = Cursors.WaitCursor;
conn.Open();
DataSet ds = conn.GetSchemaDataSet(AdomdSchemaGuid.Catalogs, null);
foreach (DataRow row in ds.Tables[0].Rows)
form1.comboBox1.Items.Add(row[0].ToString());
}
catch (System.Exception)
{
/**/
}
this.Cursor = Cursors.Default;
if (conn != null)
conn.Close();
}
private void ShowModel(Panel panel, string modelName)
{
AdomdConnection conn = new AdomdConnection();
try
{
MiningModelViewerControl viewer = null;
MiningModel model = null;
MiningService service = null;
// Clear any existing controls from the panel
if (panel.HasChildren)
panel.Controls.Clear();
// Connect to server
conn.ConnectionString = ConnectionString;
conn.Open();
// Determine the viewer type based on the model service and
// instantiate the correct viewer
model = conn.MiningModels[modelName];
service = conn.MiningServices[model.Algorithm];
if (service.ViewerType == "Microsoft_TimeSeries_Viewer")
viewer = new TimeSeriesViewer();
else throw new System.Exception("Custom Viewers not supported");
// Set up and load the viewer
viewer.ConnectionString = ConnectionString;
viewer.MiningModelName = modelName;
viewer.Dock = DockStyle.Fill;
panel.Controls.Add(viewer);
viewer.LoadViewerData(null);
}
catch (System.Exception ex)
{
MessageBox.Show(ex.Message, "Model Load");
}
conn.Close();
when I run this code ,I have one error that say: the €œ object not found parametr name:index
Please see this code and answer my question.
If you just can answer one of my qestions ,please say.
Thanks a lot for your answers.With best wishes for you
View 3 Replies
View Related
May 3, 2015
I am trying to delete tables from data where the ModifiedDates older than 9 years in AdventureWorks2012 database . I get console notified that foreign keys are dropped but the delete statement is throwing errors. I am sure that somewhere the key constraints are not getting altered, but i'm not able to figure it out as i'm a relative beginner to T-SQL. The error and code:
The DELETE statement conflicted with the REFERENCE constraint "FK_SalesOrderHeaderSalesReason_SalesReason_SalesReasonID". The conflict
occurred in database "AdventureWorks2012", table "Sales.SalesOrderHeader
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO") | Out-Null
$option_drop = new-object Microsoft.SqlServer.Management.Smo.ScriptingOptions;
$option_drop.ScriptDrops = $true;
[Code] ....
View 3 Replies
View Related
Jul 16, 2006
Database not found !
My web.config file has this bit of code:
<connectionStrings>
<add name="AppConnectionString1" connectionString="Data Source=".SQLEXPRESS";AttachDbFilename="C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLDataAdventureWorks_Data.mdf";Integrated Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
But........................... the is no "AdventureWorks_Data.mdf" in that folder ?
And the database is installed in the right place !
help !
View 6 Replies
View Related
Jul 25, 2007
when I try to open wrks, I get something like this... that ?CbFromWz@MWblStrings@@SAHPBG@z could not be found in my dynamic links library WkWbl.dll
I tryed downloadind a new dll file and putting it in windows/system and ms work directory... but it still does not work,,, can anyone help me?
View 1 Replies
View Related
Dec 3, 2007
Hi,
I have a problem that's baffling me. I have a package that loads some files into the database. If I run it from BIDS, it works fine. But if I run the package from the job, I get this error:
Cannot open the datafile "D:myFoldermyFile.TXT".
It seems like a permissions issue, but the job runs under a local admin account, and not to mention, the very same package/job reads and loads files from this exact same directory, with no problems.
Halp.
View 1 Replies
View Related
Nov 7, 2006
I am having trouble installing the sample Adventure database. I went to the following location:
http://www.microsoft.com/downloads/details.aspx?FamilyId=E719ECF7-9F46-4312-AF89-6AD8702E4E6E&displaylang=en
to download AdventureWorksDB.msi. Once I save that to my local machine I run the install and it completes with no errors. Unfortunately, I can't see any of the data in SQL Server Management Studio Express. I'm new to SQL Server Express so maybe its me, but I get the feeling that it was never added to the database. I'm still looking for SQLServerExpressSamplesOverview.htm to see if I am missing a step but I can't find it anywhere.
The install seems to have extracted database files but if I need to run some scripts by hand to create the database I don't know which order to run them in.
Any help would be greatly appreciated.
View 4 Replies
View Related
Jan 11, 2007
i followed all the instruction to add the database of the adventure works to the database server. but when i attach the database from the managment sql server this error comes
Couldnt find row in sysindexes for database ID 8, object ID1 ..........etc
and couldnt open new database 'adventureworks'. create database is aborted.
please i need a qucik help. cuz i tried the msdn and i failed.
thanks
View 1 Replies
View Related
Jul 26, 2004
I've got a popular problem so i get a message that server acces denied! ..
But that what is different in my error.... When i use same setting same database and connection string (on MSDE server) there is no problem...
On SQL server i have got windwos authentication but i added all accounts as ASPNET and SA.... and when i try to connect by
RETTO - name of my server
server=RETTO;uid=sa;pwd=password;database=db1;
or by
Integrated Security=SSPIserver=RETTO;uid=RETTOASPNET;database=db1;
I CAN BROWSE RECORDS THERE ARE NO PROBLEMS WITH CONNECTION!!! but when i try to update or iinsert or delete something in database there becomame this error that access denied or server does not exist!!!
PLEASE HELP I'm FIGHTING WITH THAT FOR OVER 5 DAYS!!!
I MADE FOR MY ACCOUNTS (SA, ASPNET) ALL THINGS ALLOWED AS EXECUTING stored procedures.. OR ACCESING datatables with insert delete and update query WHERE IS THE PROBLEM!!!??
View 3 Replies
View Related
Jun 20, 2007
I'm having a strange problem with this but I know (and admit) that the problem is on my PC and nowhere else. My firewall was causing a problem because I was unable to PING the database server, switching this off gets a successful PING immediately. The most useful utility to date is running netstat -an in the command window. This illustrates all the connections that are live and ports that are being listed to. I can establish a connection both by running
telnet sql5.hostinguk.net 1433 and
sqlcmd -S sql5.hostinguk.net -U username -P password
See below:
Active Connections
Proto Local Address Foreign Address State
TCP 0.0.0.0:25 0.0.0.0:0 LISTENING
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING
TCP 0.0.0.0:135 0.0.0.0:0 LISTENING
TCP 0.0.0.0:443 0.0.0.0:0 LISTENING
TCP 0.0.0.0:445 0.0.0.0:0 LISTENING
TCP 0.0.0.0:1026 0.0.0.0:0 LISTENING
TCP 0.0.0.0:1433 0.0.0.0:0 LISTENING
TCP 81.105.102.47:1134 217.194.210.169:1433 ESTABLISHED
TCP 81.105.102.47:1135 217.194.210.169:1433 ESTABLISHED
TCP 127.0.0.1:1031 0.0.0.0:0 LISTENING
TCP 127.0.0.1:5354 0.0.0.0:0 LISTENING
TCP 127.0.0.1:51114 0.0.0.0:0 LISTENING
TCP 127.0.0.1:51201 0.0.0.0:0 LISTENING
TCP 127.0.0.1:51202 0.0.0.0:0 LISTENING
TCP 127.0.0.1:51203 0.0.0.0:0 LISTENING
TCP 127.0.0.1:51204 0.0.0.0:0 LISTENING
TCP 127.0.0.1:51206 0.0.0.0:0 LISTENING
UDP 0.0.0.0:445 *:*
UDP 0.0.0.0:500 *:*
UDP 0.0.0.0:1025 *:*
UDP 0.0.0.0:1030 *:*
UDP 0.0.0.0:3456 *:*
UDP 0.0.0.0:4500 *:*
UDP 81.105.102.47:123 *:*
UDP 81.105.102.47:1900 *:*
UDP 81.105.102.47:5353 *:*
UDP 127.0.0.1:123 *:*
UDP 127.0.0.1:1086 *:*
UDP 127.0.0.1:1900 *:*
Both these utilities show as establishing a connection in netstat so I am able to connect the database server every time, this worked throughout yesterday and has continued this morning.
The problem is when I attempt to use SQL Server Management Studio. When I attempt to connect to tcp:sql5.hostinguk.net, 1433 nothing shows in netstat at all. There is an option to encrypt the connection in the connection properties tab in management studio, when I enable this I do get an entry in netstat -an, see below:
TCP 81.105.102.47:1138 217.194.210.169:1433 TIME_WAIT
TCP 81.105.102.47:1139 217.194.210.169:1433 TIME_WAIT
TCP 81.105.102.47:1140 217.194.210.169:1433 TIME_WAIT
Amost as if it's trying the different ports but you get this time_wait thing. The error message is more meaningful and hopefull because I get:
A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 0 - The certificate chain was issued by an authority that is not trusted.) (.Net SqlClient Data Provider)
I would expect this as the DNS has not been advised to encrypt the conection.
This is much better than the : Login failed for user 'COX10289'. (.Net SqlClient Data Provider) that I get, irrespective of whether I enter a password or not.
This is on a XP machine trying to connect to the remote webhosting company via the internet.
I can ping the server
I have enabled shared memory and tcp/ip in protocols, named pipes and via are disabled
I do not have any aliases set up
No I do not force encryption
I wonder if you have any further suggestions to this problem?
View 7 Replies
View Related
Sep 7, 2007
I get the below error only when my IDE open. It connects well when it is found closed.
[SqlException (0x80131904): Cannot open user default database. Login failed.Login failed for user 'JPASPNET'.]
I could solve this by giving the logged in windows user to impersonate under IIS window > WEBSITE > ASP.NET tab > EDIT CONFIG > APPLICATION tab
But I wish someone could give me the proper solution.
I almost tried all from giving ASPNET user as a administrator to configuring the same in Express management tool.
Environment: XP pro, VWD and SQL Express
View 3 Replies
View Related
Sep 26, 2006
I use the code below for updating data from a AS400 Liked server. I dont understend how the WHERE NOT EXISTS( sections work however usualy they do, in this case it does not andt I can't seem to find out why.
Does anyone see the error?
Thanks
--=========================================
--Create a local temporary table that hold
--all the data from the source table
--=========================================
SELECT * INTO #TEMP FROM dbo.LINK_LTTSTOC
--=========================================
--Remove table entries that are no longer
--needed or that have to be updated
--=========================================
DELETE FROM LTTSTOCK
WHERE NOT EXISTS( SELECT * FROM #TEMP
WHERE LTTSTOCK.WarehouseNo = LTWHLO
AND LTTSTOCK.Location = LTWHSL
AND LTTSTOCK.ItemNo = LTITNO
AND LTTSTOCK.NumberAvail = LTAVAL
)
--=========================================
--Insert data that is missing or that
--needed to be updated and was previously
--deleted
--=========================================
INSERT INTO dbo.LTTSTOCK(WarehouseNo,Location,ItemNo,NumberAvail,rowguid)
SELECT DISTINCT LTWHLO,LTWHSL,LTITNO,LTAVAL, NEWID()
FROM #TEMP
WHERE NOT EXISTS( SELECT * FROM LTTSTOCK
WHERE WarehouseNo = LTWHLO
AND Location = LTWHSL
AND ItemNo = LTITNO
AND NumberAvail = LTAVAL
)
--========================================
--Remove local temporary table.
--========================================
DROP TABLE #TEMP
View 2 Replies
View Related
Jun 7, 2006
Hi there,
I got an approach like that:
1) Read something from DB - check the value, if true stop if false go on2) Read the second Value (another SQL Statement) - check the value etc.
Now I could open the connection at 1) and if I have to go to 2) I leave the connection open and use the same connection at 2). Is it ok to do that?
The other scenario would be opening a connection at 1), immediately close it after I read the value and open a new connection at 2).
Thanks for the input!
View 4 Replies
View Related
Nov 3, 2014
Post installation of SQL Server 2014 Express edition, I am able to connect to the Database Instance.
But while opening a new query window in SSMS or opening a table getting the error:
Package 'RadLangSvc.Package, RadLangSvc, Version 12.0.0.0, Culture=Neutral, Public Token=89845dcd8080cc91' failed to load
Object reference not set to an instance of an object. (mscorlib)..Have already tried installing the componentsDACProjectSystemSetup_enu.msi, TSql LanguageService_enu.msi, DACFramework_enu.msi from path VS 2010 WCU DAC.
View 5 Replies
View Related
Jun 26, 2006
Hi,
I am using SSRS Microsoft SQL Server Reporting Services Designers
Version 9.00.1399.00. I want to open linked report in new window.
I tried whats mentioned in http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=240172&SiteID=1 but i get an error on Window.Open method.
How do I solve the problem?
Thanks
View 1 Replies
View Related
Jul 20, 2005
Just a quick question about connection management. My application willnever need more than 1 or 2 connections about at any given time. Also, I donot expect many users to be connected at any given time. For efficiency, Iwould like to keep connections alive throughout the lifetime of the objectsrequiring them, rather than opening a new connection, executing code andthen closing it again. What is the most efficient way of doing this?Should I perform the open/close or just one open when I create the objectand a close when I dispose of it?
View 1 Replies
View Related
Sep 17, 2001
I'm running a DTS package that works correctly when I do "Execute Package" directly, by right clicking the package.
But, if I schedule the job, it fails.
It's trying to write data to another server, but I can't see why it doesn't work as a scheduled job. I tried changing all the parameters I can think of. I'm no Windows expert, so if you have any ideas, please feel free to explain as if you're talking to a "newbie" (since I am one)
Win 2000, SQL 2000
View 1 Replies
View Related
Apr 8, 2008
I am going to tangle with our ERP system for the rest of my natural life, and in so doing, will need to create new SQL queries on an almost-daily basis. Based on the handful of queries that I have created against it so far, I recognize that I need to get better at authoring them.
Towards that end, I was wondering if anyone with a little firmer grasp on the subject could take a look at this query (which works & does exactly what I need it to do) and make suggestions as to what I might have done better/differently.
I've changed the names of everything to make it more comprehensible (I hope).
The query returns one row for each unique record in DetailTable, with data from the SummaryTable and a PartDescription from ThirdTable.
SELECT SummaryTable.RecordID,
SummaryTable.Status,
SummaryTable.CustomerName,
SummaryTable.CustomerNumber,
SummaryTable.OrderNumber,
SummaryTable.AssignedTo,
SummaryTable.ResolvedBy,
SummaryTable.ResolveDate,
SummaryTable.PartNumber,
SummaryTable.PartRevision,
SummaryTable.OrderQuantity,
SummaryTable.IssueCategory,
SummaryTable.IncidentDate,
SummaryTable.InquiryDate,
SummaryTable.IssueClass,
SummaryTable.Severity,
SummaryTable.IssueNumber,
SummaryTable.AuthorizedBy,
SummaryTable.Facility,
DetailTable.AssignedTo,
DetailTable.ActionDate,
DetailTable.ActionBy,
DetailTable.JobNumber,
DetailTable.ActionTaken,
DetailTable.NextAction,
DetailTable.IncidentNotes,
ThirdTable.PartDescription
FROMtheDatabase.dbo.DetailTable
LEFT JOIN
theDatabase.dbo.SummaryTable ON DetailTable.RecordID=SummaryTable.RecordID
LEFT JOIN
theDatabase.dbo.ThirdTable on SummaryTable.PartNumber = ThirdTable.PartNumber
AND SummaryTable.PartRevision = ThirdTable.PartRevision
WHERE (SummaryTable.IssueCategory='1' OR SummaryTable.IssueCategory='2' OR SummaryTable.IssueCategory='3'
OR SummaryTable.IssueCategory='D' OR SummaryTable.IssueCategory='E' OR SummaryTable.IssueCategory='L'
OR SummaryTable.IssueCategory='O' OR SummaryTable.IssueCategory='R' OR SummaryTable.IssueCategory='S'
OR SummaryTable.IssueCategory='V' OR SummaryTable.IssueCategory='X' OR SummaryTable.IssueCategory='Z')
AND SummaryTable.Facility='Default' AND SummaryTable.Status='OPEN'
ORDER BY SummaryTable.RecordID
View 6 Replies
View Related
Sep 12, 2007
I have a VB app that loads 9 text files for 8 different products, one product at a time. The user must select the product to import. For each product the application:
1. Copies the 9 text files from the source directory to a "process" directory.
2. Calls a stored procedure that sequentially calls a different SSIS package for each text file.
3. Performs some additional processing.
Here's the problem. For the 7th product in the sequence, at least 2 of the text files are not being loaded, and no error exceptions are being thrown. For the 8th product in the sequence at least one text file is not being loaded. If I comment out the call to the stored proc in VB and run the stored proc manually at that point in the program, all files are processed.
On the text file side, the files are being copied correctly and the read-only flag on the file is not being set. In addition, I can open the files in a text editor without any problem.
I'm totally stumped here, so any helpful advice would be appreciated.
TIA,
Mike
View 2 Replies
View Related
Apr 18, 2005
I have an asp.net page that executes a DTS. When I execute that DTS from enterprise manager it takes about 5000 rows from the as400 and insert into sql serverIt works right. but when I execute it from my asp.net page I have this error.Error al procesar DTS TransferirDatos(ExistMP) en el paso DTSStep_DTSActiveScriptTask_1System.Exception: Error al procesar DTS TransferirDatos(ExistMP) en el paso DTSStep_DTSActiveScriptTask_1 at LibreraLentos.exec.ejecuta_SP_EXISTENCIASMP() in C:Documents and SettingsluisvalenMis documentosVisual Studio ProjectsInventariosLentosLibreraLentosexec.vb:line 43 at InventariosLentos.generacionprocesomateriaprima.btnenviar_Click(Object sender, EventArgs e) in C:AplicacionesWebInventariosLentosgeneracionprocesomateriaprima.aspx.vb:line 60LibreraLentos I have this on my ASP page Private Sub btnenviar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnenviar.Click Try objexecsp.ejecuta_SP_EXISTENCIASMP() lblmensajes.Text = "Proceso generado satisfactoriamente" Catch ex As Exception lblmensajes.Text = ex.Message + ex.GetBaseException.ToString + ex.Source.ToString End Try End Subthis on my Data Classs Public Function ejecuta_SP_EXISTENCIASMP() ' call UpdatePrice using a parameter array of SqlParameter objects Try Dim ejecutardts As New cDTS ejecutardts.EjecutarDTS("TransferirDatos(ExistMP)") Catch ex As Exception Throw ex End Try End FunctionThis is what executes the DTSImports System.Runtime.InteropServicesImports System.Configuration.ConfigurationSettingsImports DTSPublic Class cDTS Public Sub EjecutarDTS(ByVal NombreDTS As String) Dim pkg As New DTS.Package Dim oStep As DTS.Step Try pkg = New DTS.Package 'pkg.LoadFromSQLServer(AppSettings("MED20NT"), AppSettings("user"), AppSettings("pwd"), DTSSQLServerStorageFlags.DTSSQLStgFlag_Default, "", "", "", "pruebaCdr1") pkg.LoadFromSQLServer("MED20NT", "sa", "prueva", DTSSQLServerStorageFlags.DTSSQLStgFlag_Default, "", "", "", NombreDTS, "") pkg.AutoCommitTransaction = True pkg.Execute() For Each oStep In pkg.Steps If oStep.ExecutionResult = DTSStepExecResult.DTSStepExecResult_Failure Then Throw New Exception("Error al procesar DTS " & pkg.Name & " en el paso " & oStep.Name) End If Next Catch ex As System.Runtime.InteropServices.COMException Throw ex Catch ex As Exception Throw ex Finally pkg.UnInitialize() pkg = Nothing End Try End SubEnd Class
View 2 Replies
View Related
Jun 9, 2006
Can anyone enlighten me on sqlexpress smo?
I have compiled an exe using vbc running the folloing code
Imports SystemImports Microsoft.SqlServer.Management.SmoImports Microsoft.SqlServer.Management.CommonImports System.IO
Module SMOtest
Sub Main() Try Kill(System.Environment.GetFolderPath Environment.SpecialFolder.ProgramFiles) & " estSMO_BACKUP") Catch End Try Try System.Threading.Thread.Sleep(500) Dim bkpfileName As String = System.Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) & " estSMO_BACKUP" Dim backDeviceItem As New BackupDeviceItem(bkpfileName, DeviceType.File) Dim db As String = "test" ' Define and set db Dim bck As New Backup() ' Instantiate a Backup object bck.Action = BackupActionType.Database ' Set Action
bck.BackupSetName = db & "_BackupSet" ' Set Backup
bck.Database = db ' Set Database name property bck.Devices.Add(backDeviceItem)
Dim srv As New Server() ' Instantiate a Server object bck.SqlBackup(srv) ' Invoke Backup object's SqlBackup method Catch End Try End SubEnd Module
This works fine on a win2k dev system though when moving to another win2k system the code will error on non system databases. If db= model,master,tempdb etc it executes fine. When I try to backup a created db (any) I get an error stating the name is not found in sysdatabases.
SELECT name FROM master..sysdatabases
where name not in ('master','tempdb')
shows all the created databases including "test" in this case
keep in mind many recompiles using different db's work fine on one system and not the other. Even restored "test" from a backup from the system with no problems only to have a 3041 error consistently on the other. System databases work fine for all attempts on the offending system.
Any ideas? (the offending system is a SAT raid which has been evil from the get go) corruption seems to be the only conclusion I can reach
View 11 Replies
View Related
Apr 11, 2006
Help, I had my entire DB created and when i thought i was done, i upsized to SQL and now almost none of my queries work?
The below works when i remove Distinct, but then i have doubles?
Code:
SELECT DISTINCT
Equip_ProductName.ProductName, Equip_ProductName.ProductInfoID, Equip_ProductName.ProductDesc, Equip_ProductName.ProductSearchTerm,
Equip_ProductName.ProductMore, Equip_ProductName.Visible, Equip_Products.ProductID, Equip_Products.CategoryID
FROM Equip_Products INNER JOIN
Equip_ProductName ON Equip_Products.ProductInfoID = Equip_ProductName.ProductInfoID
WHERE (Equip_ProductName.Visible = 1) AND (Equip_Products.CategoryID = 1)
ORDER BY Equip_ProductName.ProductName
View 6 Replies
View Related