windows 7 audio device is disabled error

http://www.pcgamer.com/the-most-frustrating-windows-7-audio-problem-solved/

http://www.techsupportforum.com/forums/f217/solved-no-sound-the-unsolvable-problem-take-the-challenge-594113.html

 

Advertisements

Important Links

These all are external site links, that I found in internet

1) how to enable reporting services on windows 7 machine

http://blogical.se/blogs/jahlen/archive/2009/10/02/setting-up-sql-server-reporting-services-on-windows-7-vista-or-windows-2008.aspx

RSReportServer.config file location

C:\Program Files\Microsoft SQL Server\MSRS10.SQL2008\Reporting Services\ReportServer

2) SSRS Date Format ( sql server reporting services)

http://thavash.wordpress.com/2007/10/02/date-formatting-in-reporting-services-list-of-format-codes/

3) html colours combination that can be use in crystal report also. 

http://www.tayloredmktg.com/rgb/

4) Screen camptering as video

http://www.techsmith.com/download/camtasia/

 

deletion in chunks

Deleting a big data using a while loop like this avoid from transaftion log increasing in size quickly

WHILE 1=1
BEGIN
delete top (1000) from order_detail where customer_id=42 and purchase_date >= 06302014
if @@rowcount<1000 break
END

SQL Server Profiler Duration Column

Reference Links :

http://msdn.microsoft.com/en-us/library/ms175848.aspx

http://stackoverflow.com/questions/2590304/unit-of-measurement-for-duration-column-in-sql-profiler

Main Poins :

Beginning with SQL Server 2005, the server reports the duration of an event in microseconds (one millionth, or 10-6, of a second) and the amount of CPU time used by the event in milliseconds (one thousandth, or 10-3, of a second).

In SQL Server 2005 and later, the SQL Server Profiler graphical user interface displays the

Duration column in milliseconds by default,

but when a trace is saved to either a file or a database table, the Duration column value is written in microseconds.

1 second = 1 000 000 micro

DDL auditLog in sql server

CREATE TABLE AuditLog
( ID INT PRIMARY KEY IDENTITY(1,1),
Command NVARCHAR(1000),
PostTime NVARCHAR(24),
HostName NVARCHAR(100),
LoginName NVARCHAR(100) )
go
CREATE TRIGGER Audit ON DATABASE
FOR DDL_DATABASE_LEVEL_EVENTS
AS
DECLARE @data XML
DECLARE @cmd NVARCHAR(1000)
DECLARE @posttime NVARCHAR(24)
DECLARE @spid NVARCHAR(6)
DECLARE @loginname NVARCHAR(100)
DECLARE @hostname NVARCHAR(100)
SET @data = EVENTDATA()
SET @cmd =
@data.value(‘(/EVENT_INSTANCE/TSQLCommand/CommandText)[1]’,
‘NVARCHAR(1000)’)
SET @cmd = LTRIM(RTRIM(REPLACE(@cmd,”,”)))
SET @posttime = @data.value(‘(/EVENT_INSTANCE/PostTime)[1]’,
‘NVARCHAR(24)’)
SET @spid = @data.value(‘(/EVENT_INSTANCE/SPID)[1]’,
‘nvarchar(6)’)
SET @loginname = @data.value(‘(/EVENT_INSTANCE/LoginName)[1]’,
‘NVARCHAR(100)’)
SET @hostname = HOST_NAME()
INSERT INTO dbo.AuditLog(Command, PostTime,HostName,LoginName)
VALUES(@cmd, @posttime, @hostname, @loginname)
GO

By Mahendra Thakur Posted in Database

Create index syntax from DMV table for missing indexes

I got this in microsoft msdn site

