sql-server-2008

How to install sql server management studio 2008 component only

Hi, below is a list of the sql components that I installed in the Visual Studio 2010 Professional setup. Sadly, while trying to work I could not find sql server management studio 2008 . Is there a way to download the sql server management studio 2008 separately and install only that component ? Since in the past I installed sql server...

Capturing object dependencies at execution time in SQL Server

Is there any sane way to capture execution-time object dependencies in SQL Server? For instance, take this dynamic SQL scenario: DECLARE @table SYSNAME = 'SomeTable' DECLARE @column SYSNAME = 'SomeColumn' DECLARE @proc SYSNAME DECLARE @command NVARCHAR(MAX) = 'SELECT TOP 1 @proc = '+@column+' FROM '+@table EXEC sp_executesql @command, ...

TIFF IFilter not properly reading text in VARBINARY column.

link textI want to use the TIFF IFilter built in to Windows 2008 Server R2 with Full-Text search in SQL Server 2008... also R2. I have installed the filter through server manager and updated the "Force TIFF IFilter to perform OCR for every page in a TIFF document" Local Group Policy setting in Computer Configuration -> Administrative Te...

For Auditing Triggers or CDC

Hi All, I wanted to see if others are using SQL Server 2008 Change Data Capture and if so how do you like it? We currently use APEXSQL Audit Triggers for our auditing purposes which seems to work pretty well, but means we have to add triggers to all of our "audited" tables. Some of the articles I have read have pointed out things lik...

Capture USER_ID For Delete Operation

Hi All, We currently use Auditing triggers to track all of our DB changes. In order to capture the user_id for the person that submitted the delete we have to use an update and then have the trigger perform a delete so we can capture that USER_ID. Does anyone else use a different approach or have a better approach for this process? T...

How do I query a VARCHAR as an integer

Hello, I have a column that holds VARCHARs and I have a flag that determines if the value is a string or integer. I would like perform a search on the integers but they are stored as VARCHAR. How do I do this? I am trying to do this in a where clause. var q = from x in context.table where x.Criteria > 0 select new ...

I need a SQL statement that returns the number rows in a table with a specific value.

I'm sure this will equate down to the use of the COUNT statement but I'm not very good at SQL. Here are my SQL Tables. Teams Table: TeamId TeamName RosterSpots ----------------------------------------------- 1 Miami Heat 12 2 New York Knicks 10 Players Table: PlayerId PlayerName ...

Anybody using SQL Source Control from Red Gate

Hi all, We have been looking into possible solutions for our SQL Source control. I just came across Red Gates SQL Source control and wondered if anyone has implemented it? I am going to download the trial and give it a shot, but just wanted to see if others have real experience. As always greatly appreciate the input --S ...

How do I JOIN a third table in my SQL statement which returns a COUNT without losing the 0 count items?

A continuation from this question I need a SQL statement that returns the number rows in a table with a specific value. We left off with a SQL statement as follows... SELECT t.teamid, t.teamname, COALESCE(COUNT(p.playerid), 0) AS playercount, t.rosterspots FROM TEAMS t LEFT JOIN PLAYERS p ON p.team...

Error when trying to run an update statement and getting "SQL statement is nested too deeply"

Hi All, I am getting this error when I run a certain SQL statement. I have looked into this and haven't really got anywhere. Some part of your SQL statement is nested too deeply. Rewrite the query or break it up into smaller queries I cannot post the actual query with data as it contains some sensative information but basically I ...

Excel 2003 VBA fails to call SQL sproc with temporary tables

I am trying to get resultset from SQL 2008 sproc into Excel 2003 using VBA. It worked for few sprocs but when I tried the one which uses temp table or table variable VBA fails with err 3704 "Operation is not allowed when the object is closed" on the following line: Sheet1.Range("A2").CopyFromRecordset rsMyDB If I comment out select i...

Convert string to DateTime in SSIS

The data from source has string data type and sometime has invalid dates, empty column ('') I want to check whether it is valid date and convert string to date time. How can i do this in SSIS? My string value is already formatted as mm/dd/yyyy. ...

How to see the query that defines a view in SQL 2008

I am sure this is a simple question, but I am having no luck getting it answered. I have a number of views in a MS SQL 2008 database I am now supporting but I am not able to find how to access the queries that define the views. I need to see that to get a list of all tables and databases the views are accessing. ...

SQL Collalation issue

Hi there, I have noticed in my Local SQL Express 2008 the collation of my system databases are different then my customs tables I created our servers. Is there an options to set the Collalation when installing? I tried to change it in the database properties but get errors ...

SQL Server 2008 Profiler "pfutil" Error on logon

I try to connect SQL Profiler to my local SQL Server 2008 instance, and get the following error: TITLE: Connect to Server ------------------------------ Cannot connect to (local). ------------------------------ ADDITIONAL INFORMATION: Unknown error. (pfutil) ------------------------------ BUTTONS: OK ------------------------------ ...

Where is the correct place to report a bug in SQL Server?

I have found a fairly insignificant bug in SQL Server 2008. I would like to report this to Microsoft, however, when I went to https://support.microsoft.com/ I realized that I may need to spend $300 CAD to report it. Is there a place where I can report this bug without it costing me any money? Below is a sample of the bug: Works: ...

SQL Server - Give a Login Permission for Read Access to All Existing and Future Databases

I have a stored procedure that finds all the existing databases and reads from a table in each one. Is there a way I can give a login read access to all databases, and to all future databases i.e., I won't have to do anything when a new database is added? Is there a server role that would work? Is there a way to make a SQL agent job ...

How do I write an if else statement in Reporting Services expression language?

I would like to write a Reporting Services "Expression" that basically behaves as the following (pseudo code)... if ([Fields!StateProvinceId.Value] == 1) { return "Ontario"; } else if ([Fields!StateProvinceId.Value] == 2) { return "Quebec"; } else if ([Fields!StateProvinceId.Value] == 3) { return "Manitoba"; } // ... // more ca...

SQL Server 2008: Rename an element using XML DML?

Is it possible to use an XML DML statement to rename an element in an untyped XML column? I am in the process of updating an XML Schema Collection on an XML column and need to patch the existing XML instances by renaming one element before I can apply the latest schema. As far as I can tell from the docs you can only insert / delete no...

SQL Server 2008: log autogrow cancelled by user or timed out?

Hello everyone, I met with the following error in database log, any ideas what is wrong? Autogrow of file 'Foo_log' in database 'Foo' was cancelled by user or timed out after 3328 milliseconds. Use ALTER DATABASE to set a smaller FILEGROWTH value for this file or to explicitly set a new file size. thanks in advance, George ...