Viewing 15 posts - 1,441 through 1,455 (of 1,489 total)
select *
from YourTable
where ShipToNum not like '%[^0-9]%'
September 1, 2006 at 11:00 am
There are no BEFORE Triggers so you have to use an INSTEAD OF trigger or a SP.
September 1, 2006 at 3:38 am
Just noticed that you do not want AcctCode in addition to 'Payment Servi'.
This may work:
-- Do not have enough info to tell if distinct is needed
select distinct PR.PrmLog_Acct_Code, PR.PrmLog_Customer_ID
from dbo.PrmrLog...
August 31, 2006 at 11:47 am
A quick perusal of your code suggests that the following may work.
-- Do not have enough info to tell if distinct is needed
select distinct PR.PrmLog_Acct_Code, PR.PrmLog_Customer_ID
from dbo.PrmrLog PR
where exists (select...
August 31, 2006 at 11:29 am
If the position of the !'s is not fixed use the following, otherwise hardcode in the numbers.
ALTER PROCEDURE dbo.spGetInks
(@Company varchar(50), @Site varchar(50), @Zone varchar(50))
AS
SET NOCOUNT ON
SELECT D.[Name]
,D.[Description]
,RTRIM(SUBSTRING(D.[Description], D.P1 + 1, D.P2...
August 31, 2006 at 8:23 am
Sybase uses a different dialect of T-SQL. There is some documentation at:
http://manuals.sybase.com/onlinebooks/group-as/asg1250e/sqlug
August 31, 2006 at 7:00 am
I think you need to force the join order with something like:
select T1.[Name], T1.tracking_number, T2.start_date, T3.first_name, T3.last_name
from Table1 T1
left join
(
Table2 T2
join
( select T22.tracking_number, max(T22.start_date) as start_date
from Table2 T22
group by T22.tracking_number) D
on...
August 31, 2006 at 4:38 am
I think this would be best done either in the middle tier or by using a cursor.
If you have less than 1000 rows something like the following ghastly looking query...
August 30, 2006 at 10:54 am
Try sp_executesql with output parameters. Something like:
declare @EmployeeNo int, @AccessLevelID int, @err int
set @queryString = 'select @EmployeeNo = b.employee_no, @AccessLevelID = a.Access_Seq from '
+ @dbName + '..employee a, '...
August 30, 2006 at 7:26 am
-- Test data
declare @t table
(
refNo char(5) not null primary key
)
insert @t
select 'ABC-0' union all
select 'ABC-1' union all
select 'XYZ-0' union all
select 'XYZ-1' union all
select 'XYZ-2' union all
select 'PQR-0' union all
select 'MNO-0'...
August 24, 2006 at 9:21 am
Maybe you are trying to do something like:
DECLARE @t TABLE
-- or create a temp table
(
Policy_ProductId int not null primary key
,RowNum int identity not null )
INSERT @t (Policy_ProductId)
SELECT Policy_ProductId
FROM Policy_Product
INSERT INTO...
August 24, 2006 at 8:26 am
David,
WOW!
It took me 15 minutes to understand what you did. It is a lot more efficient than my approach.
All methods with their percentage of batch cost are below:
declare @t table
(
tDate...
August 23, 2006 at 8:45 am
Take the query:
select T.tDate as DateFrom
,isnull
(
(select min(tdate)
from @t T1
where T1.price <> T.price
and T1.tdate > T.tdate) - 1
, D.MaxTDate) as DateTo
,T.price
from @t T cross join
(
select min(T5.tdate),...
August 23, 2006 at 7:13 am
The select statements are only test data. You will have to adapt the query so it works on your table.
August 23, 2006 at 6:46 am
Viewing 15 posts - 1,441 through 1,455 (of 1,489 total)