sql-server-2008

SQL Profile and DTA

Here is the scenario: I have run a trace for few hours during maximum server load using the three events (never mind this) that DTA looks for. I then stop and feed this profiler load to DTA. It does its tuning work and gives me feedback on what indexes need to be put. Here is the question: Several (upto 15) different indexes recomme...

Crystal Reports XI R2 Compatible with SQL Server 2008?

I'm currently running Crystal Reports XI R2 on SQL 2000. I need to migrate to SQL Server 2008 asap, but am no longer on Crystal Support. Can anyone tell me if CR XI R2 Server is compatible with SQL Server 2008? I Googled it but came up empty. ...

Tracing or Logging Resource Governor classification function behavior in Sql Server 2008

I'm trying to use the Resource Governor in SQL Server 2008 but I find it hard to debug the classification function and figure out what the input variables will have, i.e. does SUSER_NAME() contain the domain name? What does the APP_NAME() string look like? It's also hard to verify that it's working correctly. What group did the functi...

Sql Server DateTime to DateTimeOffset

I have an old table with a few rows that has a datetime column. I want to switch this to datetimeoffset but i want to be able to transfer the data that already exists. So i'm doing something like [1]. This works but the offset set is 0 when i do the dattime to datetimeoffset assignment. Fortunately the offset that i want to set it to i...

Is using the XML datatype as a DataTable acceptable?

For some reason I feel like I'm going about this the painful way. I have an INSERT xml list. I'm using XML because I need to pass in more than one dynamic value. Since we're saving the event, I already have that ID. What I won't know is the Group or Room ID, so I'm using XML to essentially pass in a datatable. Here is an example INSERT...

Using @@IDENTITY in SQL on a specific table

How can I get the @@IDENTITY for a specific table? I have been doing select * from myTable as I assume this sets the scope, from the same window SQL query window in SSMS I then run select @@IDENTITY as identt It returns identt as null which is not expected since myTable has many entrie in it already.. I expect it to return the...

searching for address matches using sql server 2008 full text search

Hi, I am not sure how to search for address matches using sql server 2008 full text search. This is what I tried but it doesn't return any records. TableA ------ Address1 Address2 City State Zip All the above columns in the table are full text indexed. Let's say if the user enters "123 Apple street FL 33647" and I have a record in th...

How can I tell if a SQL Server MDF file is getting full/might need to grow?

I know that the transaction log/ldf file fills up and grows and that I can see how full it is by running: DBCC SQLPERF(logspace) Is there a corresponding command to check on the status of the data/mdf file? Why I'm interested: I'm troubleshooting a simple .NET app that uses SqlBulkCopy to import data. Normally this works fine but ...

Report Builder 3.0 CTP

I have downloaded MS SQL Server Report Builder 3.0 CTP recently. I am bit confused and have following questions: Can I use Report Builder 3.0 with MS SQL server 2008 Express with Reporting services (NOT MS SQL Server 2008 R2 CTP)? Is there any time limit is attached with usage of Report Builder 3.0 CTP, as it is CTP version? Generally ...

New SQL Server - help with request of requirements for installing server w/SQl Server

So my employer has asked me to come up with list of "requirements" to put in a SQL Server. Just very general, however I am pretty inexperienced at such a thing. So my list looks like: SERVER SQL SERVER ENTERPRISE EDITION ADDITIONAL SOFTWARE and that is about it. I know very little about the make up of servers, so I have no idea what...

TRANSACT SQL - How to manually order/index a table based upon a select/where statement

Hello all, I have sql puzzler today. I have the following sql : SELECT MemberId, UnitId, MaterialLevel, MaterialText, ProductPercentage, ProductPriority FROM tblWeights ORDER BY MemberId, MaterialLevel, MaterialText, ProductPercentage DESC Now, currently the ProductPriority is e...

Getting a Subset of Records along with Total Record Count

I'm working on returning a recordset from SQL Server 2008 to do some pagination. I'm only returning 15 records at a time, but I need to have the total number of matches along with the subset of records. I've used two different queries with mixed results depending on where in the larger group I need to pull the subset. Here's a sample: S...

SQL 2008 setting compatibility level

When I try to add a data-base in SQL Server 2008 (Right clicking on Databases folder->New Database) the only compatibility options given to me in the options tab are 70, 80, and 90. However, I require the use of the DATE object, which doesn't work unless I set the compatibility level to 100. I've tried using exec sp_dbcmptlevel mydb,...

Debugging stored procedures in Management studio

Is there a way to step into the Stored procedure code in SQL Management Studio. I know this is possible with Visual Studio, but I am looking for a dependable debugging solution from within Management Studio ...

SQL Server 2008 Open Master Key error upon physical server change over

Hi, I copied a SQL Server database from one system to the next, identical setup, but completely different physical machine. I used Norton Ghost and recoverd files manually, for example, the entire SQL Server 2008 folder found in c:\Program Files after re-installing SQL Server 2008 Express. One of my databases has AES_256 encryption ena...

Copy database to another on same server

Hi, I have a database and want to copy its tables, etc, to another database, so I can use one of these databases as a "staging" DB. What is the best/most foolproof way to do this? Thanks ...

Overriding rows affected in SQL Server using ExecuteNonQuery?

I have an insert statement that pulls some data into a few table variables and then based on that data does a few inserts into several tables. I only care about the rows that are inserted into the real tables and not the table variables, but ExecuteNonQuery will return the sum of all @@ROWCOUNT's. What I would like to know is there a way...

SQL Server 2008 storage of xs:date and xs:time shifted to GMT

Is there any way to prevent SQL Server 2008 from interpolating dates and times passed as xs:date and xs:time to UTC? Currently we're running the server at EST and any times passed in are kicked back -05:00. We'd like to prevent this as it's a very serious issue. Regards. ...

Login change from Windows to SQL Server Authentication possible?

I created a login with Windows Authentication. The properties window for it has Server Authentication section greyed out. Can you switch the user to SQL Server Authentication? The server is set for SQL Server and Windows Authentication mode. ...

Query Field Names Of All Tables

Here's a fun one. Occasionally we may want to find the tables consisting of certain fields, this is because our schema's are so large, and our affiliation with external entities for database definitions causes a bit of confusion when composing certain queries. Sometimes I need to know the answer to the question of: "What tables in data...