發表文章

目前顯示的是有「SQL Server」標籤的文章

SQL Developer 3 - Connecting to SQL Server Using Third Party Drivers

Here's a Quick How To Connect SQL Devleoper 3 to SQL Server or MySQL Note that you can use "Check For Updates" to locate the available drivers. Click Help->Check For Updates Then check the boxes to enable Oracle Extensions and Third Party SQL Devleoper Extensions In the list scroll down to JTDS JDBC Driver 11.1.58.17 or directly download the JTDS JDBC Driver Restart SQL Developer  And then Click Tools->Preferences->Database->Third Party Drivers Add the JTDS driver. Now if you get a message that says java.sql.SQLException: I/O Error: SSO Failed: Native SSPI library not loaded. You are missing a DLL. Go to SourceForge and download jtds-version-dist.zip and find the missing DLL called ntlmauth.dll Put that anywhere in your path and restart SQL Developer.

Grant right to user to run update statistics on SQL server

create procedure dbo . up_updstats with execute as 'dbo' as exec sp_updatestats go grant execute on dbo . up_updstats to [ ] go

MS SQL Server: EXECUTE permission denied on xp_sqljdbc_xa_init_ex

When attempting to start the system using MS SQL Server 2008 R2 you get an exception like: javax.transaction.xa.XAException: com.microsoft.sqlserver.jdbc_SQLServerException: failed to create the XA control connection. Error: "The EXECUTE permission was denied on the object 'xp_sqljdbc_xa_init_ex', database 'master' schema 'dbo' To fix the problem you should add user for master database with SqlJDBCXAUser permission. or you may execute the following command (also need to grant right first) EXEC sp_addrolemember [SqlJDBCXAUser], 'username'

Clone database on SQL Server

Method 1: In the SQL Server Management Studio: Right click on the database  Select Tasks Select Copy Database... Follow the step in the Copy Database Wizard Method 2: In the SQL Server Management Studio: Right click on the database Select Tasks Select Back Up... Select the desire database and back up the database to disk Right click on the "Databases" and select New Database... Create a new database with the desire name. Right click on the newly created database Select Tasks Select Restore > Database... to restore the database Select From device to look up the image file.

Remove SQL Server database from single-user mode

Turn off the single-user mode of the database by the following statement: ALTER DATABASE [db_name] SET MULTI_USER WITH NO_WAIT OR exec sp_dboption 'db_user', 'single user', 'FALSE'   If the process is deadlocked, please kill the processed by: select d.name, d.dbid, spid, login_time, nt_domain, nt_username, loginame from sysprocesses p inner join sysdatabases d on p.dbid = d.dbid where d.name = 'jasper_db_sit' go kill spid
Monitoring Your SQL Server 2005 Database Mirror Once you have a database mirror running, it is imperative to monitor the performance of the mirror, and in the case of high performance (asynchronous) mirrors, how far behind the mirror is compared to the principle. With high safety (synchronous) mirroring, performance is critical, as all transactions must be committed on the mirror before they can be committed on the principle. On a high performance mirror, a delay can mean the mirror isn’t as up to date as service levels require, and the transaction log can fill up as transactions cannot be backed up until they have been applied on the mirror. There are different tools for monitoring mirroring: Database Mirroring Monitor (SQL Server Management Studio) Perfmon Counters Catalog Views Database Mirroring Monitor To launch the Database Mirroring Monitor, right click on the database in SSMS, select "Tasks", then "Launch Database Mirroring Monitor...