The SQL UNION command is used to gather the entries from two tables which meet the given criteria. The SQL Union command is used to select entries from two tables It requires that the items in each of the select are in the same order and that each comparable item in the same position is […]
Category: SQL
MSSQL Data Types
A summary of the MS SQL data types is given in the table below: Data Type Syntax Comments int int Whole number from -2^63 (-9,223,372,036,854,775,808) to 2^63-1 (9,223,372,036,854,775,807), inclusive. smallint bigint Whole number from -2^31 (-2,147,483,648) through 2^31 – 1 (2,147,483,647), inclusive. smallint smallint Whole number from 2^15 (-32,768) through 2^15 – 1 (32,767), inclusive. […]
Create a New Database User
A new Database SQL user can be added from the DotNetNuke Host SQL page. This user can then be used as a replacement for the existing user in the connection string in the web.config file. In the example below a new user called , dnnDbUser, will be created and added as a db owner of […]
Get Stored Procedure Using SQL
Not having backend access to a DotNetNuke website, or readily able to download a backup of the database. My thoughts turned to how to review a stored procedure with SQL from the SQL host page in DotNetNuke. SELECT text FROM syscomments WHERE id = (SELECT id FROM sysobjects WHERE name = ‘StoredProcedureName’) ORDER BY colid […]
Copy the Content of one Table to Another
The content of one table can be copied to another table using the INSERT INTO command. For example: INSERT INTO table1 SELECT * FROM table2 The select can also be conditional with the addition or the chosen fields to be copied over. INSERT INTO table1 SELECT FirstName,LastName,City FROM table2 Or it may be extended further […]


