I'm using the JDBC API's to access a MS-SQL 2000 DB.I have a
manual-commit transaction block involving multiple inserts and
updates. One of the step involves retrieving the auto generated key
(Identity column) which, I presume can be done with @@IDENTITY. My
Question is: Will @@IDENTITY work if Auto Commit is turned off?
Is there a clever way of reteiving the identity of an INSERT query in SQLServer?
The example below is a the first insert (into the "parent" table with an identity column) of a heirarchical multi-table update.
sqlCommand.CommandText = "INSERT INTO Orders VALUES ( Date, Customer ) ; SELECT @@IDENTITY AS ID" ; sqlCommand.ExecuteNonQuery() ;
The ExecuteNonQuery() method returns the number of rows inserted but I need the ID for the INSERT into the "child" table.
My options based on my current understanding appear to be: a) use command parameters and set ID as an output param b) use a stored procedure, use command parameters and set ID as an output param c) issue the SELECT @@IDENTITY as a subsequent seperate command using ExecuteScalar()
Is there a more elegant way to get the ID using SQLServer's "batch" query mechanism and ADO.NET v1.1? Thanks,
Durning install I selected Window's Authentication only, but now it seems we may need to use a Mixed Mode with an SA account etc... is there anyway to switch SQL 2005 to use Mixed Mode after the fact?
We have reports in SharePoint integrated mode which are really slow when compared to native mode. I have been asked to research and give info on what exactly causes the delays.
Any articles which give me information as to what happens when a report is run from SharePoint server and where does it log.
There is a query which when executed in the grid mode(ctrl+d) takes approx 0.02 seconds(about 21,000 rows) But when I execute in the text mode, it takes about 0.40 seconds!! Why is this difference? Also, when the records from this table are read from a VB application, they are equally slow (as in the text mode!) Why is it so slow on the text mode & relatively faster in the grid mode? Has anyone got any idea on ‘Firehose’ style cursor ?(which may speed up access of data in the VB application)
Recently I read such statments 'When SQL Server is run in "lightweight pooling" mode (fiber mode) and the DTC service is started, unexpected behavior may occur.' Can someone say anything about fibe mode?I am appreciated for it.:)
Currently, our Report Builder is running on Local Intranet mode. I'm investigating what the security implications are in changing it to Internet mode. However, I've not been able to find any documentation on this.
Does anyone know of any documentation that addresses this issue or have experience that they can share with changing Report Builder security zone from Intranet mode to Internet mode?
I have a SQL 2005 OTC. CTP version running on Windows 2003 server.
I would like to find out how the SQL server option changed to Windows Authentication mode from Mixed mode over the weekend. From the SQL log, I don't see when it changed. I would like to see Date/Time and client IP. If I can see User ID (windows) that would be great. Where I can find these info in SQL server?
We are using an MSDE database engine (1.0=sql7) as a report scheduler on a web server. I can access MSDE via SQL7 Enterprise Manager to connect and view MSDE, but cannot use the DTS and job scheduling as MSDE seems to lack needed components. Using Microsoft Knowledge Base article Q241397 as a guide, I was able to create a backup of the msdb database using stored procedures including sp_add_job, sp_add_jobserver,etc, that are already present in the msdb database.
My problem is that I need to create and schedule a job for another MSDE database called CE8. This database was created by the reporting app, and contains no stored procedures. It looks to me like only msdb has the needed job scheduling procs. Does this imply that I am supposed to schedule all jobs for all databases via msdb database, or will I need to copy all job scheduling stored procedures into the other CE8 database, then create a job? Hope this makes sense, Randy
I have inherited a deployment running inside a custom .net application. I'm looking to deploy an updated version of a report to the report server. My question is there a manual way of deploying an RDL? I'm afraid of taking down the application entirely and I do not have detailed enough documentation to bring it back up. Thanks!
Interested in creating a manual standby database.Will like toimplement this with Sql Server standard Edition availableAny ideas or recommendationsThanksTY
Assuming that I have a table [users] in a MSSQL 2005 database. the table has two columns. [userId] and [password]. I have an aspx with C# page with two textboxes and a button. I want to let the user login or send him an error message if the password or the username does not match from the table in database. I always made this possible through the template database from administrating the website. but never tried to do it as simple as that. I'm lost here! How can I do it?
In SQL 7.0 jobs that have been scheduled start correctly, but jobs will not start when requested manually. All services are running. The only way to fix this problem has been to reboot the server. Does anybody have any ideas what might be causing this situation.
I would like to automate a simple process which involves trucating a table and importing records back in. What would be the simplest solution to automate this kind of process? I'd like to run this process twice a day.
I have only ever created and deployed SQL 2005 Reports to the report server using Business Intelligence Studio. I have a client who's network will not allow me to remote connect to their Reporting server so that I can deploy their reports.
If I deploy the reports to my own report server, how can I then manually upload them to the Report Server using their Report Manager instad of my Business Intelligence Studio. The Upload files option is only looking for 1 file at a time, however the Business Intelligence solution have the files split up instead of in one neat package.
I never had to use DTS in MSSQL 2000 but I'm finding a need to use SSIS quite a bit in a new position. I know this is subjective, but I looking for suggestions for a reference book with good examples and tutorials.
I recently built a SQL Server x64 server, where I changed the default install path of SSIS. My reason for doing so was to move the SSIS engine off of the system volume, onto a different set of spindles, to reduce potential contention between the OS, the SQL Engine and the SSIS Engine. It is also documented in BOL as an option for the components.
The 64-bit runtime installed fine on the new volume, however, the 32-bit runtime was not installed at all. I checked Program Files (x86) and the directories I chose during the initial install, but only the 64-but runtime exists on the server. Since 64-bit drivers are limited (to put it mildly), I would say about half of the packages I run through jobs require execution of the 32-bit runtime to work.
BOL doesn't seem to indicate that the 32-bit will not install if the default is changed, but the following note indicates that I would not even be able to uninstall/reinstall the components back to the system drives:
A single installation path is shared between SQL Server Integration Services, Notification Services, and Client Components. Changing the installation path for one component also changes it for other components. Subsequent installations install components to the same location as the original installation.
I am wondering if there is a command-line install option to ensure the 32-bit runtime is installed, or if there is a way to install the 32-bit SSIS runtime manually. And if not, can the registry be edited to force a re-install back to the default path?
I'm trying to install SQL2005 Express Edition, the adv. version that includes SSRS. The installation fails because it cannot upgrade the existing SSRS2000. I tried to uninstall the latter from the Add/Rem. Programs, and I get "Fatal Error during installation". IIS was stopped prior to the uninstall attempt.
SSRS2000 will thus not uninstall. How can I do a manual uninstall of it? I need to retain my SQL2000 instance, so the manual uninstall of SSRS must not injure it.
Hey all. I've got a DTS package that's scheduled to run after business hours on the last day of the month. This package copies some tables from an offsite SQL Server, then runs through a series of SQL Statements and finally exports an excel file with the results.
My problem is that the DTS will run if I manually start it, but the scheduled job always fails. Of course, the error I get is that the job failed at step one, and I have no other info.
I'm not a heavy DBA (mor eon the client app side of things), so I'm unsure as to how I can dbug this. Any help would be greatly appreciated!
Hello All Prg's I need your help, I use Database SQL server Express with C# when I entred some data into DB by clciking on the table in server Explorer in Visual Studio 2005 IDE, and then I make SQL in the code as: if (e.KeyCode == Keys.Return) { bool res; int OldPlayerId = 0; string ConnectionStr = Program.Member_Connect; string sqlQuery = "select Player_ID from Player where Player_Code = '" + textBox1.Text + "'"; SqlConnection Sql_connection = new SqlConnection(ConnectionStr); Sql_connection.Open(); SqlCommand command = new SqlCommand(sqlQuery, Sql_connection); SqlDataReader dataReader = command.ExecuteReader(); if (dataReader.HasRows) { if (dataReader.Read()) OldPlayerId = dataReader.GetInt32(0); else MessageBox.Show("rtet"); } else { res = false; } comboBox2.SelectedValue = textBox1.Text; command.Dispose(); Sql_connection.Close(); Sql_connection.Dispose(); comboBox1.SelectedValue = OldPlayerId; } it work correctly on the old data that I entred them manualy, but when I enter new data from my project, this query don't give correct value, it still work correctly on old data,
I tried to take same data by combobox connected to view that contain same sql ,it work always. but I need manualy Sql. Please help me , I am very lating to delever my project... please help me thank you very mush
I've got a java application that connects to a sql server 2000database.The application must access with total permissions to database but Idon't want that anybody can insert or delete data with the corporativeadministrator of sql server 2000.How can I lock the corporative administrator in order to not permitmanual manipulation but my application can work properly?Thanks!
HiI am attempting to take a manual backup of an SQL 2005 database, viaRight Click on MyDatabase --Tasks --Backup[Specify the filename path and type of backup]However, when I try to specify the filename or, in fact, do anything, Ireceive the following errorProperty BackupDirectory is not available for Settings'Microsoft.SqlServer.Management.Smo.Settings'. This property may notexist for this object, or may not be retrievable due to insufficientaccess rights. (Microsoft.SqlServer.Smo)The user I'm logged into the database with, however, has full rightswithin SQL.Does anyone have any ideas?Thanks!
is there a way to start validation of external metadata manual?
My problem is this:
The package uses a variable as connectionstring for flatfile source, and another variable for the destination table. Running the package gives a warning about external metadata that needs to be updated. Normally I update this data by just opening the data flow, and answering the question for updating with yes. This time that deosnt work, I think because the variable is not set, so there can not be any conflicts with external metadata.
I dont want do disable validation, but just validate one time and then save the package.
I have got the error “a network related or instance specific error occurred sql server 2012 “.I have enabled tcp/ip, restarted the services. The sql server service is getting stopped even after the manual restart. I have checked in event viewer and I noticed a error. Here is the error...The log scan number (43:456:1) passed to log scan in database ‘model’ is not valid. This error may indicate data corruption or that the log file (.ldf) does not match the data file (.mdf). If this error occurred during replication, re-create the publication.
We have a scenario where we want to lock and unlock manually some rows in a table in SQL CE database .First the rows we need should be locked. By using a select query the locked rows will be read and processed in front end. Only if the process is completed in front end, manually I need to unlock rows which I have locked earlier. When rows are in locked state no body should be allowed to access that rows . ( should not allow anybody even to put a select query on that locked rows). At the same time appending rows in the table should always be allowed. Is it possible to achieve the above scenario?
We have a scenario where we want to lock and unlock manually some rows in a table in SQL CE database .First the rows we need should be locked. By using a select query the locked rows will be read and processed in front end. Only if the process is completed in front end, manually I need to unlock rows which I have locked earlier. When rows are in locked state no body should be allowed to access that rows . ( should not allow anybody even to put a select query on that locked rows). At the same time appending rows in the table should always be allowed. Is it possible to achieve the above scenario?
I'm trying to install SQL Mobile from a Windows XP SP machine to a Dell Axim X51v mobile device.
I've read the installation procedures and I've been unable to locate the cab files. I have located "DLLs" and Zip files but no CAB files. Where else might I find the CAB files?
I have a query to get data group by High, Medium and Low so only three rows will be returned.
select sum(case .... ) then 1 else 0 end) as [Column1], sum(case .... ) then 1 else 0 end) as [Column2], sum(case .... ) then 1 else 0 end) as [Column3] from sometable Group by High, Medium, Low
I want to manually add High, Medium and Low to each row's first column. the final result should look like:
Column1 Column2 Column3 High 123 123 123 Medium 123 123 123 Low 123 123 123