Category: SQL Server
-
SQL Server: how to move tempdb database
SQL Server doesn’t support moving TempDB Database using backup/restore or by using detach database methods. In this article I explain the steps you must follow to move TempDB database from one drive to another in SQL Server. However, for the changes to come into effect you must restart SQL Server Service. Start SQL Server Management Studio…
-
SQL Server drop user failed: “The database principal owns a schema in the database, and cannot be dropped. (Microsoft SQL Server, Error: 15138)”
If you try to delete a user who owns a schema, you will receive the following error: Drop failed for User ‘my_user’. (Microsoft.SqlServer.Smo) The database principal owns a schema in the database, and cannot be dropped. (Microsoft SQL Server, Error: 15138) Therefore, to delete the user, you have to find the schema to which it…
-
How to reduce multiple rows in a single row and column with SQL Server
In this sample we want to roll up different rows of a table in a single column, with every row value separated by a comma. I have a simple table like this: and I want to obtain a table with a single row for each continent, with a column thath list all state of the…
-
SQL Server: how to list filegroup of tables and indexes
If you have a database with multiple physical files, you can group each file in a filegroup and store a table or a clustered index in the filegroup you prefer.
-
The jdbc connection with SQL Server 2008 R2 crashes without any response
After a database upgrade from SQL Server 2005 to SQL Server 2008 R2 a webapp jsp crashed in an attempt to connect to the DB.
-
SQL Server: add a linked server to Oracle Database
A linked server allows us to read, from the instance we are using SQL Server, tables stored on a different instance or even on a different DBMS. To do this you must use OLEDB (Object Linking and Embedding Database), API developed by Microsoft that allow access uniformly to a wide variety of data sources.
-
Do update the system tables in SQL Server 2008 R2. Fix “Ad hoc updates to system catalogs are not allowed”
In this version of SQL Server is not possible to make updates to the system tables: To do that you must perform the procedure sp_configure: sp_configure ‘allow updates’,0 go reconfigure go