Can I choose to ignore the tsENU.xml thesaurus file in a full-text query in SQL Server 2005?
IF @x = 0 THEN
BEGIN
SELECT FROM FREETEXTTABLE(use subtitutions and expansions in thesuarus)
END
ELSE
BEGIN
SELECT FROM FREETEXTTABLE(just match based on the exact query terms, no thesuaurs)
END
...
Suppose - I have the following Table Structure
elementid, parentid, elementtitle, sortorder
160 0 Brand New Tutorial 1
161 160 Brand New Tutorial New Step 1
168 5 Tutorial Topic 1.1 1
171 168 Tutorial Topic 1.1.1 1
172 171 Tutorial Topic 1.1.1.1 ...
I'm introducing Tarantino Database Management into a project, which has a brand new database schema. The only change (located in 0001_InitialSchema.sql) is the creation of the tables used in ASP.NET Membership. I generated the tables using aspnet_regsql.exe and then scripted them as CREATE TO scripts, then combined them into my single Ta...
I am experiencing some strange behavior with OSQL, and would appreciate any help.
I have a batch file that will copy a database field from one column to another. Here is a sample script:
SET NOCOUNT ON;
UPDATE Table1 SET Table1.EmailAddress = Table2.GenericField FROM Table1
INNER JOIN Table2 ON Table1.ID = Table2.ID WHERE GenericFiel...
Is there a way in Microsoft SQL Server Management Studio, to program a function key?
I'd like to map a function key to "SELECT * FROM dbo."
...
hello, i have my server written with structure map and fluent nhibernate,
when i run my server from my pc and direct him to the db on another server i get a sqlexception that tells me that the timeout expired
this is the message :
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not resp...
I have the following SQL query:
select AuditStatusId
from dbo.ABC_AuditStatus
where coalesce(AuditFrequency, 0) <> 0
I'm struggling a bit to understand it. It looks pretty simple, and I know what the coalesce operator does (more or less), but dont' seem to get the MEANING.
Without knowing anymore information except the query above,...
Hello,
I remember back in the day I would make a whole wack of nvarchar(4000) vars, check the length of them as they grew, switch them out as they filled up and then concatenate the whole mess together for the exec call. I was wondering if there was an easier way of doing it.
Thanks!
Edit:
Code Sample, shows me screwing up the case s...
How to use sp_addextendedproperty for package audit
...
How do I round the result of matchpercent to two decimal places (%)?
I'm using the following to return some results:
DECLARE @topRank int
set @topRank=(SELECT MAX(RANK) FROM
FREETEXTTABLE(titles, notes, 'recipe cuisine', 1))
SELECT
ftt.RANK,
(CAST(ftt.RANK as DECIMAL)/@topRank) as matchpercent, --Round this
titles.title_id...
I have an application running in IIS which connects to a SQL Server 2008 R2 instance using windows integrated authentication. This application does simple read/write operations in the db using a set of stored procedures. I can restrict the privileges in SQL server quite well for this login/user combination.
But for a small subset of the...
I have inherited a piece of SQL that I am working on for a reporting system. The system is centered around Purchase Orders, and when they are Created, Transmitted, Acknowledged, and Confirmed. These states are a progressive state. The piece of SQL that I am reviewing is shown below and is from the WHERE clause:
OR (CreateJob.endtime is ...
UPDATE: I have determined that the SQLClient code times out on the first call, but works on all subsequent calls. Also, when connecting with Management Studio, it times out the first time as well, then connects when I try again. Ideas?
Original:
Hey guys,
I have a very strange issue that I can't seem to resolve. I have an application...
Hi All,
I have a flat file source as
SOURCE1~SOURCE2~SOURCE3
1~2~3
1~2~3
target is
1~2~3
1~2~3
which is normal case.
now the scenario as my extract has changes to
SOUCE2~SOURCE1~SOURCE3
1~2~3
1~2~3
now the target is still
1~2~3
1~2~3
but needs to get as
2~1~3
2~1~3
the data in the target table is not dynamically getti...
Based on the below table and inputs:
Id RelatedId
--------------
1 1
1 2
1 3
2 2
2 3
2 4
3 5
Inputs are @input_1 = 2 and @input_2 = 3 (input count can vary)
I want to select only those Ids from the above table that have both these input in their corresponding RelatedIds.
So, based on the give inputs, output will be...
I'm not sure sure how to interpret this, but all the queries I run in sql server 2005 have a "query cost (relative to batch)" of 100%. Is there any way to reduce the cost?
...
I'm trying to change all the NULLs in an INT column to an incrementing value using a statement like this:
UPDATE [TableName] SET [ColumnName] = dbo.FunctionName() WHERE [ColumnName] IS NULL
where the function looks like this:
CREATE FUNCTION FunctionName() RETURNS INT AS
BEGIN
RETURN (select MAX(ColumnName) + 1 from TableName)
EN...
I'm doing such a small web page that contain 4 main HTML div which should contain last 4 NEWS from a SQL Database.
so I've designed them, and put in each on a label control, and an Image control.
and to bind information from the SQL to them, I've used (DataView) object, and using a loop from 0 to 3 I've get the data I need.
but I be...
I am trying to do some operation in column 'Increment' based on previous row record in column 'Value'
e.g.
row_num| Period | Measure | Decay
1 | Jan 08 | 10 |
2 | Feb 08 | 18 |
3 | Mar 08 | 7 |
4 | Apr 08 | 67 |
i would like to update column 'Decay' based on a formula
row_num| Period | M...
Hi, i just installed SQL Server 2008 and imported AdventureWorksDatabase (for SQL 2005, as for 2008 that didn't worked).
It is now enforcing case sensitivity when i searched for any tables, views etc
Hence Person.contact table when written throws an error of Invalid column name, but when Person.Contact is written it shows all rows.
Pl...