Friday, October 28, 2011

Version error while executing SSIS package

To clarify a bit more, packages created in Visual Studio 2008 are SQL Server 2008 packages. If you have both 2005 and 2008 installed on your system, you'll need to provide the explicit path to the 2008 version of DTEXEC when you run the package:

Tuesday, October 25, 2011

MS SQL 2008 DTS package error

Description: The version number in the package is not valid. The version number cannot be greater than current version number.
you'll need to provide the explicit path to the 2008 version of DTEXEC when you run the package:

How to setup the PREREQS for oracle databases

ALter database test
Set READ_COMMITTED_SNAPSHOT = ON
go
Alter database test
Set ALLOW_SNAPSHOT_ISOLATION = ON
go

Select the SQL Server authentication option
when you set the security
properties for the database.
go
>>The schema owner for the above repositories will require DB_OWNER and
>>BULK_INSERT.
>>
>>Run the collate script on the repositories:

>>DECLARE @collate sysname
>>SELECT @collate = convert(sysname, serverproperty('COLLATION'))
>>IF ( charindex(N'_CI', @collate) > 0 )
>>BEGIN
>>select @collate = replace(@collate, N'_CI', N'_CS')
>>exec ('ALTER database OBIAPP COLLATE ' + @collate)
>>END
>>GO

How to reindex all tables in a database

Let assume that the database is named clo
USE clo
GO
EXEC sp_MSforeachtable @command1="print '?' DBCC DBREINDEX ('?', ' ', 80)"
GO
EXEC sp_updatestats
GO

Monday, October 24, 2011

Find failed SQL jobs in one click

--The code to convert run_date and run_time into an actual--datetime is NOT my code, and I can't remember what blog post--I found it from. But it's not mine.select sj.name, sjs.step_name,CONVERT ( DATETIME, RTRIM(run_date))+(run_time * 9+ run_time % 10000 * 6 + run_time % 100 * 10) / 216e4from msdb.dbo.sysjobs sjinner join msdb.dbo.sysjobsteps sjson sj.job_id = sjs.job_idinner join msdb.dbo.sysjobhistory sjhon sjs.job_id = sjh.job_idand sjs.step_id = sjh.step_idwhere sjh.run_status = 0and datediff (hour, (CONVERT ( DATETIME, RTRIM(run_date))+(run_time * 9+ run_time % 10000 * 6 + run_time % 100 * 10) / 216e4), current_timestamp) <= 24

Service Pack 2 for MS Sql 2008 is it worth it?

What's New:
Reporting Services in SharePoint Integrated
Mode. SQL Server 2008 SP2 provides updates for Reporting Services
integration with SharePoint products. SQL Server 2008 SP2 report servers can
integrate with SharePoint 2010 products. SQL Server 2008 SP2 also provides a new
add-in to support the integration of SQL Server 2008 R2 report servers with
SharePoint 2007 products. For more information see the “What’s New in SharePoint
Integration and SQL Server 2008 Service Pack 2 (SP2)” section in What's New (Reporting
Services)
.
SQL Server 2008 R2 Application and Multi-Server Management Compatibility
with SQL Server 2008.
SQL Server 2008 Instance Management.With SP2 applied, an instance of
the SQL Server 2008 Database Engine can be enrolled with a SQL Server 2008 R2
Utility Control Point as a managed instance of SQL Server. For more information,
see Overview of SQL
Server Utility
in SQL Server 2008 R2 Books Online.
Data-tier Application (DAC) Support.Instances of the SQL Server 2008
Database Engine support all DAC operations delivered in SQL Server 2008 R2 after
SP2 has been applied. You can deploy, upgrade, register, extract, and delete
DACs. SP2 does not upgrade the SQL Server 2008 client tools to support DACs. You
must use the SQL Server 2008 R2 client tools, such as SQL Server Management
Studio, to perform DAC operations. A data-tier application is an entity that
contains all of the database objects and instance objects used by an
application. A DAC provides a single unit for authoring, deploying, and managing
the data-tier objects. For more information, see Designing and Implementing
Data-tier Applications.

Transaction logs full in MS SQL 2008

This script should help. Assuming that your database is named test.
--changes the database to simple mode
Alter database test
set recovery simple
go
--makes the transaction log one mb
DBCC shrinkfile (test,1)
go
--changes the database back to full recovery
Alter database test
set recovery full