RSS

Monthly Archives: January 2010

Dynamic Alter Query for all columns in database

 

I submit this SQL statements maybe it’s useful for you all

it’s dynamic query which used to change current data types for selected columns in tables with specific name to new data types and you can make a lot of things by this SQL Statements

Example

declare @tb nvarchar(200),@col nvarchar(200)

DECLARE Table_Cursor CURSOR FOR

/*Select columns you want to change and put them in cursor*/

SELECT t.name tb, c.name col FROM sys.tables t inner join sys.columns c on t.object_id=c.object_id where c.name like ‘columnPrefix%’

order by tb

OPEN Table_Cursor;

FETCH NEXT FROM Table_Cursor into @tb,@col;

WHILE @@FETCH_STATUS = 0

BEGIN

/*Start Change Current data types to new data types */

select @tb,@col

Execute(‘ALTER TABLE ‘+@tb+‘ ALTER COLUMN ‘+@col+

nvarchar(300) null’) ;

FETCH NEXT FROM Table_Cursor into @tb,@col;

END;

CLOSE Table_Cursor;

DEALLOCATE Table_Cursor;

GO

Advertisements
 
Leave a comment

Posted by on January 15, 2010 in Cursor, OLTP, SQLServer, T-SQL

 

Tags: , ,

Business Intelligence

Business intelligence solves the gap between IT and Business needs or top Management, How? Most of us think in technology and how to use it without thinking how to satisfy business needs with this technology this is main gap between top management and IT, so from long time ago big Software development companies start to focus on this gap by developing, enhancing or improving tools used for these needs as they know that BI applications will become the first technology in market trend as Gartner said in January 2008.

Business users see Business Intelligence through Static reports, Analytical Reports and Scorecards which can gathered in one place named dashboard to simplified decision support. If user want more than decision support let’s add data mining component to be decision making.

So how Microsoft technologies support business intelligence

image

Figure 1

as you can see in figure 1 from down to top

1. Start Extract Data From Heterogeneous data sources using Microsoft SQL Server Integration Service to data warehouse

2. You can build OLAP Database(Cubes) over data warehouse using Microsoft SQL Server Analysis Service

3. You can build simple reports over Data warehouse directly or over Cubes using Microsoft SQL Server Reporting Service to display report to end users

4. You can use Excel to display Data from Data warehouse or from cubes which you can then apply Pivot Tables, Pivot Charts and others

5. You can build Dashboard that includes many types of advanced reporting components like Scorecards, Analytical Reports, Strategic reports…etc using Microsoft Office Performance Point Server 2007

6. You can build also Dashboard using Microsoft Office SharePoint Server to display inside it web parts from Excels, or Performance Point Items or reporting service.

This is the simple story about BI Platform using Microsoft Technologies

You should also know that data mining is part from Microsoft Analysis Service and you can use it simply as business users from Microsoft Excel .

 

Tags: , , , , , , , , , , , , , ,

 
%d bloggers like this: