Viewing 15 posts - 196 through 210 (of 267 total)
That was a really nice technique Scott
Unite And Conquer !
/rockmoose
June 8, 2004 at 10:06 am
You could do it in SQL:
create table #t(amount money not null)
insert #t select 25.23 union select 485.56
select
amount,
replicate('0',11-len(convert(varchar,amount)))+replace(convert(varchar,amount),'.','')
from
#t
drop table #t
Important:
The above will return NULL if amount > 99 999 999.9999
( You...
June 8, 2004 at 9:52 am
Weirdly enough, the CHECKSUM and BINARY_CHECKSUM functions do not take table aliases ( or names ) !?
For not having to type all the columnnames derived tables could be used.
select a.*,...
June 8, 2004 at 4:52 am
The Access issue is resolved here:
Tools -> Options -> Advanced -> And here is an option indicating the maximum number of rows.
(this is for Access 2000, and I don't have...
June 7, 2004 at 12:25 pm
Hi,
You would have to make use of dynamic sql.
Like so:
DECLARE @tablename SYSNAME
SET @tablename = 'MyTable'
EXEC( 'CREATE TABLE ' + @tablename + ' (Id INT NOT NULL PRIMARY KEY, Col1 CHAR(10)...
June 7, 2004 at 11:45 am
Hi,
Put the global constant(s) in a table.
Then write a scalar function to access the global constant(s),
Or just select from this table to retrieve the constant in the table.
If you need...
June 7, 2004 at 11:29 am
Check if the view is declared with a TOP 10000 clause.
And by the way there is no limit for views to only return 10000 rows.
/rockmoose
June 5, 2004 at 5:21 am
Yes,
And actually the correlated subquery technique only requires the table to have a Primary Key ( Or Unique Constriant ) defined on 1 column.
The requirement is that the Uniqueness is defined...
June 4, 2004 at 4:17 pm
Yup crosstabs is not a forte in SQL :-(, it could be easier to manage in code...
What You could do is write a method (in VB/C#... ) that takes a...
June 4, 2004 at 4:33 am
Another option is to use a Table Variable. This just creates a table in memory, a temporary table is "pysically" created in tempdb.
I use both techniques.
/rockmoose
June 4, 2004 at 2:50 am
This is a classic Crosstab query.
Search on this forum for "Crosstab" and you will come up with some tips, tricks and procs.
eg.
http://www.sqlservercentral.com/scripts/contributions/936.asp
/rokmooose
June 4, 2004 at 2:46 am
Sukhoi, select top2 ..... group by name, date order by date desc
will not work.
To get the result for a specific name you could do it like you suggest, but not...
June 4, 2004 at 2:38 am
You also could enumerate the groups within a group, and retrieve the ordinals from these enumerated groups that you arre interested in.
In this case You want the first two occurences...
June 4, 2004 at 1:55 am
Suggest: ( have omitted the CREATE VIEW statement )
1.
SELECT
twotab.mod_code,
SUM(twotab.sum_smo_mcrd) AS sum_smr_mcrd,
SUM(twotab.sum_smr_mcrd) AS sum_smr_mcrd
FROM
( SELECT mod_code, 0 as sum_smo_mcrd, SUM(smr_mcrd) AS sum_smr_mcrd
FROM dbo.ins_smr
GROUP BY mod_code
UNION ALL
SELECT mod_code, SUM(smo_mcrd) AS sum_smo_mcrd, 0...
June 3, 2004 at 3:04 am
I have two suggestions:
1. IF the UI guys are using .NET, they can make use of a dataset and perform all the changes in the dataset, then either commit or...
June 3, 2004 at 2:05 am
Viewing 15 posts - 196 through 210 (of 267 total)