sql-server-2008

Amazon EC2 Instance - How to find SQL Server Password

Hi I have created an Amazon EC2 Instance that provides Windows Server 2008 with SQL Sever 2008 pre-installed. Now in order to use the SQL Server for creating databases, or restoring backups of the databases that I have on my local machine, I need the "sa" password for SQL Server 2008. I have tried using the following but with no luck: ...

Schema compare with MS Data Tools in VS2008

When performing a schema compare having db_owner rights on the target database results in the following error: The user does not have permission to perform this action. Using the SQL Server Profiler I figured out this error occurs executing a query targeting the master db view: [sys].[dm_database_encryption_keys] While specificall...

SQL Server 2008 Snapshot or NOLOCK hint for reading tasks?

I've tried googling and MSDNing a lot but I don't find a concrete answer for this. I have a database with some tables that are heavily written and almost no read, and another tables that are heavily read and less written in a about a 200:15 ratio. I'm thinking in making a snapshot of the database each 15 minutes. Then I'd change the ap...

Should a data warehouse developer know Powershell scripting?

I am a SQL Server (2005 & 2008) data warehouse developer (SSIS, SSAS, SSRS, SQL) and I am wondering if it would be worth the effort and time to learn Powershell scripting. Are there applicable uses from a development perspective? I understand that from a DBA view there is considerable power in Powershell for administration - does any o...

Best practice for avoiding locks on a heavily read table?

Hi, I have a big database (~4GB), with 2 large tables (~3M records) having ~180K SELECTs/hour, ~2k UPDATEs/hour and ~1k INSERTs+DELETEs/hour. What would be the best practice to guarantee no locks for the reading tasks while inserting/updating/deleting? I was thinking about using a NOLOCK hint, but there is so much discussed about this...

Modifying a column with the 'Identity' pattern is not supported in WCF RIA Services

I've been following the walkthrough for creating your first WCF RIA Services Application from Microsoft and have encountered a problem when trying to edit and update data using the SubmitChanges() method of the Data Context. The table being updated has an Identity Specification set in SQL Server 2008 on the 'CourseID' column. However t...

How is timezone handled in the lifecycle of an ADO.NET + SQL Server DateTime column?

Using SQL Server 2008. This is a really junior question and I could really use some elaborate information, but the information on Google seems to dance around the topic quite a bit and it would be nice if there was some detailed elaboration on how this works... Let's say I have a datetime column and in ADO.NET I set it to DateTime.UtcNo...

SQL Convert Nvarchar(255) to DateTime problem

I'm using SQL server 2008. I have 2 Tables: Table 1 and Table 2. Table 1 has 1 column called: OldDate which is nvarchar(255), null Table 2 has 1 column called: NewDate which is datetime, not null Example data in Table 1: 26/07/03 NULL NULL 23/07/2003 7/26/2003 NULL 28/07/03 When i try CAST(OldDate as datetime) I get this error: ...

How to attach a SQL Server database from the command line

Is it possible to enter a command line command (like in a batch file) to attach a detached database to SQL Server, in stead of opening the management studio and doing it in there? ...

SQL Server Service Broker External Activation complete sample

I am attempting to understand the complete picture of Service Broker external activation. I have found bits and pieces of different aspects, but nothing that is a complete simple sample. Can anyone point me to one? ...

How can I restore a SQL Server database using SMO with full text catalogues?

Hi, I want to programatically (c#) restore a database (SQL Server 2008) which was originally from my live environment. My local environment is obviously quite different, with different drive mappings. I have followed this article (http://www.mssqltips.com/tip.asp?tip=1849) which has been a great help, but I am struggling to find out h...

I'm looking for a reliable way to verify T-SQL stored procedures. Anybody got one?

Hi all-- We're upgrading from SQL Server 2005 to 2008. Almost every database in the 2005 instance is set to 2000 compatibility mode, but we're jumping to 2008. Our testing is complete, but what we've learned is that we need to get faster at it. I've discovered some stored procedures that either SELECT data from missing tables or try to...

Suggestions on documentation of a DB model when using Entity Framework 4

Any experiences on how to document Entity Framework 4 based Database projects? There is the Document and Summary properties on the Entities, but if we want to regenerate the model from the database at some point, it will be lost! Is there some way to map documentation data inside SQL to the Entities in the EDMX file so it is safe. Sug...

How many records can i store in a Sql server table before it's getting ugly?

Hi, i've been asked to do some performance tests for a new system. It is only just running with a few client, but as they expect to grow, these are the numbers i work with for my test: 200 clients, 4 years of data, and the data changes per.... 5 minutes. So for every 5 minutes for every client there is 1 record. That means 365*24*12 = ...

Sql server indexed view

OK, I'm confused about sql server indexed views(using 2008) I've got an indexed view called AssignmentDetail when I look at the execution plan for select * from AssignmentDetail it shows the execution plan of all the underlying indexes of all the other tables that the indexed view is supposed to abstract away. I would think that t...

Query points using SQL Server 2008 geography type

I have a table with the geography type and I want to run a query to find all rows within 25 miles of a specific lat/long. What would the query look like to accomplish this? ...

SQL Server 2008 > how to get service startup parameter values by query?

Is it possible to query for the SQL Server 2008 service startup parameter values using T-SQL? I'm specifically looking for the -g parameter that indicates how much memory that SQL Server will leave available for memory allocations within the SQL Server process, but outside the SQL Server memory pool [msdn reference]. ...

SQL Server Index Scripting

I'm using SQL Server 2008. Is it possible to create a script to loop over all tables in a database generating a set of index drop scripts and create scripts separately? What I have to do is drop all indexes on a set of databases to run a heavy data load process but then I want to re-enable all the indexes. I don't want to have to go th...

Move database from sql server 2008 to 2005

I have a database currently in SQL Server 2008 to be moved to SQL Server 2005. I would like to backup the 2008 db to a bak file and import it to 2005, but couldn't find any options in SSMS 2008 while taking backup. Has anyone had a similar need in the past? How did you manage this through? ...

Is it possible to have a multilanguage Environnement in SQL Server 2008 ide

Hi! is it possible to install another interface language to SQL Server 2008 Management Studio? Im not talking about programming language but changing the interface language from English to French (or others). In Visual Studio, i can do it by installing the english and the french version of the product and then, in the option of Visual ...