Hey all. right now I've been spinning my wheels for almost 2 days on a problem with c# 1.1/sqlserv 2005...
I have a dataset that's filled with data that I'm trying to write to a database, I've ensured that the dataset is fine.
I do a transaction to write the code to the table,
an insert command, and an update command.
then commit the transaction
Everything seems to work fine, but when I go look at the table, it doesn't actually write any rows!
The weird thing is deletion of the rows works fine on the same table.
I look at the sqlserver tracer and watch it do the deletion on the table, skip right over the insert statements (ie: no insert statements show up whatsoever in the tracer) then commit the transaction.
If anyone has ever heard of something like this happening i would really appreciate some advice. I'm trying to be as specific as I can about the problem, and I've been spinning my wheels for almost 2 days without avail.
I've tried making other tables and writing to them, getting the same results. I think it's somehow not referencing everything correctly but again, everything seems like it's fine.
Hi.A question I have is with regard to the use of views with SQL2000. IfI have a view called "A_view" and used in the following manner;----------------SELECT ...FROM A_ViewWHERE ....UNIONSELECT ....FROM A_ViewWHERE .....-----------------is the view computed twice? Ideally if the view is computationallyexpensive I would rather it was only computed once.Also this would be preferred for data consistency.Is there a way to ensure the view is only computes once?Regards JC.......
I've been handed a SQL Server that is used as an MIS source. There are 4 databases that carry out the task of importing data from various sources, then manipulting that data, and offering the data for reporting purposes.
The vendor has also created several other databases (of which there are also 4), but no-one in my company seems to know the purpose of these dbs.
In the logs, there are approximately 8/9 messages per second - not every second, but numberous seconds per minute - stating....
Starting up database 'db_name'.
... each time, all 4 of the mysterious dbs appear.
I've checked the spid that is running this job this morning, and it seems to be NT AUTHORITYSYSTEM connected to one of the original 4 report databases.
Does this have any affect on the performance of the server, or the specific db attached to the user?
I have a table with 3 columns , let say (PatientIDÂ int, AppointmentDate date, PatientName varchar(30))
My source data looks in below way..
PatientID       AppointmentDate     PatientName  1                01/01/2012         Tom  2                01/10/2012         Sam  3                02/15/2012         John
I need output in below way..
PatientID       AppointmentDate     PatientName  1                01/01/2012         Tom   (actual patient record)  null             01/10/2012         Tom  null             02/15/2012         Tom  null             01/01/2012         Sam  2                01/10/2012         Sam    (actual patient record)  null             02/15/2012         Sam   null             01/01/2012         John  null             01/10/2012         John  3                02/15/2012         John    (actual patient record)
I need t-sql to get above output. Basically the appointment dates are repeatedly assigned to each patient but only difference is patientid will be not null for actual patient record. Â Create table sample (PatientIDÂ int null, AppointmentDate date null, PatientName varchar(30) null)
Here is my query which lists all orders for products supplied by Supplier-3. A typical Query on the Northwind database i wrote is like this..
Select * FROM [Order Details] WHERE ProductID in (Select ProductID From Products where SupplierID = 3)
The subquery in Red was used in multiple places in one of my Stored Procedures..
So what i thought was - use a temp table to store the resultset from this subquery, and then use the temp table instead of querying the Products table everywhere..
My Query looked something like this..
Declare @ProductIDs TABLE (ProductID int)
INSERT INTO @ProductIDs Select ProductID From Products where SupplierID = 3
Select * FROM [Order Details] WHERE ProductID in (Select ProductID FROM @ProductIDs)
Well, I expected an increase in performance with the latter approach, but seems my Stored Procedure is taking more time with the second solution..
Would be glad to see ne explanation on this behavior..
I am using the SqlDependency to notify me of data changes in a table. However, as soon as I start it, the OnChange event fires over and over even though no data has changed.
Essentially All I want to do is be notified when records are inserted into a table. I am able to get another example to work using a Service Broker Queue and a sql query of WAITFOR ( RECEIVE CONVERT(int, message_body) AS msg FROM QueueMailReceiveQueue ) However I would prefer not to use a queue for once my messages have been read they are taken off the queue and I would rather control that manually.
Any help with getting SqlDependency to notify my app when records are added and not over and over when the data has changed would be great.
Failed install on several Win 2003 Ent Ed., 32bit servers both named and default instances, both upgrades and direct installed versions. Why would MS put out such a riddle?
Error Message is " A recently applied update, KB921892, failed to install.
Also, confoundingly, the error log for the hotfix indicates ""9.00.3042.00 while the update version is: 9.00.2047.00."
But the version display on the properties of one of the servers is: "Microsoft SQL Server 2005 - 9.00.1399.06 (Intel X86) Oct 14 2005 00:33:37 Copyright (c) 1988-2005 Microsoft Corporation Enterprise Edition on Windows NT 5.2 (Build 3790: Service Pack 2) "
Any help or comments are deeply appreciated, as the seems to be impacting DB Maintenance Plans, etc...
I have implemented an SSAS stored procedure for dynamic security and I call this stored procedure to obtain the allowed set filter. To my supprise, the stored procedure is being called repeatedly many times (more than 10) upon establishing the user session. Why is this happening?
I'm having many many issues installing sql server management tools. i had visual studio 2005 installed first, but uninstalled and sql related things before trying to install sql server management tools again - i also deleted the program files/microsoft sql server/ folder so there are no references.
Firstly the system configuration check gives me a warning that the system doesn't meet the recommended hardware requirements - this is wrong... i've got 2.33Ghz dual core + 1gb of ram...
I select just management tools + client connectivity to install and click next -> the setup support files/native client/owc11 etc all install fine but workstation components etc fail and the setup log appears to either be empty and not available and MSXML6 fails... after clicking finish the installer appears to crash - : "Microsoft SQL Server 2005 Setup has encountered a problem and needs to close. We are sorry for the inconvenience"... I have tried all sorts of variations on this install and have had no problems in the past - please help!
The setup log from the MSXML6 failure - === Verbose logging started: 18/03/2008 12:34:09 Build type: SHIP UNICODE 3.01.4000.4039 Calling process: C:Program FilesMicrosoft SQL Server90Setup Bootstrapsetup.exe === MSI (c) (5C:78) [12:34:09:067]: Resetting cached policy values MSI (c) (5C:78) [12:34:09:067]: Machine policy value 'Debug' is 0 MSI (c) (5C:78) [12:34:09:067]: ******* RunEngine: ******* Product: {AEB9948B-4FF2-47C9-990E-47014492A0FE} ******* Action: ******* CommandLine: ********** MSI (c) (5C:78) [12:34:09:067]: Client-side and UI is none or basic: Running entire install on the server. MSI (c) (5C:78) [12:34:09:067]: Grabbed execution mutex. MSI (c) (5C:78) [12:34:09:067]: Cloaking enabled. MSI (c) (5C:78) [12:34:09:067]: Attempting to enable all disabled priveleges before calling Install on Server MSI (c) (5C:78) [12:34:09:067]: Incrementing counter to disable shutdown. Counter after increment: 0 MSI (s) (28:E4) [12:34:09:113]: Grabbed execution mutex. MSI (s) (28:74) [12:34:09:113]: Resetting cached policy values MSI (s) (28:74) [12:34:09:113]: Machine policy value 'Debug' is 0 MSI (s) (28:74) [12:34:09:113]: ******* RunEngine: ******* Product: {AEB9948B-4FF2-47C9-990E-47014492A0FE} ******* Action: ******* CommandLine: ********** MSI (s) (28:74) [12:34:09:113]: Machine policy value 'DisableUserInstalls' is 0 MSI (s) (28:74) [12:34:09:113]: MainEngineThread is returning 1605 MSI (c) (5C:78) [12:34:09:113]: Decrementing counter to disable shutdown. If counter >= 0, shutdown will be denied. Counter after decrement: -1 MSI (c) (5C:78) [12:34:09:113]: MainEngineThread is returning 1605 === Verbose logging stopped: 18/03/2008 12:34:09 ===
The log summary:
Microsoft SQL Server 2005 9.00.1399.06 ============================== OS Version : Microsoft Windows XP Professional Service Pack 2 (Build 2600) Time : Tue Mar 18 12:05:06 2008
EOC429 : The current system does not meet recommended hardware requirements for this SQL Server release. For detailed hardware requirements, see the readme file or SQL Server Books Online. Machine : EOC429 Product : Microsoft SQL Server Setup Support Files (English) Product Version : 9.00.1399.06 Install : Successful Log File : C:Program FilesMicrosoft SQL Server90Setup BootstrapLOGFilesSQLSetup0001_EOC429_SQLSupport_1.log -------------------------------------------------------------------------------- Machine : EOC429 Product : Microsoft SQL Server Native Client Product Version : 9.00.1399.06 Install : Successful Log File : C:Program FilesMicrosoft SQL Server90Setup BootstrapLOGFilesSQLSetup0001_EOC429_SQLNCLI_1.log -------------------------------------------------------------------------------- Machine : EOC429 Product : Microsoft Office 2003 Web Components Product Version : 11.0.6558.0 Install : Successful Log File : C:Program FilesMicrosoft SQL Server90Setup BootstrapLOGFilesSQLSetup0001_EOC429_OWC11_1.log -------------------------------------------------------------------------------- Machine : EOC429 Product : Microsoft SQL Server 2005 Backward compatibility Product Version : 8.05.1054 Install : Successful Log File : C:Program FilesMicrosoft SQL Server90Setup BootstrapLOGFilesSQLSetup0001_EOC429_BackwardsCompat_1.log --------------------------------------------------------------------------------
SQL Server Setup failed. For more information, review the Setup log file in %ProgramFiles%Microsoft SQL Server90Setup BootstrapLOGSummary.txt.
We have a static class that makes an HTTPWebRequest to get XML data from one of our vendors. We use this as input to a stored proc in SQLServer2005. When I compile this class and call it from a console application in visual studio it executes in milliseconds, everytime. When I compile it, create the assembly and clr function and execute it in SQLServer, it takes around 14 seconds to execute the first time, then on subsequent requests it is again really fast, until I wait for 10 seconds and re-execute, once again it is slow the first time and then fast on subsequent requests. We do not see this behavior when executing outside SQLServer. Makes me think that some sort of authentication is perhaps taking place the first time the function is run in SQLServer? I have no idea how to debug this further. Anyone seen this before or have any ideas?
Here is the class:
Code Snippet
using System; using System.Collections.Generic; using System.Text; using System.Net; using System.IO;
namespace Predict.Services { public static class Foo { public static string GetIntradayQuote(string symbol) { string returnQuote = "";
HttpWebRequest request = (HttpWebRequest)(WebRequest.Create("http://data.predict.com/predictws/detailed_quote.html?syms=" + symbol + "&fields=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,28,30"));
StreamReader streamReader = new StreamReader(response.GetResponseStream());
returnQuote = streamReader.ReadToEnd();
streamReader.Close(); response.Close();
return returnQuote; } } }
When I run call it from a console app it is fine.
I compile it into a dll and then create the assembly and function as follows:
Code Snippet
drop function fnTestGetIntradayQuoteXML_SJS
go
drop assembly TestGetIntradayQuoteXML_SJS
go
create ASSEMBLY TestGetIntradayQuoteXML_SJS from 'c:DataBackupsCLRLibrariesTestGetIntradayQuote_SJS.dll' WITH PERMISSION_SET = EXTERNAL_ACCESS
go
CREATE FUNCTION fnTestGetIntradayQuoteXML_SJS(@SymbolList nvarchar(max)) RETURNS nvarchar(max) AS EXTERNAL NAME TestGetIntradayQuoteXML_SJS.[Predict.Services.Foo].GetIntraDayQuote
go
declare @testing nvarchar(max)
set @testing = dbo.fnTestGetIntradayQuoteXML_SJS('goog')
print @testing
When I execute the function as above, again, really slow the first time, then fast on subsequent calls. Could there be something wrong with the code, or some headers that need to be set differently to operate from the CLR in SQLServer?
I am trying to 'load' a copy of a SQLServer 2000 database to SQLServer 2005 Express (on another host). The copy was provided by someone else - it came to me as a MDF file only, no LDF file.
I have tried to Attach the database and it fails with a failure to load the LDF. Is there any way to bypass this issue without the LDF or do I have to have that?
The provider of the database says I can create a new database and just point to the MDF as the data source but I can't seem to find a way to do that? I am using SQL Server Management Studio Express.
I'm chasing after a documetn that was available on one of the Microsoftwebsites that was titled somethign like "MS SQL Server Best Practices"and detailed a nyumber of best practices about securing the server.Included in this was revoking public access to the system tableobjects.Can someone post the URL where I can pick this up, or drop me a note oncontacting them for a copy of the document?
I have an app that uses a sqlserver 2000 jdbc driver to connect to a sqlserver 2000.
Is it possible to do a direct replacement of sqlserver 2000 with sqlserver 2005 express just by reconfiguring the app to point to the express? The app would still be using the sqlserver 2000 jdbc driver to try and make the connection.
If that is a possibility, what can be some differences in the configuration? Previously with 2000 the config information I entered is:
server name: "machinename"( or ip). I've also tried "machiname/SQLEXPRESS"
DB name: name of db instance
port: 1433(default)
user and pass.
My attempts so far results in
"java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket."
and
"java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Unable to connect. Invalid URL."
I have an SQLServer Mobile database, and I would like to know if there is a way to upgrade it to SQLServer 2005 (.mdf) database. My database has no records in it, just the structure (tables etc). What I am actually asking is if I can create automatically a new SQLServer 2005 Database with the same structure as my existin SQLSErver Mobile database
I am in the process of planning a server upgrade to sql2005 x64.
I created 2 linked servers: one to a SQL2000 sp4 server and one to a SQL7.0 SP3.
I have the following error when I query the linked servers. OLE DB provider "SQLNCLI" for linked server "IVDM2K" returned message "Unspecified error". OLE DB provider "SQLNCLI" for linked server "IVDM2K" returned message "The stored procedure required to complete this operation could not be found on the server. Please contact your system administrator.". Msg 7311, Level 16, State 2, Line 1 Cannot obtain the schema rowset "DBSCHEMA_TABLES_INFO" for OLE DB provider "SQLNCLI" for linked server "IVDM2K". The provider supports the interface, but returns a failure code when it is used.
I am aware of KB 906954. http://support.microsoft.com/default.aspx?scid=kb;en-us;906954
I applied the instcat.sql on the SQL2000SP4 server and my linked server issues for that one are gone.
However, I ran the instcat.sql script on the SQL7.0 sp3 server and the linked server is still giving me an issue.
Hi, I am new to SQL Server 2005. I tried connecting to my local machine by using my machine name as Server name and then tried running the following query: SELECT * FROM SYS.Objects. It gives me following error: Invalid object name 'sys.objects'.
Whereas, if I connect to my local machine using mahcinenameSQLEXPRESS, then the above mentioned query runs fine.
Why is this difference? What is the difference when I login in these 2 different ways. Any help would be appreciated.
Is there a way to transfer data from a SqlServer db to a SqlServer Express db. I tried to use the backup file of SqlServer, but this file is not valid for SqlServer Express. Or there any alternatives?
I have SQLServer 2005 runs well for months and stop working after install SqlServer2005 SP1. I try to reinstall the SQLServer 2005 but I have problem when install work station component on my and the error is "There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor". Please help me to fix this bug. I do not want to reformat my machine.
When I am trying to insert values into a table which is created using Sql Server. I am gettin Sql Exception : " String or Binary Data would be truncated.The Statement has been terminated. " Please help me out to trouble shoot this error.
Good day ... I need to know how to make a LOB column in sqlserver... In table creation I definde the column that will receive the binary data as nvarchar(MAX) the problem now that whenever I try to read it back I get this error Unable to cast object of type 'System.String' to type 'System.Byte[]'.and when I define the column as varbinary(MAX) it cant real handle large objects I have a method that will return a DataTable Here's the code that I use to write DataTable dt = fm.getFileData(fileID);Response.ContentType = dt.Rows[0][4].ToString();Response.BinaryWrite((byte[])dt.Rows[0][2]);
I have a dynamic table in DB2 which I want it to Sychronize it into SQL Server. I was thinking to Dump the Changes and New data into a flat file and Pull that flat file thru DTS...IS that a right way?
OR
Just Pull changed and new data it with the help of CR DB2 ODBC drivers periodically...
Hi, I am interested in getting a MCP (for MS SqlServer, Exam #: 70-028),Can someone refer me some good book and sample tests for preparing for this exam.
I have a choice of working with either SQLServer or Oracle within my company. I need to advise them which way to go. I need to support a couple of hundred users in a mixed workload environment (OLTP, Batch & Reporting) The O/S will be Windows 2003 Server. My understanding is that Oracle is the better database technically but SQLServer is cheaper and easier to integrate with other MS technologies. My company will most likely buy into whatever technology will deliver value for money but also be secure and be able to scale. Any views gratefully received.
We're starting to think about migrating a 2000 32-bit sql/server to 64-bit (probably 2005). Performance gains are tempting when it can easily be bought, almost a management mantra . I've been doing some reading about the pro's and con's, most of what I've found is pro, very little on the con. My impression is that the 64-bit version(s) is faster in most case, if not all. It would seem that most of the performance improvement is gained by the heavier equipment and overcome memory limitations. Too me, it looks like the integration of hw/os/sql is made very tight on 64-bit, more than 32-bit, which might be the main reason for the improvements.
Call me skeptical but I'm looking for some more con's and a little less on the "great, fantastic, improved and hoorah" that I've been reading. Anyone out there returned to 32-bit after a 64-bit disaster?
Hi, The functional requirement is how to export a sql query or table into foxpro table (*.dbf) via DTS. It was fine to import .dbf into sql table through DSN.But while exporting the destination connection source was not provided for ODBC DSN