Turn off Identity Whilst Inserting SQL Table Row

Inserting table rows including the index idents will give an error similar to: Cannot insert explicit value for identity column in table TableName when IDENTITY_INSERT is set to OFF. I was copying the contents of a database table from one installation of DotNetNuke to another. Wishing to maintain the table structure, parent and child references […]

Read More… from Turn off Identity Whilst Inserting SQL Table Row

List Large Tables

An enlarged DotNetNuke database can affect performance and also be an indication of a more serious issue. Listing table sizes can help to understand and resolve issues. I have used this piece of SQL to check whether the site log or the event log is over sized on a website. CREATE TABLE #temp ( table_name […]

Read More… from List Large Tables

Convert Text to nText

Changing a column having type text to its corresponding type ntext is a little more complicated than changing some of the other field types, for example varchar to nvarchar. To change a field from type varchar to nvarchar simply requires the column type to be changed, using some code like below: IF EXISTS (SELECT * […]

Read More… from Convert Text to nText

SQL Password Must Change

I have created a number of users and databases using the SQL Server Management Studio. Unfortunately, whilst creating a new user login, unticking of the entries relating to the password policy can be forgotten: Enforce password expiration User must change password at next login With these entries ticked and enforced an automated login from a […]

Read More… from SQL Password Must Change