Wednesday, June 30, 2010

Alter column in SQL Server

Example:
alter table permitsystem.[dbo].[ProjectLandOwner]
alter column
LandOwnerBusinessName nvarchar(200)

Max Length of Data in a column

Use the datalength function to find the length of a "text" column in SQL Server.

To find the max length of a value in your column combine with the Max function.

select MAX( datalength(last_name))
from LP_COMMON.fpm.xAD_LANDOWNERS

Friday, June 25, 2010

Create Table as in SQL Server

select * into [new_table_name]from [table_name]