Please support our MS SQL advertiser: Programming Forums
![]() |
•
•
Join Date: Nov 2007
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
Hoping someone can shed some light on this one, using MSSQL 2000,
I have a query like this;
Select T.TransactionRecordClass, T.ClassDetail from [remoteserver].otherdb.dbo.Data T where T.TransactionRecordClass like '10000002%'
which will return around 10000 records in under 1 second.
My issue is that I need to make this part of a function, but as soon as I add parameters/variables, it goes from returning in under 1 second, to 11 minutes!!!
DECLARE @TRC_ID nvarchar (9)
SET @TRC_ID = rtrim('10000002') + '%'
Select T.TransactionRecordClass, T.ClassDetail from [remoteserver].otherdb.dbo.Data T where T.TransactionRecordClass like @TRC_ID
There is a non-clustered index on the 2 fields being returned , and about 77 million records in the table. I have attempted using Index hints, but found they are not allowed on remote queries..... So... any clues????
Thanks in advance for any help
I have a query like this;
Select T.TransactionRecordClass, T.ClassDetail from [remoteserver].otherdb.dbo.Data T where T.TransactionRecordClass like '10000002%'
which will return around 10000 records in under 1 second.
My issue is that I need to make this part of a function, but as soon as I add parameters/variables, it goes from returning in under 1 second, to 11 minutes!!!
DECLARE @TRC_ID nvarchar (9)
SET @TRC_ID = rtrim('10000002') + '%'
Select T.TransactionRecordClass, T.ClassDetail from [remoteserver].otherdb.dbo.Data T where T.TransactionRecordClass like @TRC_ID
There is a non-clustered index on the 2 fields being returned , and about 77 million records in the table. I have attempted using Index hints, but found they are not allowed on remote queries..... So... any clues????
Thanks in advance for any help
Last edited by schismaticus : Nov 1st, 2007 at 4:51 pm.
![]() |
Similar Threads
Other Threads in the MS SQL Forum
- Clock running slow (Windows Vista)
- Strings and the new operator? (C++)
- ATI Radeon 9800 Issue (Monitors, Displays and Video Cards)
- HP Pavilion DVdv2000 not booting..kinda (Troubleshooting Dead Machines)
- Odd video problem (Windows NT / 2000 / XP / 2003)
- Network Connectivity Issue, Verizon DSL (Networking Hardware Configuration)
- Overloading assignment operator (C++)
- WLAN signal unstable (Networking Hardware Configuration)
- sony LCD monitor with odd discoloration (Monitors, Displays and Video Cards)
- Even / Odd code HELP!! (Java)
Other Threads in the MS SQL Forum
- Previous Thread: 'There is already an object named 'ProductID' in the database.'
- Next Thread: Get data out of excel file stored as an image
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)





Linear Mode