T-SQL fulltext catalog search with freetext

I have a fulltext catalog for an indexed view. Problem: I want to search with the function ‘FREETEXT’ all words which contains the search term. But the result doesn’t return any entries… but one entry must be the word ‘freightcosts’ If the search term = ‘freightcosts’, the result is ‘freightcosts’? Example: SELECT [Description] FROM dbo.vuCmsTextDe […]

Create nonclustered primary keys using NHibernate and SchemaExport

We’re using SchemaExport via ActiveRecord. By default it generates a table like this: create table List ( Id UNIQUEIDENTIFIER not null, Name NVARCHAR(255) null, OwnerId UNIQUEIDENTIFIER null, primary key ( Id )) SQL Server then defaults to adding a clustered index for the primary key. But I want this to be nonclustered. I want to […]

SQL Server (2005) Query Help

My query is based on the following example I have table say ‘Table1’. Table1 has one row and one column. The name of the column is ‘Column1’. ‘Column1’ is a text column (NVARCHAR). I have a comma separated keywords like ‘key1,key2..keyn’. I want to search these keywords individually in the column1. So in the where […]

Sql Server Dynamic Database Partitioning

Is there anything called dynamic partitioning in SQL server? If so how can i implement it?

Inserting 100,000 rows at a time .. error identity column violation

I’m trying to insert row by row in a table about 100k records.. I get this error after some 140 or so.. Violation of PRIMARY KEY constraint ‘PK_table1’. Cannot insert duplicate key in object ‘table1’. The statement has been terminated. In this case the primary key is an IDENTITY column. I do not include that […]

SQL Server Full Text Search Results differs from Like statement

I tried these two methods on Advantureworks and got different results. select * from Person.[Address] where AddressLine1 like ‘%99%’ select * from Person.[Address] where contains(Address.AddressLine1,'”*99*”‘) Any Idea?

How do I query an XML field in SQL Server 2005 so that it behaves like a table?

I have a table that contains a user_id, and an XML field containing basically a series of values. I need to run a report against the data in the XML, but for the life of me I cannot get the XML out of the field in any useful fashion. Here’s the schema for the table: […]

ASP.NET MVC2.0 remote SQL server – Login failed for user '<username>'. Reason: Not associated with a trusted SQL Server connection

first I have checked that Server Authentication is already set to: “SQL server and Windows Authentication mode” (mixed mode) ้here ‘s my web.config connectionstring <connectionStrings> <add name=”StockConnectionString” connectionString=”Data Source=;Initial Catalog=Stock;Persist Security Info=True;User ID=op;Password=operator” providerName=”System.Data.SqlClient”/> </connectionStrings> Whene I test running (ctrl+F5) under VS2010 development this can connect to remote SQL server without any problem. but when […]

T-Sql statement to perform inserts or updates comparing data in Master and data in two tables joined

How do I write a SQL statement that will Insert millions and Update millions of records in a Sql Server using T-SQL? While inserting the records the SQL should be able to create the primary key using a criteria. Example : Table 1 and Table 2 are joined by a unique key. And this data […]

SQL Identity with leading padded variable number of zeros

I need to zero pad my ID column for putting in drop down combo boxes, example 001 item text 101 item text 2 but if the numbers only went to 80, then we should have 01 item text 80 item text and so on, since I need to write this and allow tens / thousands […]

MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.