PRINT ‘Missing Indexes: ‘
PRINT ‘The “improvement_measure” column is an indicator of the (estimated) improvement that might ‘
PRINT ‘be seen if the index was created. This is a unitless number, and has meaning only relative ‘
PRINT ‘the same number for other indexes. The measure is a combination of the avg_total_user_cost, ‘
PRINT ‘avg_user_impact, user_seeks, and user_scans columns in sys.dm_db_missing_index_group_stats.’
PRINT ”
PRINT ‘– Missing Indexes –‘
SELECT CONVERT (varchar, getdate(), 126) AS runtime,
mig.index_group_handle, mid.index_handle,
CONVERT (decimal (28,1), migs.avg_total_user_cost * migs.avg_user_impact * (migs.user_seeks + migs.user_scans)) AS improvement_measure,
‘CREATE INDEX missing_index_’ + CONVERT (varchar, mig.index_group_handle) + ‘_’ + CONVERT (varchar, mid.index_handle)
+ ‘ ON ‘ + mid.statement
+ ‘ (‘ + ISNULL (mid.equality_columns,”)
+ CASE WHEN mid.equality_columns IS NOT NULL AND mid.inequality_columns IS NOT NULL THEN ‘,’ ELSE ” END + ISNULL (mid.inequality_columns, ”)
+ ‘)’
+ ISNULL (‘ INCLUDE (‘ + mid.included_columns + ‘)’, ”) AS create_index_statement,
migs.*, mid.database_id, mid.[object_id]
FROM sys.dm_db_missing_index_groups mig
INNER JOIN sys.dm_db_missing_index_group_stats migs ON migs.group_handle = mig.index_group_handle
INNER JOIN sys.dm_db_missing_index_details mid ON mig.index_handle = mid.index_handle
WHERE CONVERT (decimal (28,1), migs.avg_total_user_cost * migs.avg_user_impact * (migs.user_seeks + migs.user_scans)) > 10
ORDER BY migs.avg_total_user_cost * migs.avg_user_impact * (migs.user_seeks + migs.user_scans) DESC
PRINT ”
GO

By Mahendra Thakur Posted in Database

How to recreate master DB in sql server 2008

http://msdn.microsoft.com/en-us/library/dd207003.aspx

create a new msdb database

Stop all services connecting to the Database Engine, including SQL Server Agent, SSRS, SSIS, and all applications using SQL Server as data store.
Start SQL Server from the command line using the command: NET START MSSQLSERVER /T3608
For more information, see Start, Stop, Pause, Resume, Restart the Database Engine, SQL Server Agent, or SQL Server Browser Service.
In another command line window, detach the msdb database by executing the following command, replacing with the instance of SQL Server: SQLCMD -E -S -dmaster -Q”EXEC sp_detach_db msdb”
Using the Windows Explorer, rename the msdb database files. By default these are in the DATA sub-folder for the SQL Server instance.
Using SQL Server Configuration Manager, stop and restart the Database Engine service normally.
In a command line window, connect to SQL Server and execute the command: SQLCMD -E -S -i”C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Install\instmsdb.sql” -o” C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Install\instmsdb.out”
Replace with the instance of the Database Engine. Use the file system path of the instance of SQL Server.
Using the Windows Notepad, open the instmsdb.out file and check the output for any errors.
Re-apply any service packs or hotfix installed on the instance.
Recreate the user content stored in the msdb database, such as jobs, alert, etc.
Backup the msdb database.

NET START MSSQL$SQL2008 /T3608

C:\Windows\system32>SQLCMD -E -S mahendra-pc\sql2008 -d master -Q “EXEC sp_detac
h_db msdb”

C:\>SQLCMD -E -S mahendra-pc\sql2008 -i “C:\Program Files\Microsoft SQL Server\M
SSQL10.sql2008\MSSQL\Install\instmsdb.sql” -o “C:\Program Files\Microsoft SQL Se
rver\MSSQL10.sql2008\MSSQL\Install\instmsdb.out”

C:\>”C:\Program Files\Microsoft SQL Server\MSSQL10.sql2008\MSSQL\Install\instmsd
b.out”

By Mahendra Thakur Posted in Database