sql-server-2008

SQL Server 2005 and SQL Server 2008 Coexisting in Windows 7 machine

Some SQL Server 2005 and 2008 questions. 1) Can they coexist on the same Windows 7 machine without issues? 2) Can you attach and run 2005 databases to SQL Server 2008 without compatibility issues or is this a no go? 3) Does SQL Server 2005 even work on Windows 7? ...

How are uniqueidentifiers calculated?

I was curious as to how SQL Server calculates uniqueidentifiers. I understand that uniqueidentifiers, are GUIDs but are these calculated based on system time? Or are they calculated based on the name of job/script that has called the NEWID() function. I found this but i found this reference to be unclear. ...

Full text search on SQL server 2008

Suppose I have a table with full-text index on column Firstname, lastname, email. There is on row in table like FirstName LastName Email ABC DEF TAN [email protected] Then I issued following sql: SELECT * FROM Person WHERE CONTAINS(*, 'hong'); I got many rows include above row. If I issued following sql:...

Develop both SQL Server 2008 and SQL Server 2008R2 reports on same dev box

We have a large real-estate of existing SSRS 2008 reports that we are still maintain in production. However we are evaluating SSRS 2008r2 and would like to start developing reports that take advantage of the new features such as shared datasets etc. The problem is that AFAIK installing the tools for 2008R2 upgrades the Visual Studio 200...

MDX : Analysis Services 2008, Excel 2007

Hi, Using : Analysis Services 2008, Excel 2007 I've created a Cube and am able to connect from Excel. Cube does have some Calculated Measures, Named Sets and KPIs. Now, I'm been writing some MDX in MS SQL Server Management Studio. How do I write MDX queries and make them available through the Cube? Can I create Cube Views / Cube spr...

sql constraint for checking for two uppercase letters followed by numeric values

i have the following sql check and it accepts values that are supposed to be two uppercase letters followed by 3 numeric values. CREATE TABLE Project( projectID NCHAR(5) NOT NULL PRIMARY KEY, CHECK(projectID LIKE '[A-Z][A-Z][0-9][0-9][0-9]'), projectName NVARCHAR(20) NOT N...

UPDATE records in a table except the TOP 1 record

Hi All, I have business scenario as We will get all the data to the database including the duplicates If we have any duplicated in a table take the most recent record from duplicates on perticular key by making all the remaining deplicate records flag to 'X' While processing to the next level filter the extraction by flag != 'X' so we...

A connection was successfully established with the server, but then an error occurred during the pre-login handshake.

I am getting following error when i am trying to connect Production DB from Local Environment. I was able to connect Production DB before, but suddenly i am getting following error, any idea? A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, er...

Confused about Itzik Ben-Gan's Logical Query Processing order in his SQL Server 2005 book and SQL Server 2008 book

Hi friends, In the book Inside Microsoft SQL Server™ 2005 T-SQL Querying, the author Itzik Ben-Gan tell us the order or SQL Server 2005's logical query processing is: (8) SELECT (9) DISTINCT (11) <TOP_specification> <select_list> (1) FROM <left_table> (3) <join_type> JOIN <right_table> (2) ON <join_condition> (4) WHERE <...

SQL Server select-where statement issue

Hello everyone, I am using SQL Server 2008 Enterprise on Windows Server 2008 Enterprise. I have a question about tsql in SQL Server 2008. For select-where statement, there are two differnet forms, (1) select where foo between [some value] and [some other value], (2) select where foo >= [some value] and foo <= [some other value]? I am ...

SQL Server: retrieving data type length

Hello, I am writing a basic DBMS package and I am trying to retrieve the column length. This is the query I am using to retrieve the infomation: SELECT COLUMN_NAME, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH FROM INFORMATION_SCHEMA.Columns WHERE TABLE_NAME = 'testVariables' This works fine, no issues except for CHARACTER_MAXIMUM_LENGTH...

SQL LIKE with special characters

If I try to create a select with special (nordic) characters like: Select * from users where name like '%æ%' It just selects all users instead of those containing the letter 'æ'. Do I need to install some special drivers to the database, or is there something else I have missed? Update: I am using a SQL Server 2008 database, the col...

How to write a stored procedure to return a count of events grouped by 'X' week blocks?

I have a table that records market interactions by employees with customers. Relevant fields would be customerid, date and customer type. I want to be able to get a count of interactions by 5 week blocks going back as far as the between dates that would be submitted by the user and discriminate by customer type a,b,c. I want to be able...

have made a publication depending on a where clause. will it work even after snapshot?

filter is like select this and that from table where current='true' note:- using sql server 2008 evaluation replication is MERGE REPLICATION will the articles published change when the data "in the 'current' field is changed, on the publisher"--- "because the where clause is there which say only true data to be published"? ...

Recommended approach how to modify schema of a production SQL database?

Say there is a database with 100+ tables and a major feature is added, which requires 20 of existing tables to be modified and 30 more added. The changes were done over a long time (6 months) by multiple developers on the development database. Let's assume the changes do not make any existing production data invalid (e.g. there are defau...

SQL Server Stored Procs include file statement

I don't think it is possible to do so what I would but I ask anyway. I've found that I include the same variables in the top of every Stored Proc I make. These variables are used for logging and error handling. They don't change between stored procs, there meaning if fixed but primary use is to help readability and have a consistent sty...

SQL Server 2008 large table performance

Hey all, I have this relatively large table in a separate filegroup (2 GB, well, it's not THAT large but large enough I think to start thinking about performance as it's a heavy duty table). This is the only table in this filegroup. Right now the filegroup contains only one datafile. Assuming the table is well-indexed and that index ...

SQL Server 2008: Exception when excecuting CLR function which tries to access database through a connection

I want to use CLR table-valued function in SQL Server 2008, which accesses a database from inside itself. I've got a permission exception. I am trying to execute function as the same user as under which it was created. So cause of the problem is not clear.. Here is the function: public partial class MyClass { [SqlFuncti...

Can anyone clear up some concerns about replication differences between Oracle and MS SQL Server?

The following shows the replication capabilities as described for ms sql server on oracle website. "the text inside the " " are my questions/confusion AGAINST what oracle website says" Please clear these points, what do you think? Is this article out of date? Replication functionality in Microsoft SQL Server or Sybase Adaptive Se...

SSIS Dynamic Excel Destination File Name

How can I configure a dataflow task that takes data from a MS SQL Server 2008 datasource and puts it in an Excel file where the filename looks like 'date filename'.xls? ...