sql-server

Can SSRS support multi-tenant usage?

I have a webforms application built on top of the standard microsoft stack - asp.net, sqlserver2008, ssis, ssrs. In certain cases I would like to run this entire stack in a multi-tenant type mode such that users of one 'slice' would not have any visibility to others. We've solved this on the webapp and ssis side, but not yet with Sql S...

Rotate and summarize data

I have the following: declare @PrintJob TABLE ( PageNumber Int, Copies Int ) INSERT INTO @PrintJob(PageNumber,Copies) VALUES(1,100) INSERT INTO @PrintJob(PageNumber,Copies) VALUES(2,100) INSERT INTO @PrintJob(PageNumber,Copies) VALUES(3,100) INSERT INTO @PrintJob(PageNumber,Copies) VALUES(4,100) INSERT INTO @PrintJob(PageNumber,Cop...

SQL Audit Log Running Totals

I have a table with an audit log: BugId Timestamp Status 1 2010-06-24 10:00:00 open 2 2010-06-24 11:00:00 open 1 2010-06-25 12:00:00 closed 2 2010-06-26 13:00:00 closed I want a running total of open and closed bugs like: Timestamp # Status 2...

SQL Server 2008 hosting recommendations.

Hey stackoverflowers, I am currently working on a project that is hosted at GoDaddy and it has a large database. (Periodically inserting millions of rows). It keeps filling the transaction logs and since GoDaddy sets the SQL user up without permission to basically do anything, I cannot truncate it. The 200mb database max is not ideal...

Rake usage/alternatives for SQL Server database management in non-rails environment

Short version: Is there a way to use rake without the full rails environment/active record to manage a SQL Server database? Are there alternatives to rake to do so that provide the same feature set? Longer version: I've done some hobby development using Rails but I haven't used it for work nor do I intend to. But from using it, one thin...

SQL Server Optimization - how to store repeat data

My project has an "Activity Monitor" that monitors the activity of a user. Currently the way it works is, I have a method called LogActivity and it submits the data to the database. I call this method when a user has a new session start, when a user registers, when they update their profile, etc. Basically there are 3 or 4 different a...

t-sql escape problem

i can not delete this lines from DB becouse of Unclosed quotation marks. How cn i escape it. I try with backslash but not working. When i try to delete Delete from dbo.Cities where name = 'Àrbatax'; i get (0 row(s) affected) even in DB 12 rows exist. Problem with unrecognized char À Delete from dbo.Cities where name = 'Ra's al Khaymah'...

Variation on Select top n

Is is possible to do a variation of select top n rows to select top n rows starting at a row other than 0. My (mobile) app has limited resources and no server side caching available. The maximum rows returned is 100. I get the first 100 by select top 100. I would then like the user to be then able to request rows 101-200 and so on. The d...

ruby on rails with an existing database

I am very new to rails, and from what i have been reading and watching in tutorials only helps me build things from scratch, creating new databases and the models at the same time. my company has an accounting / construction project management software system that was recently warehoused into ms sql server. how would i build the models...

SQL: Splitting a column into multiple words to search user input

Hi, I want to compare the individual words from the user input to individual words from a column in my table. For example, consider these rows in my table: ID Name 1 Jack Nicholson 2 Henry Jack Blueberry 3 Pontiac Riddleson Jack Consider that the user's input is 'Pontiac Jack'. I want to assign weights/ranks for each match, so I ...

SQL Server equivalent of MySQL multi-master replication?

Is there an MSSQL equivalent of MySQL's multi-master replication? If so, is it available in SQL Express 2008? I've also seen it referred to as two node circular replication. Basically, I have an in-office database that I want to be perfectly (relatively :) )in sync with a cloud database (we will have access via VPN). Reads and writes oc...

LINQ-to-Entities get rid of sp_executesql

I am trying to optimize my database now using Database Engine Tuning Advisor, and the problem I am facing is that my SQL Profiler trace shows tons of queries performed using sp_executesql - and the advisor fails to process those. It seems like these queries come from LINQ-to-Entities I am using, so just curious if there is any way to mak...

Displaying hebrew characters with SQL collation SQL_Latin1_General_CP850_BIN2

Hello, We have a remote database that is out of our control. The database contains Hebrew characters. It's collation is: SQL_Latin1_General_CP850_BIN2 When we open the SQL management studio - we see gibberish. We asked the database owner (a different company) to change the collation and it isn't possible. Is there an alternative way ...

Attach SQL Server 2000 database on SQL Server 2005

I had MDf Files created with SQL Server 2000 can I attach them on SQL Server 2005 without any problems? Please anyone advise me. ...

From stored procedure how get max number

Create Procedure [dbo].[spGenerateID] ( @sFieldName NVARCHAR(100), @sTableName NVARCHAR(100) ) AS BEGIN SELECT ISNULL(MAX(ISNULL(@sFieldName, 0)), 0) + 1 FROM @sTableName END In the above procedure I supply the field name and table name and I want the max number of this fi...

can we write update and delete queries in views?

hi, i have a doubt, in sql server 2005 views. views created by using select statement. can we write update and delete statements in views . ...

SQL query for displaying product sales.

I have sales table which consists, ItemSize, GroupName, Quantity, ProductID, etc... Now I want to display sales according to following format GroupName ItemSize Quantity ItemSize Quantity means BEER 350ml 500 650ml 1000 How I can achieve this in SQL SERVER 2005 EXPRESS (T-SQL)? Thanks UPDATED: its my sales table...

Restore Problem SQL Server Version?

Hi, I am getting following error. Restore failed for Server I have recently upgraded SQL Server 2005 Express to SQL Server 2008 Express. I have taken a Backup on Production Server, having SQL Server 2008 Backup was good and I tried restoring Backup on Production Server, that works great. Than I downloaded that backup file in .Zip ...

SQL Server 2008 Version Problem.

Possible Duplicate: Restore Problem SQL Server Version? I have recently upgraded to SQL Server 2008 express from SQL Server 2005 express. But when I tried to run following command on SQL Server 2008 Query window Select @@Version I am getting following output: Microsoft SQL Server 2005 - 9.00.4053.00 (Intel X86) May 2...

How to create instance in SQL Server 2008

I have SQL Server 2005 Express installed. Later I upgraded to SQL Server 2008. I don't know much about instances, but when I log into SQL Server 2005 and I log into SQL Server 2008 it is showing the same number of databases. Also, when I create a database in SQL Server 2008 it is showing it in SQL Server 2005. Any Idea how can I create ...