sql-server-2008

How can I duplicate a SQL Server symmetric key?

We have a server with a database that has a symmetric key (Database -> Security -> Symmetric Key). We have a backup duplicate databases that we are using as a test databases, but we don't have this key in there. How can I duplicate this symmetric key (or make a new one exactly like the old) and put it in the existing databases? It has t...

Which column type should I use for storing HTML of an unknown size?

What column type should I use for storing html content from a website with an unknown size? (I'm scanning certain html pages, and create an database entry if there are changes between the last stored entry and the current html code.) My database is a MSSQL 2008 express database. ...

Copy data from SQL Server Express keep primary key

I want to copy data from a database to another, but I'd like to keep the primary key from the original database so it won't mess with the relationships. I'm using SQL Server 2008. ...

SQL Server: pulling and updating local data

Hi guys, I have two SQL Server 2008 databases called Anna and Bob. Bob has to pull and transform data from Anna to keep updated his tables. Ideally Bob will be always synchronized with Anna, but some delay would be acceptable. What is the best way to do this? Thanks in advance. ...

How do I track down sporadic ASP.NET performance problems in a production environment?

I've had sporadic performance problems with my website for awhile now. 90% of the time the site is very fast. But occasionally it is just really, really slow. I mean like 5-10 seconds load time kind of slow. I thought I had narrowed it down to the server I was on so I migrated everything to a new dedicated server from a completely di...

SQL Server - Detecting non-indexed columns but used in WHERE clause

How to detect a column included in WHERE clause but used in indexed? Little Background: Until the time the table has few number of records things will be okay, once it started having millions of records then index should be created for a column which is used in WHERE clauses in stored procs, inline queries etc., Since we have hundre...

SSAS Cube Availability While Being Rebuilt

Is a SSAS 2008 cube available to be queried while it's being rebuilt? If yes, then are there implications to querying it during a rebuild? ...

How to configure reference to be deleted on parent table update?

I have two tables: info: ID, fee_id and fee: ID, amount and a reference between them (SQL Server 2008): ALTER TABLE info WITH CHECK ADD CONSTRAINT FK_info_fee FOREIGN KEY(fee_id) REFERENCES fee (ID) ALTER TABLE info CHECK CONSTRAINT FK_info_fee GO How to configure this reference that way so a record in fee will be deleted if inf...

Undo Database Restore in SQL Server 2008

I accidentally restored a SQL Server 2008 database with a wrong backup. Is there any way to undo this and restore to previous version? ...

SQL Server 2008 notifications

C#, VS 2005, SQL Server 2008 I have a database on a remote server. It has a table table1. Several clients work with it. Each client can change the content of table1. Each client must represent actual content of this table. So I need some algorithm to make sure the clients always represent the most current content of table1. I know that...

SQL Server Service Broker Service Disappearing (Automatically Deleted)?

I've implemented a messaging system over SQL Server Service Broker. It is working great, with the sole exception that every once in a while (maybe once per week per server) my initiator service just vanishes without a trace. The corresponding queue is still there, but the service is missing. Obviously this causes problems in my system...

SQL Server 2008 Reporting Services Charting - adding a data table to bottom of a chart

I would like to add a data table to bottom of a (line) chart in a report. I know I can create a matrix report with the same data source. I would like to have everything lineup automatically like it does when you add a data table to a chart in Excel (as shown at http://www.tushar-mehta.com/excel/newsgroups/data_table/). Example from E...

How do I add a RowVersion attribute to a EF4 class

I am using EF4 and creating classes through the Entity design surface then generating the database from them. I want to add an attribute to some of the classes to show the timestamp they were last updated. I have added a Version attribute to them, but I don't know which .Net datatype to associate with them so they become either Timesta...

Looking for a .NET data access layer

Hello, I am looking for a data access layer for ado.net. I am not interested in linq, EF, NHibernate or any other ORM. Currently, I am using the data access layer from umbraco. The DAL is very good but they stopped developing it so i am looking for a different one. Does anyone know where I can find a list of DALs that I can test? ...

Problem with insert Thai Language data to SQL Server 2008 field datatype text and show ????

Hello everyone I created MVC ASP.Net Web application and tried insert Thai language data to SQL Server 2008 database to field with data type text and then database store ?????? which is incorrect. For Html Page I user charset utf-8 However I tried to Encode string before insert data to database and change database field collation. Th...

Is it possible to create a new T-SQL Operator using CLR Code in SQL Server?

I have a very simple CLR Function for doing Regex Matching public static SqlBoolean RegExMatch(SqlString input, SqlString pattern) { if (input.IsNull || pattern.IsNull) return SqlBoolean.False; return Regex.IsMatch(input.Value, pattern.Value, RegexOptions.IgnoreCase); } It allows me to write a SQL Statement Like. SEL...

MS SQL Server decimal data type rounds up

Hui folks, I need to be able to store numbers like 3.5 in my table. So I've used the decimal type field. But if I enter 3.5 it round it up to 4. Am I being stupid or is it not the point of decimal to have a decimal point? Thanks, Jonesy ...

Import IIS log into SQL Server 2008 error

I'm trying to import IIS logs into SQL Server 2008. I get this error below. Error 0xc02020a1: Data Flow Task 1: Data conversion failed. The data conversion for column "cs(User-Agent)" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.". (SQL Server ...

Problems when going from SQL 2005 to SQL 2008

Hi! I did go over from SQL server 2005 to 2008. Doing that gave me some problems with the fulltext search. This site is based on Fulltext search. It occurs more deadlocks, the search is slower and sometimes it return empty lists, don't know why. A lot of people has been writning about they having this problem with 2008. But I haven'...

How to add additional rows to result set by condition

I have a table like this: ObjId Date Value 100 '20100401' 12 200 '20100501' 45 200 '20100401' 37 300 '20100501' 75 300 '20100401' 69 400 '20100401' 87 I have to add additional rows to result set for objId's, where there is no data at '20100501' **100 '20100501' null** 100 '20100401' 12 200 '20100501' 45 200 '20100401' 37 300 '2010050...