Viewing 15 posts - 1,111 through 1,125 (of 1,347 total)
Is the data the same, or just the table structure the same ?
What is the data type of column VALUE1 ? If you run this query in both databases, what...
March 4, 2005 at 1:46 pm
As sugegsted try a join, or try replacing the IN with an EXISTS:
select CASE WHEN Invoice_FK IS NOT NULL THEN 'Invoice ' + ' Invoice_ID:' + CONVERT(VARCHAR,INvoice_fk) END
, Amount...
March 4, 2005 at 8:21 am
Try with a UNC and shared folder ?
C:\>bcp "Northwind.dbo.Region" out "\\Server2\ShareName\zz_region3.txt" -Sserver2 -c -T
March 3, 2005 at 4:00 pm
You may also want to look into adding locking hints to the processes which are reading the data. Depending on your requirements, you may be able to use WITH NO_LOCK...
March 3, 2005 at 11:35 am
Behind the scenes, Sql Server creates a physical index to implement the constraint.
You can see this by querying the sysindexes system table by querying "where sysindexes.id = object_id('YourTableName')".
Queries that have...
March 3, 2005 at 11:25 am
You need a virtual table that returns the ID's you want to use, then join this to the main table to exclude the dupes in the Sum():
Select Sum(DeniedCharge)
From DenialStore As DS
Inner Join
(
...
March 2, 2005 at 10:55 am
Depends on your business. Is Saturday a business day ? What if a public holiday falls on a business day right before a weekend at the end of the month...
March 1, 2005 at 3:48 pm
Select *
From mytable
Where unit_id = @unit_id
And IsNull(product_id, -1) = IsNull(@product_Id, -1)
Replace -1 with the correct datatype for the ID and if -1 is a valid ID in your domain, replace the hard-coded...
March 1, 2005 at 3:02 pm
1 thing that jumps out is the lack of clustered index - so although a fillfactor of 90 is being specified, it only applies to the relatively small index on...
March 1, 2005 at 1:16 pm
Post the DDL, relationships between the tables and sample data.
You could use SELECT DISTINCT *, which will not run as quickly ... and won't solve the underlying problem of either...
March 1, 2005 at 12:04 pm
What if there's a tie for revenue ?
If there's a tie, the sub-query will return you top 2 rows, but if you join that based solely on Revenue, you can...
March 1, 2005 at 11:03 am
You may get an elegant soultion to this via sub-queries, but I'd typically solve this with a temp-table (or table variable) that applies a Sequence number to it. Note, in...
March 1, 2005 at 10:23 am
Viewing 15 posts - 1,111 through 1,125 (of 1,347 total)