sql-server

Big log backup after full DB backup

I have a production database where I run full DB backups every Sunday at 2AM and log backups every night at 3AM. The weekly full backups are around 100MB, while the log backups are around 1MB. But the log backup running immediately after the full backup (one hour after) is almost as big as the full backup (100 MB). It's not a problem, b...

Optimize database for web usage (lots more reading than writing)

I am trying to layout the tables for use in new public-facing website. Seeing how there will lots more reading than writing data (guessing >85% reading) I would like to optimize the database for reading. Whenever we list members we are planning on showing summary information about the members. Something akin to the reputation points and...

Microsoft.SqlServer.Management.Smo.FailedOperationException: Backup failed for Server '\\.\pipe\3F103E6E-3FD4-47\tsql\query'

Hi, I'm gonna get a backup with below method : void BackupDatabase(string sConnect, string dbName, string backUpPath) { using (SqlConnection cnn = new SqlConnection(sConnect)) { cnn.Open(); dbName = cnn.Database.ToString(); ServerConnection sc = new ServerConnection(cnn); Server sv = new Server(s...

Expose SQL Server database as web service to get data from.

Is there any .NET tool to expose the data of my tables in Microsoft SQL Server as web services? Do I have to write the code? Are there any samples? What do your recommend as to how to expose the data? ...

Read SQL Server 2005 ldf file

i will try to explain my question in details. In a program that i am writitng i need to read the content of log file for a certain database. I google a little bit and found that ldf is binary file. But i was no able to find the format of the file or any tutorial showing how to read this file. I am writing the program on C# but any exampl...

Changing window title in SQL Server Management Studio

Is there a way to change the window title of my SQL Server Management Studio to display current server I'm connected to? To know which DB I'm connected to, I have to scroll all the way up to see the name of the server and it's a pain.. Maybe there's an available plug-in or something. ...

Update cached data

Hi U are caching a list of items, then Add or update or delete method called. Approach 1) A- Do the data change at the database. If success do B, C B- Remove the entire list from the Cache. C- Re-Cache the list on first read. Approach 2) A- Do the data change at the database, If success do B B- Do the same change at the cached i...

Intelligent Database - Capable of identifying out of the ordinary values

I am looking for a tool or system to take a look at the database and identify values that are out of the ordinary. I don't need anything to do real time checks, just a system which does processing overnight or at scheduled points. I am looking for a system at two levels: Database wide: Eg: Compare salaries of all employees and identify...

Create a new database problem

I'm logging in to create a new database from CMD through sqlcmd with SA account. Its response is a message: CREATE DATABASE permission denied in database 'master'. I'm using Windows server 2003 and SQL 2008. Please help me. Thanks in advance. ...

ASP.NET Cache - Callback versus Refresh - How to decide?

Does a callback put more strain on a server in terms of cpu because it has to watch for a change all the time? I suppose a refresh makes code a little less manageable in that you have to find the place where the cache is being refreshed and there might be a tendency to forget to add the refresh? When the cache is being refreshed, the p...

SQL Server 2005 Asnyc stored procedure

Hi all, I am currently having problems calling a stored procedure async from within a insert-update-trigger. For this I m using the service broker. --message type CREATE MESSAGE TYPE [TheMessage] VALIDATION = NONE --contract CREATE CONTRACT [TheContract] ([TheMessage] SENT BY ANY); --queue CREATE QUEUE [TheQueue] WITH ACTIVATION (STA...

i cannot connect to Microsoft SQL Server Database File (SqlClient)

I'm using Microsoft SQL Server Database File (SqlClient), name UHMS.mdf and I'm not able to connect to it. can someone help please. thanks. ...

How to retrieve last autoincremented value in MS-Access like @@Identity in Sql Server

I want to retrieve identity column value in ms access from an autoincremented column. Basically i m running a transaction in which i have to write two insert queries. 2nd query will be containing autoincremented value that was generated from query 1. how can i do that ? ...

How-To delete 8,500,000 Records from one table on sql server

Hi there, delete activities where unt_uid is null would be the fastest way but nobody can access the database / table until this statement has finished so this is a no-go. I defined a cursor to get this task done during working time but anyway the impact to productivity is to big. So how to delete these record so that the normal use...

Pivot SQL Statement

I have a table like this (of course there are many more values but you get the idea): ID Name --- ---- 1 A 1 B 2 C 3 D 4 A 4 D 4 E 4 F 4 G 4 H I want to write a query that would output this, given that an ID cannot have more than 6 names. ID Name1 Name2 ...

How to create view that combine multiple row from 2 tables?

I want to create view that combine data from two tables, sample data in each table is like below. SELECT Command for TableA SELECT [ID], [Date], [SUM] FROM TableA Result ID | Date | SUM 1 | 1/1/2010 | 2 1 | 1/2/2010 | 4 3 | 1/3/2010 | 6 SELECT Command for TableB SELECT [ID], [Date], [...

INSERT TRIGGERS and the UPDATE() function

I have created an INSTEAD OF INSERT trigger on a view in my database. I want to know which columns are included in the column list of the INSERT statement on the view. If you read the MSDN documentation for triggers the UPDATE() and COLUMNS_UPDATED() functions should satisfy this requirement. However, during my testing I found that re...

schema in sql server 2008

what is the difference between creating ordinary tables using 'dbo' and creating tables using schemas.How this schema works & supports the tables ...

SMO code support to both sql 2005 and sql 2008

Prepared a manged c# DLL using assemblies of SMO of version:10.0.0.0 of SQL 2008 and I called the functions in this DLL from an unmanged c++ code. This application is running successfully for SQL Server 2008 but this application is throwing exception when i run for SQL Server 2005 as follows: Description: Could not load file or assembly...

Is SQL Server Express a serviceable database for a ASP.NET MVC web application

I am about to start building a ASP.NET MVC web application that relies on a database as it's backend (big surprise). As a student, I have access (via Dreamspark) to SQL Server 2008 Developer Edition, and with the default VS 2008 install, I have SQL Server Express 2005 installed already. Many of the examples on MVC I have seen use a loc...