SQL Server 2008 Full-Text Search (FTS) is extremely slow in this scenario:
Query 1:
SELECT [...] FROM ContentItem CI WHERE
(EXISTS (SELECT TOP 1 * FROM CONTAINSTABLE([Table1], *, '"[search_string]*"') FT
WHERE FT.[Key] = CI.ContentItem_Id))
ORDER BY [...]
Results: super fast on SQL 2005 and SQL 2008
Query 2:
SELECT [...] FROM Con...
i am updating/inserting/deleting values on more than 1 database and want to implement a transaction.
currently its done like
try{
db[1].begintransaction();
db[1].ExecuteNonQuery();
db[2].begintransaction();
db[2].ExecuteNonQuery();
...
db[N].begintransaction();
db[N].ExecuteNonQuery();
// will execute only if no exception raised du...
I want to store additional information on my users (address, phone).
Should I extend the registration page on the sample mvc template or should I set up a separate "profile" table and have that be a separate page?
It seems nice to do it on the registration page, but I am not sure if there are issues playing around with the "aspnet_"......
hi,
can we use column number instead of column name in where condition of a select query in SQL Server 2005 so that even if the column name is so long.
thanks in advance.
...
Hi there,
I have a byte array highlighted below, how do I insert it into a SQL Server database Varbinary column?
byte[] arraytoinsert = new byte[10]{0,1,2,3,4,5,6,7,8,9,10};
string sql =
string.format
(
"INSERT INTO mssqltable (varbinarycolumn) VALUES ({0});",WHATTODOHERE
);
Thanks in advance guys!
...
Hi,
Let's say I have a very large database. Its backup starts at midnight and finishes at 02:00 am.
When I recover that backup am I gonna have the state of the database at midnight or 02:00 (or something else)?
Going one step further, let's say that I have multiple databases which contain references to each other's elements. If I back...
I have a web service that stores data in a local SQL Server 2008 database. If I run the web service under my account the web service can successfully access the database. However, if I use the DefaultAppPool (IUSR) account then accessing the database from the web service fails.
How do I set security on SQL Server to allow access to a s...
This problem has bugged me so many times and i have now decided to try and find the proper solution for it, instead of my long-winded/dirty/horrible way I always revert to (copying the sql statement)
The table has a date column with a default value of NULL
Now what i need to do is pass a value (-1,0,1) to an sql statement which determi...
Suppose table 1 Have 1,000,000 rows. In table 2 there are 50,000 rows
INPUT
Table 1
Id User InternetAmountDue
1 joe NULL
Table 2
InternetUserId UserName AmountDue
21 kay 21.00
10091 joe 21.00
I want to merge data from table 2 to table 1 as follows:
If user exists in Table 1, upda...
Hi
I am using Sql Server with Composite key. In this composite key contains one identity column i.e Auto incrment value. i want to generate in this column with duplicate values. How can i do this. Please give me a solution for this.
Thanks with Regards
Saravanan.M
...
Hi, In SSIS packages i want the see the compelete detail of logs like how many rows are inserted throug my packages etc
please help me how can i configure it ?
...
I understand that when adding a column to a table containing data in SQL server, the column must have a NULL option or a default. Otherwise what would SQL Server pad the new rows with?
I am at a loss as to why I can't add a NOT NULL column to an empty table however. I have tried this on two instances of SQL 2008 and one instance of SQL ...
Is it possible to create a SQL Server function which returns a nullable string?
I would like to create a function which returns DBNull if the value is 0 or an empty string:
Create FUNCTION [dbo].[SetDBNullNvarChar] (@input nvarchar(1000))
RETURNS (needs to be nullable)
AS
BEGIN
if (@input = '' OR @input = 0)
BEGIN
RETURN n...
We currently have a View that queries active directory info. I was wondering if there was a good reference as to what fields (field names) are available in AD for me to query against. I don't have access to Active Directory so I can't go playing around in there to maybe figure it out myself. Any help would be appreciated.
...
Hi, the code below works fine but it takes an absolute age to run. How can I speed this up?
Background: I have linked my local server to my remote server. From my local server, I need to insert data from the remote server into my local server and then update the table on my remote server. See snippet for the exact details.
DECLARE @tem...
I am creating a SQL Server database programmatically during a conversion. If the conversion code fails I want to delete/drop the database. If I use the shortcut menu for the database in SQL Server Management Studio 2005 the "delete" option is disabled. DROP DATABASE command also fails with message "Cannot drop database "XYZ" because it i...
Is there some kind of plug in you can get for Microsoft SQL management studio that will:
1) help you format your sql (configuration, so we can get it to match our codeing guidelines)
2) highlight syntax that does not match our coding guidelines
For example if a tool could format the sql so that all selects look like:
SELECT
tbl1.[C...
Would it be possible rollback transactions using Transactionlog file for a particular record?
I am using MS SQL 2005.
...
I am trying to become more familiar with SQL by writing queries against the Northwind database.
I am looking for some exercises that would help me to learn SQL and features of SQL Server. It is important that the exercises have solutions, and in complicated cases, it would be great if there was an explanation for the query.
Thanks ...
Will there be any further resultset to process if the lookup table in the lookup task is empty?
sagar
...