sql-server

Can I define which word breakers to use when building a mssql fulltext index?

I have created a fulltext catalog that stores the data from some of the columns in a table, but the contents seem to have been split apart by characters that I don't really want to be considered word delimiters. ("/", "-", "_" etc..) I know that I can set the language for word breaker, and http://msdn.microsoft.com/en-us/library/ms34518...

Money Data Type Precision - SQL Server (SSMS)

In sql server management studio, data type- money, when I enter an amount with a decimal it automatically adds on zeros to fill up to the hundredths. How can I determine the amount of spaces after the decimal? ...

Running a script on a target machine without having SQL server installed on that machine

I have a program that will run on several machines. I cannot control exactly which machines this program will be running on, but all will link to the same database that is located on a server somewhere. The program might require to run a script that is recevied in the form of a .sql text file. Currently, the program is starting osql wi...

Change default db to Master db in SQL Server

I have deleted my default db now I can not login using sql server authentication. How can I change default db back to Master db EDIT: I cannot login using sql server authentication. It gives me error Cannot open user default database. Login failed. Login failed for user 'xyz'. (Microsoft SQL Server, Error: 4064) Thanks. ...

Create dll from SQL Server procedure

Hi! I have procedure on SQL Server! Now,is it possible to create dll from that procedure and if it is, how i can do that? Thanks! ...

How to tell if a variable (-v) is defined on command line (SQLCMD)

Is there a way to tell if a variable is defined on command line using SQLCMD? Here is my command line: sqlcmd -vDB="EduC_E100" -i"Z:\SQL Common\Admin\ProdToTest_DB.sql" Inside ProdToTest_DB.sql I would like to set some sort of conditional IF to check if the variable does not exists and define it if it does not. IF NOT $(DB) :set...

Problem with storing file in SQL Server

Hi everyone! I'm trying to save in SQL Server DB a file. (It doesn't mutter which type of file) I use for fileContent field with image type that allow NULL. When I executed Command.ExecuteNonQuery() I'm having error-message: "String or binary data would be truncated.\r\nThe statement has been terminated." Below you may see my code: ...

MSSQL management studio 2008 R2 "open table" gone?

Possible Duplicate: Where did Open Table go in SQL Server 2008? Using MSSQL management studio 2008 R2, I find that the "open table" option, allowing me to edit values of my columns in a table, is gone. I can now only do this via querys. Is there a way to get this back? ...

Best way to build a DataMart from multiple external systems?

I'm in the planning stages of building a SQL Server DataMart for mail/email/SMS contact info and history. Each piece of data is located in a different external system. Because of this, email addresses do not have account numbers and SMS phone numbers do not have email addresses, etc. In other words, there isn't a shared primary key. ...

Entity Framework, TPT Inheritance and Multi-Language support

Hello I have this DB Structure: Service Id int PK CategoryId FK SomeOtherFields LocalizedService LocalizedServiceId PK LanguageId FK Name Description As you can see, I have a base table called Service, and a LocalizedService table in which I'm writing multilingual data, such as name and description which should be trans...

How to declare output in sql 2008

@TotalRows int = NULL Output this won't work ...

CPU Pinned above 95% when BDC profile import (Full and Incremental)

We have daily full profile imports using BDC connection. In that duration, CPU spiking very high. That team is concern. How to resolve this issue. Please anybody have any idea on this? Please share with me. It is physical box with 16 GB RAM. CPU is spiking all the way till its complete BDC job (not like only initially). I have 85000 rec...

sql server 2000 using hint in view

CREATE VIEW xxxx AS SELECT order_date, DATEPART(W, order_date) AS dayID, Type FROM dbo.Shipment_Dates WHERE (TIP = 'normal') OPTION (FAST 20) This create statment causes error at hint part .. Is there a workaround for adding hint to views? ...

Make sql where clause prioritize one prefix-like-search above another

I have an sql table with some nvarchar columns, lets call them 'Title' and 'Value'. I currently use a linqtosql query to make a prefix search to find rows in this table, like so var result = from _item in GetTable() where _item.Title.StartsWith( "hello" ) || _item.Value.StartsWith( "hello" ) select _item; return result.Take( 10...

What's the best tool for data integration

Hello. I'm looking the best tool for data integration. I need the following features: Customized loading/matching and clearing of data from different sources (including MSSQL Server, PostgreSQL, WebServices, Excel, text files in various formats). The receiver of data is MSSQL Server 2008. Ability to configure rules of data convertation...

MVC Module Confusion

I am very new to MVC so I have some confusions regarding models when we have relations between multple tables.Formally I was using views or stored procedures of sql to manipulate data but now I am using Entity Framework so confused how my model should look like ? I have a table for Users , UserImages , UserRoles . UserImages and UserRol...

Replicating / Cloning data from one MS SQL Server to another

Hi, I am trying to get the content of one MSSQL database to a second MSSQL database. There is no conflict management required, no schema updating. It is just a plain copy and replace data. The data of the destination database would be overwritten, in case somebody would have had changed something there. Obviously, there are many ways t...

SQL Sever 2008 / Office 2007 Full text index issues

Server is running 2008 R2 Standard 64 bit and SQL Server 2008 R2 Workgroup Edition (64-bit) We store documents in a varbinay(max) and the full text indexes work perfectly for all document types including PDF’s but do not work for Office 2007 documents. We have installed the Office 2007 iFilter and done each step but still do not get a...

SQL Server 2005 Get First and Last date for any Month in any Year.

I have a stored procedure that has to accept a month as int (1-12) and a year as int. Given those two values, I have to determine the date range of that month. So I need a datetime variable to represent the first day of that month, and another datetime variable to represent the last day of that month. Is there a fairly easy way to get th...

SQL Server 2000 Enterprise Manager - Store nvarchar data greater than 4000 characters?

I'm using SQL Server 2000 Enterprise Manager. I'm having trouble with storing some data in a column. The column has a data type of nvarchar, with a length of 4000, which I've now learned is the max length you can have. I need to store data in the column that is longer than 4000 characters...is there a way to increase the size? Or is the...