The mssql way:
update user_asset_tag
set uat.assetTypeId = ua.assetTypeId
from user_asset_tag uat
join user_asset ua on ua.id = uat.userAssetId
The Oracle way:
update (
select ua.*
, uat.AssetTypeId as assetTypeId2
from user_asset ua
join user_asset_tag uat on uat.userassetid = ua.id
)o
set o.assetTypeId2 = o.assetTypeId
select * from(
select t1.*,rownum rn from table t1 where rownum < 11
)where rn between 3 and 5
Script for creating database with countries. Read the rest of this entry »
Avoid ‘An insert exec statement cannot be nested’ by preparing a temp table from calling procedure and populate it by inner stored procedure.
Read the rest of this entry »
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[procedure]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[procedure]
if ( object_id( 'tempdb..#test' ) is null )
-- table doesn't exist
print 'table doesnt exist'
else
-- table exists
print 'table exists'
select * from INFORMATION_SCHEMA.COLUMNS
where TABLE_NAME=’tablename’
and COLUMN_NAME=’columname’
The following error occurs when starting any of the mysql tools, s:
(mysql-administrator-bin:6452): Gtk-WARNING **:
Unable to locate theme engine in module_path: "ubuntulooks"
Read the rest of this entry »