sql-server

Tweaking the Fill Factor to reduce fragmentation

I have an non-clustered index that has ~1000 pages, 95% fragmentation and a FillFactor of '0'. I rebuilt the index on Sunday. A week later, the index has 95% (or so) fragmentation again. Is this an indication that I need to change the FillFactor to say 80-90%? Should I be tweaking the fill factor each week to see if I can reduce the ...

Does the sequence in which we use join in a query effects its execution time ?

Does the sequence in which we use join in a query effects its execution time ? ...

SQL Server Replication Error

Hi, I have a SQL Server 2005 box set up for merge replication to SQL Server CE 3.0. The publication, publisher, distributor and IIS have all been set up. In my application, I attempt to sync the databases using the following code: //TODO: Change for production //*************************** string localDBPath = @"C:\Documents and Sett...

Reporting Services running on SQL Server 2008 Express

I know I can run Reporting Services on SQL Server Express w/ Advanced Services. The articles I have read do not touch on my question. I'm wondering, in this scenario, can remote users execute reports from the report server remotely using URL access ex:)http://mySQLExpressBox/ReportServer/rptMyReport....... etc - Or will reports only...

Is it possible to "measure" the usage (e.g. in MBs) per user, of an SQL Server database in web farm conditions?

I have an ASP.NET web application hosted in a web-farm environment, and I need a way to be able to indicate how much a user is using my database. There are several reasons for this, and I mention a couple. First, because I pay for the database space per month, I want to have a reasonable way to charge my users. Second, it would be nice...

How Often should the indexes be re-build in sql-server DB ?

Currently we are having DB of size 10GB and it is growing by around 3GB a month. Often I have come to hear that one should from time to time rebuild the indexes so as the improve the query execution time. So how often should i re-build the indexes in the given senario ? ...

Unicode characters causing issues in SQL Server 2005 string comparison.

This query: select * from op.tag where tag = 'fussball' Returns a result which has a tag column value of "fußball". Column "tag" is defined as nvarchar(150). While I understand they are similar words grammatically, can anyone explain and defend this behavior? I assume it is related to the same collation settings which allow you to ...

Framework /starting point for social networking site in .NET?

Hello, I did do some googling and searching on this site but did not find exactly what I was looking for. I'm hoping that someone can point me in the right direction here. I'm an ASP.NET/SQL Server developer and would like to develop a (intially) basic social networking site (gasp). Before I start from scratch with a blank solution in ...

SQL Server Reporting Services: web references vs assembly references, poor performance

I am using Reporting Services to render a report directly to PDF. It requires that I use two web references: ReportExecution2005.asmx and ReportService2005.asmx. The performance on web references seems really poor. Since my web server (IIS7) and my SQL Server (2008) are on the same box, is there a way I can reference them directly? If no...

Reusing table definition in table-valued functions and views

I have several user defined table-valued functions and one view wich have same columns in returned table. How can I reuse return table definition? ...

Faster way to get an SQL-compatible string from a Guid

I noticed this particular line of code when I was profiling my application (which creates a boatload of database insertions by processing some raw data): myStringBuilder.AppendLine( string.Join( BULK_SEPARATOR, new string[]{myGuid.ToString() ... Bearing in mind that the resultant string is going to end up in a file called ...

T-SQL String Replace

Hello All, here goes my first question: I need to replace the tag {URL}: DECLARE @PageUrl varchar(200) DECLARE @Body varchar(MAX) SET @PageUrl = 'http://www.website.com/site1/site2/pageName.asxp?rid=1232' SET @Body = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus, {URL} enim nec posuere volutpat, neque dui volut...

sporadic ASP.NET data error: "Cannot find table 0"

Having deployed a new build of an ASP.NET site in a production environment, I am logging dozens of data errors every second, almost always with the error "Cannot find table 0." We use datasets and frequently refer to Table[0], and while I understand the defensive coding practice of checking the dataset for tables before accessing Table[...

What does a database log keep track of?

Hey, I'm quite new to SQL Server and was wondering what the difference between the SQL Server log is and a custom log (in my case, using log4net)? I guess there's more choice on what to log using log4net, but what things are automatically logged by the database? For example, if a user signs up to my site, would I have to manually log t...

vb.net checkboxes. Need to populate from database and also help in designing

i have this requirement and since im new to vb.net dont really have much of idea how to do this. I have 20 checkboxes with dropdowns and textbox with it. the example is - table tr td checkbox -- textbox -- dropdownlist /td /tr tr td chk1 txtbox1 ddl1 /td /tr tr td chk2 txtbox2 ddl2 /td /tr and so on. the above str...

suggest a method for updating data in many tables with random data?

I've got about 25 tables that I'd like to update with random data that's picked from a subset of data. I'd like the data to be picked at random but meaningful -- like changing all the first names in a database to new first names at random. So I don't want random garbage in the fields, I'd like to pull from a temp table that's populated a...

How to set XACT_ABORT within ADO.NET

How can I set XACT_ABORT to ON (or OFF) from within ADO.NET ? ...

convert ms sql server to mysql

how can I convert mssql mdf or bak file to mysql? ...

SQL Server 2005/2008 - Double Click to open table / view first 200 results?

Is there a way to configure the shortcuts etc in SQL Server 2005 / 2008 as per the headline. When I doubleclick on a table, I typically want to open it to view the information within, not to just access the next level on the explorer. When I do this on a procedure, I usually want to modify it. This question is one year overdue as this i...

What's wrong with this SQL Create Table Statement?

This SQL query is generated by SQL Server Managment Studio and it throws me an error: USE [database_name] GO /****** Object: Table [dbo].[UserAddress] Script Date: 02/17/2010 11:21:02 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[UserAddress] ( [ID] [int] IDENTITY(1,1) NOT...