To receive quantity of rows of the returned records of SQL query, you should use function @@ROWCOUNT. Function @@ROWCOUNT returns the quantity of rows, which were used in a query.
To receive quantity of rows of the returned records of SQL query, you should use function @@ROWCOUNT. Function @@ROWCOUNT returns the quantity of rows, which were used in a query.
How to get as SQL query result the list of databases in SQL server.
select name, database_id from sys.databases
When you modify columns of a table in MS SQL management studio, you got the message "Saving changes is not permitted. The changes you have made require the following table to be dropped and re-created … " (Figure 1). The reason of this is re-creating of table. It's really important for productive environment but not very for test ones.
Rename table in MS SQL Server:
sp_rename 'old table name', 'new table name'
In this post I will write about SQL conditions. It seems to me that construction "IF ... ELSE" you can find in any language. Transact SQL is not exclusion.
Let’s see IF ... ELSE in action on the sample below. (read more...)
There are two functions for converting SQL data types from one to another. They are CAST and CONVERT. The second function is the best solution for converting datetime to format you need. (read more...)
Field with autoincrement is very useful thing and it's often used in MySQL. In MSSQL you can also need to use this tool. There are two ways to do it. (read more...)
If you have some site collections but your database grows every day. In MSSQL size of database should be less than 200 Gb. So if your content database size less than 100Gb you can easily use only 1 database – it’s easier to backup and restore it. (read more...)
If you still don’t have a content database to move site collection, you need to create it. You can do it via SharePoint Central Administration or via PowerShell. Your account must be at least dbcreator role (better db_owner). (read more...)
Before moving sites between content databases, you should know a quantity of your databases for your WebApplication. You can move sites between content databases only if they are in the same WebApplication! (read more...)