Hi there I sorry if I have placed this query in the wrong place. I'm getting to grips with ASP.net 2, slowly but surely! When i try to access my site which uses a Sql Server 2005 express DB i am receiving the following error:
Server Error in '/jarebu/site1' Application.
Database 'd:hostingmemberasangaApp_DataASPNETDB.mdf' already exists.Could not attach file 'd:hostingmemberjarebusite1App_DataASPNETDB.MDF' as database 'ASPNETDB'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Database 'd:hostingmemberasangaApp_DataASPNETDB.mdf' already exists.Could not attach file 'd:hostingmemberjarebusite1App_DataASPNETDB.MDF' as database 'ASPNETDB'.Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace:
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210
This is the connection string that I am using: <connectionStrings> <add name="ConnectionString" connectionString="Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|ASPNETDB.MDF;Integrated Security=True;Initial Catalog=ASPNETDB;User Instance=True" providerName="System.Data.SqlClient"/> </connectionStrings>
The database is definitly in the folder that the error message relates to. What I'm finding confusing is that the connection string seems to be finding "aranga"s database. Is it something daft?
First of all I like to say hello. Its my first post and I hope somebody will be so kind and help me. I have 3 tables in a database. They look like follow:
1. Table called State: ------------------------------ Id Caption
2. Table called Craft: ----------------------------- Id Caption
3. Table called Wage: ------------------------------- StateId CraftId Wage (decimal)
What I'm trying to do is, create a crosstable like the following and display it in a Gridview
Texas California Washington ... digging 25,60 31,42 ...
masonry works 40.66 ... ...
So, the columns come from table State, the row titles come from Craft and the values from Wage. After changing the values I want to save values back to Wage.
I started to build this crosstable but faced several problems. For example I dont know how to set a Caption on the left side of each row (Caption of table Craft). And even worse, how shall I update table Wage if there are no Id's in the crosstable anymore to make sure that I save the Value on the right place back in table Wage.
It would be very kind if somebody has a solution or a method of resolution.
I'm currently using a shopping cart software called .netCart, which is in ASP.NET and VB. I have been trying to import my local "fully working" database to my remote server using Enterprise Manager via the DTS Export/Import Wizard, but then the exported remote database is not working with the software. Unfortunately, I have no prior experiences in MS SQL database at all, nor do I know anything about the scripts they used with the software I purchased.
Error message when attempting to run part of the software (website) with the exported database -
"Cannot insert the value NULL into column 'CustomerID', table 'tablename.dbo.Customers'; column does not allow nulls. INSERT fails. The statement has been terminated. [Customer Table]"
I simply used the DTS wizard to export the database. All settings are left "default" because I don't know what I should do about them....
1) At Specify Table Copy or Quert, "Copy table(s) and view(s) from the source database is selected. 2) Selected all tables. At the "Column Mappings and Transformations" window for all tables, "Create detination table" is SELECTED and "Enable identify insert" is UNCHECKED. 3) At one of the error table (i.e. Customers), the CustomerID int is NOT NULL.
Sorry, I do not know what's wrong with it, and I don't know how to explain it better technically. The software company do not support this as well.
I believe the problem is with the settings in the DTS wizard when I try to export the database. Something is not set right, but I don't know how to do it.
Can anyone please try to solve this problem for me? Thank you very much.
etc duration is in seconds what i want to be able to do is add the start time from a row to the duration from the same row and sutract it from the next rows startime.
Hi guys, Your help please. First off, I have searched the Forum for answers using the keywords and tried those clues first but with no luck. This one for example: http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q282254
I had a copy of MSDE installed on my machine about 12 month ago but never used it so I uninstalled it. Then I downloaded and installed SQL Server 120-day Evaluation edition a few days ago. When I tried to run SQL Server I get An error 1069 – (The service did not start due to logon failure)…
I’m using Windows XP.
How can I find out what the password is or how can I reset it so the SQL Server logon works?
Hi everyone, I'm working with VWD express 2005 (VB): I have a simple database with UserId (int), EmployeeName(Varchar), and 7 fields presenting days of the week.(bit/Boolean). It's function is to keep track of which Employees are available at what day(s) of the week. What I want is for the user to select 1 of the 7 days in a dropdownlist after which a datagridview shows all employees that have that particular day set "true" so... SELECT * FROM [EmployeeTable] WHERE [value selected index dropdownlist] = true Question is how do I place the value of the selected day of the dropdownlist in this query? Or is there a better way to write a Select query? thanks beforehand for your reply ! Sean
I know this is a very simple problem however I've literally just begun learning about SQL and this is the first ever code i've created using the language.
The error is:
Msg 102, Level 15, State 1, Line 30 Incorrect syntax near ')'. Located on line containing "create table Trailer_Type"
I am new to SQL but I have jumped into it fairly deep. I need to write a query to generate a report that counts systems by the first two characters in the system name and gives a count by the first two characters and a total of all the systems. The first part I have but I cannot think of how to get an overall total. Here is the code I am using: select substring(dm.[Name],1,2) as 'Location', count(distinct dm.[Name]) as '# Discovered', count(distinct w.[Name]) as '# Managed', count(distinct w.[Name])*100 / count(distinct dm.[Name]) as '% Managed' from DiscoveredMachines dm, Wrksta w
where datediff(dd,dm.[DiscoveryDate],getdate()) < 90 and dm.[Name] *= w.[Name] and (dm.[Name] like 'AB%' or dm.[Name]like 'CD%' or dm.[Name] like 'AD%' or dm.[Name]like 'CB%' or dm.[Name] like 'SX%' or dm.[Name] like 'EX%')
I am writing a query to list all users in 2 countries but exclude users which their name starts with _inactive_5#4$66899, holder_....
I wrote
Select position, subsidiaryName from position where subsidiaryname = 'country one' OR subsidiaryname= 'country 2'
I get a result but there are some names which are fake accounts
eg. names start with inactive_#@$%&*ijkgfhg
or with holder_uhgfjgj
how can I do write into the query so that only the proper names without the rows that are fake showing up. In other words i want all results for those 2 countries except ones starting with inactive or with holder......?
First off sorry for my complete lack of experience with SQL, but I've just started a new position which involved learning SQL. I'm currently looking for a course but in the mean time I just have to try and fumble by doing basic things.
I'm trying to write my first basic select / join statement, and I just can't seem to get it working.
Any help would really be appreciated. It's T-SQL we use btw.
Thanks :)
USE MLSDHeat GO
select * from dbo.CallLog where callstatus between 'open'and 'pending' right outer join dbo.Asgnmnt on callid = callid order by callid
--the above returns error Msg 156, Level 15, State 1, Line 4 Incorrect syntax near the keyword 'right'.
I am bulk-loading a large amount of data into a group of related tables. Each table has an identity column as its primary key.
A problem is introduced because I need to break up the bulk-loads into multiple sessions, due to performance and memory constraints. I can get all the foreign key references correct within the scope of a single bulk-load session. However, there are many duplicate rows when you look at the job as a whole.
So, I need to find all the duplicate rows, collapse them down to a single row, and update all the foreign key references in other tables to reference this single row.
I can find all the duplicate rows and generate a table consisting of the primary key ids and the duplicated values, ie:
ID Value ---+----- 1 | Fred 2 | Fred 5 | Ethel 7 | Ethel 9 | Ethel
Now, all I need to do is DELETE all the duplicate rows (in the example above, rows 2, 7 and 9) and generate UPDATE statements for the other tables that reference this one which replace all the duplicate keys with the chosen one (ie. replace all references to foreign key 2 with 1, and all references to foreign key 7 and 9 with 5).
But this is where I'm getting stuck with SQL. I haven't been able to figure out a way to extract just the first row for each group of Values, which contains the primary key I will use to substitute, then generate the correct subquery for the UPDATEs.
I know I can do this sort of thing procedurally, but I'm wondering if there is also an elegant way to do this in SQL. Thanks so much for the help!!
So, I have never worked with SQL in my entire life, but have some basic programming skills. I was given a job to run through two tables, sort some of the information and return the two most recent enteries for the job number. I can sort everything but I am having a hard time just returning the two most recent enteries. I have two tables in which to look from and I think a subquery WHERE with the TOP would work.... yet I have tried everything i can think of and after a good 10 hours of research, im hoping to get some help!
The two most recent enteries that i need returned is "start date" with all the other information...
Here is my code that is from designer (which i have played with to no avail)
SELECT Table1.[Inquiry #], Table1.[TTI #], Table1.[Proj Name], Table1.[Customer Name], Table1.[Date In], Table2.Activity, Table2.[Start Date], Table2.[Stop Date], Table2.[Project Lead] FROM Table1 INNER JOIN Table2 ON Table1.[Inquiry #] = Table2.[Inquiry #] GROUP BY Table1.[Inquiry #], Table1.[TTI #], Table1.[Proj Name], Table1.[Customer Name], Table1.[Date In], Table2.Activity, Table2.[Start Date], Table2.[Stop Date], Table2.[Project Lead] ORDER BY Table1.[Inquiry #], Table2.[Start Date] DESC;
Well, all i can do now is pray someone has the opportunity to help.
I've seen this question asked when I searched, but I didn't see an answer that looked like it applied to me, so I'll ask again.....
Making the transition from VB 6 to VB.NET and decided to take a stab at database programming while I'm at it. I bought "Database Programming with Visual Basic.NET and ADO.NET" by Sams Publishing and ran into problems in the first chapter. I've posted some questions on the microsoft.public.vb.database newsgroup and got some help, but it's still not working.
I'll skip some of the boring stuff and dive right in with what I've found out so far:
From MSSQL$VSDOTNETLOGERRORLOG
2004-11-19 02:29:34.71 spid3 SQL global counter collection task is created. 2004-11-19 02:29:34.76 spid3 Warning: override, autoexec procedures skipped. 2004-11-19 02:29:58.87 spid51 Error: 15457, Severity: 0, State: 1 2004-11-19 02:29:58.87 spid51 Configuration option 'allow updates' changed from 0 to 1. Run the RECONFIGURE statement to install.. 2004-11-19 02:29:59.01 spid51 Error: 15457, Severity: 0, State: 1 2004-11-19 02:29:59.01 spid51 Configuration option 'allow updates' changed from 1 to 0. Run the RECONFIGURE statement to install.. 2004-11-19 02:29:59.46 spid3 SQL Server is terminating due to 'stop' request from Service Control Manager.
The last suggestion was to uninstall and reinstall. I uninstalled VS and SQL and reinstalled getting the same error message in the log, but the message box said that installation was complete.
On the Server Explorer of the IDE, it shows my computers name (programmer) under Servers. When I expand that and expand SQL Servers, I see PROGRAMMERVSDOTNET. When I try to expand that, I get the SQL Server Login window with Server textbox disabled saying PROGRAMMERVSDOTNET and the Database blank. Under the Login it has James (my sign in name) and asks for a password. When I did the MS-DOS CLI installation, I used "password" as the SAPWD. I tried using password, and tried using the password to log on as James, and get the same error message: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.
Any help would be appreciated, as long as you remember that I am a COMPLETE newbie at this. I'm fairly computer literate, but I don't know the first thing about databases.....
I got the error message: "The metadata of the following output columns does not match the metadata of the external columns with which the output columns are associated". What does that mean and how am I supposed to fix the problem?
TIA,
Barker
P.S. The SSIS UI seems extremely slow and sluggish (opening, creating connections). Any performance tweaks known? (I have 9GB of RAM on my box and plenty of HD space so I don't think that is it. I also have sql 2005, sp1 installed.)
Hello, I am admittedly new to this, especially sql server and am in need of a pro's assistance.. I installed Microsoft Small Business accounting, which in turn installed and configured a sql server. When I installed ACT! 2005 (v7.0) and tried to create a database, it states that it cannot find the master file.... so I tried to install sql server from Microsofts site - downloaded all the packages, unzipped them and ran them... the error I get is that the sql server needs to have an sa password and to use some switch to change it... for the life of me I am lost here. I can't use ACT! at this point and I have not ideas of how to remove, reinstall or repair the sql server.... Any help you can provide would be greatly appreicated!
Server: Msg 9002, Level 17, State 2, Procedure spPFW_Get_Financial_Data, Line 145 [Microsoft][ODBC SQL Server Driver][SQL Server]The log file for database 'tempdb' is full. Back up the transaction log for the database to free up some log space.
When I use the tools/backup database it will not let me select backup transaction log or fails the bacup of the tempdb database with a msg saying : 'Backup and restore operations are not allowed on database tempdb'
i downloaded and installed SQL SERVER 2005 EXPRESS. i tried to convert an "ACCESS" database to sql and got the next error:
: "AN ERROR OCCURED WHILE ESTABLIDHING A CONNECTION TO THE SERVER. WHEN CONNECTING TO SQL 2005, THIS FALIURE MAY BE COUSED BY THE FACT THAT UNDER THE DEFAULT SETTINGS SQL SERVER DOES NOT ALLOW REMOTE CONNECTIONS. PROVIDOR NAMED PIPES ERROR 40 - COULD NOT OPEN A CONNECTION TO SQL SERVER".
I've been looking over this and can't see anything wrong. Can anyone shed some light on this for me? ------------------
Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0117: 'System.Data.SqlClient.SqlConnection' does not contain a definition for 'ExecuteReader'
Source Error:
Line 16: SqlCommand myComm = new SqlCommand("SELECT users, password FROM users WHERE username='" + username + "' AND password='" + password + "'", myConn); Line 17: myConn.Open(); Line 18: SqlDataReader myReader = myConn.ExecuteReader(); Line 19: do Line 20: {
if the value of a paticular cell in the table has changed since last poll,
then initiate the second task
2. do a select query that picks about 10,000 new rows off another db table,
the 10,000 rows should then be stored in a in-memory dataset.
Every time the poll initiates a new select query, it should insert the new rows to the existing in-memory dataset.
thus if the select runs for 2 times in 2 minutes, the the in-memory dataset would contain a maximum of 20,000 rows.
3. Then I want to apply a set of transformations on the dataset and then finally update some db tables, push some records to the ssas database. (push mode incremental processing)
which sub tasks can be achieved and which cannot.
if not, Is there a workaround?
Please do provide some specific links that accomplish some of these similar tasks.
I have tested some functionality, like
doing a full processing of a ssas database.
reading from a database table and inserting into a flat file.
I tired to use the ExecuteSQLTask, and i also assigned the resultant to an user:variable. the execution completed succesfully but I am not able to see the value of the variable change. also I am not able to use the variable to figure out a change in previous value and thus initiate a sql select. or use the variable to do anything.
"Error: 8624, Severity: 16, State: 1 Internal Query Processor Error: The query processor could not produce a query plan. For more information, contact Customer Support Services."
I have traced this to an insert statement that executes as part of a stored procedure.
INSERT INTO ledger (journal__id, account__id,account_recv_info__id,amount)
There is also an auto-increment column called id. There are FK contraints on all of the columns ending in "__id". I have found that if I remove the contraint on account__id the procedure will execute without error. None of the other constraints seem to make a difference. Of course I don't want to remove this key because it is important to the database integrity and should not be causing problems, but apparently it confuses the optimizer.
Also, the strange thing is that I can get the procedure to execute without error when I run it directly through management studio, but I receive the error when executing from .NET code or anything using ODBC (Access).
I've been reading a million and one posts on replication
My scenario is that i have a live SQL 2000 server. In a DR invokation, i'e i've lost my live sever, i want to be able to access the same data at the DR (SQL 2000) site and have it accessable to the users. DR server has a different name to the live box.
Replicate
Master CRMDatabase
Data changes all the time but can have hourly replication of transaction logs for this example. I've currently researched a sp called update logons but this has to be fed each account name to enable them on the new server. There must be a way to activate all CRMDatabase logons with the new server?
Could someone be kind enough to lead me through a step by step guide on the best solution.
When I am trying to read rows from any table from any database in the offsite production server with Pc Anywhere ( all other servers can be acess fine with pc anywhere
I get this error
An unexpected error happned during this operation {query} query designer error encountered a query error unexpected error
I checked the version of Enterprise manager Help About microsoft managment console 1.1version 4.0 bulid 1381 service pack 4
We have a issue with a MDS server that have been over us for a couple of days, the original error msg from SQL Server Engine is the one "The query processor could not produce a query plan" but the ones we get on the Excel-Addin are "Sequece contains no elements" or "The value cannot be null" T
• Using Microsoft SQL Server 2012 (SP1) - 11.0.3393.0 (X64) for 6months on this server without issues
• Two weeks ago we started to have 2 errors: "Sequence Contains No Elements" | "The Value Cannot Be Null"
• We are using the last version of Excel Add-in
• We try to reinstall the MDS feature
• If I backup/restore MDS database to other server it works
• We updated to SQL 2012 SP2 + CU4 but the error persisted ...
Looking at the MDSTraceLog we are routed to the this msg
SQL Error Debug Info: Number: 8624, Message: Internal Query Processor Error: The query processor could not produce a query plan. For more information, contact Customer Support Services., Server: bbdvsql03inst01, Proc: udpMetadataEntityGetDetailsXML, Line: 28
At line 28 udpMetadataEntityGetDetailsXML is calling udfMetadataEntityGetDetailsXML … and here is where we stopped
** Error found when try to get data from a entity using Excel add-in ** =================================== Sequence contains no elements ------------------------------ Program Location: at Microsoft.MasterDataServices.AsyncEssentials.AsyncResultBase.EndInvoke() at Microsoft.MasterDataServices.ExcelAddInCore.AsyncProviderBase`1.EndOperation(IAsyncResult ar)
I am trying to run queries against any of the user tables in my MS SQL 7.0 database. I get a message the Query Designer encountered a query error. We have tried rebooting the SQL Server and I am still getting these messages. Also, the SQL error logs look fine - all database maintenance are running successfully including the DBCCs which show no errors. Any help would be greatly appreciated as we are to go into production in a few days.
How to optimize the following Stored procedure running on MSSQL server 2000 sp4 :
CREATE PROCEDURE proc1 @Franchise ObjectId , @dtmStart DATETIME , @dtmEnd DATETIME AS BEGIN
SET NOCOUNT ON
SELECT p.Product , c.Currency , c.Minor , a.ACDef , e.Event , t.Dec , count(1) "Count" , sum(Amount) "Total" FROM tb_Event t JOIN tb_Prod p ON ( t.ProdId = p.ProdId ) JOIN tb_ACDef a ON ( t.ACDefId = a.ACDefId ) JOIN tb_Curr c ON ( t.CurrId = c.CurrId ) JOIN tb_Event e ON ( t.EventId = e.EventId ) JOIN tb_Setl s ON ( s.BUId = t.BUId and s.SetlD = t.SetlD ) WHERE Fran = @Franchise AND t.CDate >= @dtmStart AND t.CDate <= @dtmEnd AND s.Status = 1 GROUP BY p.Product , c.Currency , c.Minor , a.ACDef , e.Event , t.Dec
I have a SProc that runs across many clients without any problems. Every now and then, though, I get the following error:
Internal Query Processor Error: The query processor encountered an unexpected error during execution. [SQLSTATE 42000] (Error 8630).
All I am doing is populating Temp tables with some data and then joining them together to create a Global Temp table that is being BCP'd to a network share.
Has anyone come across this error in SQL Server 2005? I cannot find anything on Google or Microcsoft.