sql-server-2008

Deny Drop DB Objects in Sql Server 2008

Hi, I need help to set GRANT CREATE, ALTER BUT DENY DROP DB Objects to db users using sql server 2008. I've tried this but it returns error: use DBName GO DENY DROP TO dbUser Error: Incorrect syntax near 'DROP'. Any help would be much appreciated. Many thanks.. rfs ...

Question about SQL Server HierarchyID depth-first performance

I am trying to implement hierarchyID in a table (dbo.[Message]) containing roughly 50,000 rows (will grow substantially in the future). However it takes 30-40 seconds to retrieve about 25 results. The root node is a filler in order to provide uniqueness, therefor every subsequent row is a child of that dummy row. I need to be able to ...

Data Mining - Predictive Analysis

We are looking at acquiring Data Mining software to primarily run predictive analysis processes. How does SQL Server Data Mining solution compares to other solutions like SPSS from IBM? Since SQL Server DM is included in SQL Server Enterprise license - what would be the justification to spend extra couple 100K to buy separate software ...

search with list of comma seperated values using linq to sql

What is the best way to handle the following database search scenario using asp.net mvc, sql server and linq to sql? I have a simple search for people, by their first name and last name. Based on the results, I would like to dynamically filter the results base on the people's City and Business. This could be multiple cities or busin...

SQL Server database synchronization issues

Hello everyone, I have two SQL Server 2008 Enterprise databases (on two machines), and one of the databases is master database and another database is slave database (master database is read/write, slave database is readonly). I want to have daily update from master database to slave database (i.e. new data inserted/updated/deleted in m...

Capture query results using SQL Server Profiler

It's possible to capture a query's result using SQL Server Profiler? i.e. the resultset generated by the query ...

What are the best tools for Sql Server version control

After reading this post, and the suggestion to use Team Edition for Database Professionals, I want to know is there any equivalent to this for SQL server 2008 / Visual stuio 2010 ultimate. I'm looking for tool need to do all the thing that Jeff mention in his article: Create test data. Schema comparison. Data comparison. Database unit...

how do i insert html file that have hebrew text and read it back in sql server 2008 using the filestream option ?

hello all, i am new to the filestream option in sql server 2008, but i have already understand how to open this option and how to create a table that allow you to save files. let say my table contains: id,name, filecontent i tried to insert an html file (that has hebrew chars/text in it) to this table. i'm writing in asp.net (c#), usi...

how to write T-SQL to compare and copy data?

Hello everyone, I have two SQL Server 2008 Enterprise databases (on two machines), and one of the databases is master database and another database is slave database. I want to transfer update from a table in source database to a table in destination database (two tables are of the same schema, both of them are using a single column as...

Visual Studio 2010 Database Projects: Are there any videos/tutorials or comments about the new Database Project Types?

I have recently upgraded to Visual Studio 2010. I have kept database projects separate to application projects. The database project was converted from and old DPR project and added a whole lot of additional folder. I deleted those, but now I suspect I need to recreate the project as these new projects work very differently. Now that I ...

SQL Server 2008 replication failing with: process could not execute 'sp_replcmds'

I have an issue with SQL replication that I am having trouble fixing. What I am doing is restoring two DBs from a production backup, and then installing replication between them. The replication seems to be configured without any errors, but when I look at the status I see error messages like this: I have an issue with SQL replicatio...

Having trouble using 'AND' in CONTAINSTABLE SQL SERVER FULL TEXT SEARCH

I've been using FULL-TEXT for awhile but I cannot seem to get the most relevant results sometimes. If I have an field with something like "An Overview of Pain Medicine 5/12/2006" and a user types "An Overview 5/12/2006" So we create a search like: '"An" AND "Overview" AND "5/12/2006"' - 0 results (bad) '"Overview" AND "5/12/2006"' - 1 ...

sql server 2008 multiple inserts over 2 tables

I got the following trigger on my sql server 2008 database CREATE TRIGGER tr_check_stoelen ON Passenger AFTER INSERT, UPDATE AS BEGIN IF EXISTS( SELECT 1 FROM Passenger p INNER JOIN Inserted i on i.flight= p.flight WHERE p.flight= i.flightAND p.seat= i.seat ...

Configuration Error ASP.NET password format specified is invalid

I am getting the above error in IIS 6.0 now when I browse my C# / SQL web application. This was built in VS 2008 and SS 2008 on a 32-bit XP OS. The application was working before I added Login controls to it. However, this is my first time configuring Login/password controls so I am probably missing something really basic. This err...

Select the latest record for each category linked available on an object

I have a tblMachineReports with the columns: Status(varchar),LogDate(datetime),Category(varchar), and MachineID(int). I want to retrieve the latest status update from each category for every machine, so in effect getting a snapshot of the latest statuses of all the machines unique to their MachineID. The table data would look like Cat...

In SQL Server, can multiple inserts be replaced with a single insert that takes an XML parameter?

So I have an existing ASP.NET solution that uses LINQ-to-SQL to insert data into SQL Server (5 tables, 110k records total). I had read in the past that XML could be passed as a parameter to SQL Server but my google searches turn up results that store the XML directly into a table. I would rather take that XML parameter and insert the n...

SQL Server Merge statement issue

Hello everyone, I am learning and using SQL Server 2008 new Merge statement, merge statement will compare/operate source table and destination table row by row ("operate" I mean operations performed for when matched or not-matched conditions). My question is whether the whole merge process will be one transaction or each row comparison/...

List of all tables with a relationship to a given table or view

In SQL Server is there a command to return a list of all tables with a relationship to a given table or view? EDIT: SQL SERVER 2008 ...

How do I switch to a SQL Server Server Database that will exist after another command?

I can't get this script to run, because SQL management studio 2008 says the table "NewName" does not exist. However, the script's purpose is to rename an existing database, so that it does exist when it gets to that line. Ideas? Use Master; ALTER DATABASE OldName SET SINGLE_USER WITH NO_WAIT; ALTER DATABASE OldName MODIFY NAME = NewNam...

Logging ODBC, SQL Server

How to log, trace or get queries that an application send to Microsoft SQL Server 2008 thru ODBC driver (without modifying application...) Maybe it can be done with SQL Server itself or ODBC has some query logging? ...