sql-server

Cross-reference Distance chart in SQL Server 2008 or Excel ?

I would like to cross-reference construct a distance chart similar to the one here (example is a road-distance cross-reference chart) and, ideally, store the data in SQL Server 2008 (preferably the Express version). It needs these properties / abilities Every column has a corresponding row with the same name (ie. not misspelled like my...

Using SMO to get create script for table defaults

I'm trying to create a database scripter tool for a local database I'm using. I've been able to generate create scripts for the tables, primary keys, indexes, and foreign keys, but I can't find any way to generate create scripts for the table defaults. For indexes, it's as easy as foreach (Index index in table.Indexes) { Scriptin...

Do Stored Procedures really boost performance in MS SQL / .NET?

Jeff Atwood wrote about this here, and while I understand the theoretical performance boost a stored procedure could offer, it does seem like a tremendous pain. What types of queries would you see the most performance increase using stored procedures, and what types of queries would you rather just build on the fly? Edit: Any documenta...

What benchmark would test how well my hardware rates, for my ASP.NET, SQL Server, IIS product?

What benchmark would test how well my hardware rates, for my ASP.NET, SQL Server, IIS product? I have two servers, one runs my code much faster than the other and I believe their configurations are close to equivalent and therefore I want to benchmark the two. I do not want this question to become one about the hardware. This question...

Should SQL Server be on the same machine as your IIS installation?

I'm listening to podcast #19 and Joel and Jeff are arguing about running SQL Server on the same machine as your IIS installation. I have to say that it sounds like Jeff folded to Joel, but then again I am only guessing which one is which. ;) What are the pros and cons of each? Which is better? I typically run them separately (Joel's pr...

Data access technology for Silverlight and WPF standalone app versions.

I am writing an applicaton that will be a standalone WPF application and also a cut down version that will work as Silverlight and so be hosted in browsers. I want the Silverlight application to access data from the cloud. The WPF application needs to work against a local database but then be able to sync with the same cloud storage. So...

Using XQUERY/Modify to replace a piece of my XML with value from varchar field

I have a table: MyTable config as XML title as varchar(255) In MyTable.config I have XML in the following structure: <configuration pagetitle="myConfig"> <column> <row> <component id="1" type="MyPiece" title="My Title" text="junk" /> </row> </column> </configuration> I need a script to inject the value of MyTa...

Installing sql server express: VS2008 sp1 problem

I am trying to install SQL server express 2008 on my machine. I get an error message that says that older version of VS 2008 in installed on the computer. Upgrade to VS2008 SP1 before installing Sql server 2008. I tried to install sp1 but I get an error message that a compatible version of vs2008 is not detected on the system. the upgr...

Did Visual Studio 2008 Support SQL Reporting services 2008.

I need to send mail via data extension I am having Visual Studio 2008. I am migrating from Visual Studio 2005. Will it possible. ...

Is bigint large enough for an event log table?

Now I know that bigint is 2^64; that is, more atoms than there are in the known universe. I shouldn't be worried, as my mere human brain simply can't get around the enormity of that number. However, let's say that I record every change to every category, product and order in my system, from launch until the end of time. Should I be co...

Should I get rid of clustered indexes on Guid columns

I am working on a database that usually uses GUIDs as primary keys. By default SQL Server places a clustered index on primary key columns. I understand that this is a silly idea for GUID columns, and that non-clustered indexes are better. What do you think - should I get rid of all the clustered indexes and replace them with non-cluste...

SQL server reporting services: how to stop a report firing when opened

We have some SQL server reporting services reports. I didn't write then but I have to take care of them. These reports fire when opened in the browser, and with the default parameters (search terms and restrictions are blank) they retrieve a lot of data, which is slow. The client would prefer that the report is not generated until the u...

Why, when I impersonate within a WCF service, can my service not load System.Transactions when I try to run a LINQ to SQL query?

I have a WCF service, hosted in IIS 7.0 that needs to run database queries. In order to get the right permissions to do this I am impersonating within the service as follows: Code [OperationBehavior(Impersonation = ImpersonationOption.Allowed)] public void MyOperation(int arg) Configuration <behavior name="ReceivingServiceBehavior">...

How can I run sql server stored procedures in parallel?

I want to do something like: exec sproc1 and sproc2 at the same time when they are both finished exec sproc3 I can do this in dts. Is there a way to do it in transact sql? Or is there a way to do it with a batch script (eg vbs or powershell)? ...

Which tools or methods would you suggest for creating large amounts of SQL test data?

I'd like to stress test some of my SQL queries and find out about bad query plans and bottlenecks. I plan to fill some tables with random test data. Are there tools or a set of scripts available for this purpose, preferably for SQL Server? Thanks! UPDATE: Sorry, didn't know these two question already existed: Data generators for SQL...

How to automate report delivery in SSRS

I have a report in SQL Server Reporting Services (SSRS) that I'd like to schedule to run automatically as an email. I'd like the report to be attached as Excel file. According to the Microsoft overview this should be possible. Report delivery. SQL Server Reporting Services supports both on-demand (pull) and event-based (push) delive...

Sql Server CE 3.5 Merge Replication Synchronise is Hanging

Hi I am using sql server 2005 ce framework 3.5 and attempting to use merge replication between my hand held and my sql server. When I run the code to synchronise it just seems to sit forever, and when I put a breakpoint in my code it never gets past the call to Synchronize(). If I look at the replication monitor in sql server, it get...

What are the technical considerations for running MSSQL and MySQL off the same Windows server?

Our application runs off MySQL, but a client has another application that requires SQL. We want to run them both on the same box. What are some technical considerations for this configuration... is this really just a matter of making sure there are no port conflicts? ...

SQL Server Backup Database over ODBC

I'm trying to write a program that is able to import and export a specific database, plus users and logins, from a Microsoft SQL Server database. I have an abstraction layer between my code and ODBC that much of our other software uses. The abstraction layer normally runs with autocommit off and handles transactions on its own, but since...

Should I use the CASCADE DELETE rule?

I've always been too scared to use DELETE CASCADE, but as I get more confident (lazy :D), I'm thinking how bad can it be, is it best practise to use it or should I avoid it and clean up my foreign keys etc the old fashioned way (with stored procedures)? ...