Tag: sql-server-2008-r2

Optimize For in CTE or Subquery

Setup: I’m experimenting with the OPTIMIZE FOR clause in SQL Server 2008 R2. I’ve put the following at the end of my query. OPTION (OPTIMIZE FOR (@UserType= ‘M’, @Date UNKNOWN)) Issue: However, I’m getting the below error. The variable “@UserType” is specified in the OPTIMIZE FOR clause, but is not used in the query. This […]

FOR INSERT trigger not firing

I am having a problem with the insert trigger this is my trigger code : SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO create TRIGGER [dbo].[Vtriggers] ON [dbo].[stats] FOR INSERT AS INSERT INTO [NewDB].dbo.NewStat (StatID) SELECT ID FROM inserted the weird thing is , i build another table exact like the table that i want […]

Generate Script In SQL Server 2008 Is Very Slow

Time of Get Script From My Database In SQL Server Management Studio 2008 R2 is about 45:00 Minute. count of tables : 380 Count of views : 89 Count of SP : 109

Log file for ReportServerTempDB growing unexpectedly

The transaction log file for the ReportServerTempDB database (database installed with Reporting Services) is has grown to over 100GB. And I’m not sure why. Here are the file sizes: D:\SQLDatabases\ReportServer.mdf – 0.7GB G:\SQLDatabases\ReportServer.ldf – 1.8GB E:\SQLDatabases\ReportServerTempDB.mdf – 5GB G:\SQLDatabases\ReportServerTempDB.ldf – 107.6GB Recovery mode for all these database is SIMPLE. We are using SQL Server 2008 […]

SQL Server 2008 R2 (64-bits) – Service Pack 2 – UC5 can't find Adobe's iFilter 11.0

I am getting the following error when rebuilding a catalog containing a table with a stored PDF (it does work for Word documents). Warning: No appropriate filter was found during full-text index population for table or indexed view ‘[Test].[dbo].[Table_1]’ (table or indexed view ID ‘2105058535’, database ID ‘6’), full-text key value ‘911’. Some columns of […]

SSIS in SQL Server: How to get it to store password

I am an Oracle guy who suddenly got SQL Server and SSIS dropped in his lap, so I am probably not using the terminology in the correct manner, but here goes: There is a SSIS package that pulls data from the Oracle database into our SQL Server 2008 R2 warehouse. If I open this package […]

SELECT Count of MAX value over 2 columns

This has been stumping me for a little bit and I can’t seem to get the right query Table 1: ╔════════════════════╗ ║ Record Level ║ ╠════════════════════╣ ║ 1 0 ║ ║ 1 1 ║ ║ 1 2 ║ ║ 2 3 ║ ║ 2 4 ║ ║ 2 5 ║ ║ 3 2 ║ ╚════════════════════╝ […]

PIVOT operator not working in SQL Server 2008 R2

I have SQL Server 2008 R2. I am trying to convert one row to column to get result in desired format. Table name : GenderYearWise Year Gender Total ——————— 2005 Female 374 2005 Male 1579 2006 Female 853 2006 Male 4769 I want to get result in following format : Gender 2005 2006 ———————- Female […]

Sql Server 2008 r2 does not recognize process when triggered

i’ve installed SQL Server 2008 R2 On my machine (my machine runs windows server 2003) some of the tables inside my db are fireing triggers (when insert,delete,update occurs) the trigger result supposed to reach some process (triggersReceiver.exe via shared memory) that waits for the triggers. the problem is that the SQL Server 2008 r2 does […]

Error connecting to linked server after recompile

I have a ASP.NET MVC website in IIS 7 running against a SQL Server 2008 R2 database, in which I have a linked server set up. The linked server is set up so that a SQL account from my database is linked to a SQL account on the linked server. All works fine until I […]

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.