Viewing 15 posts - 181 through 195 (of 907 total)
Gee I don't know what I was thinking. A sole replace is not going to do it. But multiple replaces with a ltrim will:
replace(ltrim(replace(<value with leading zeroes>,'0',' ')),' ',0)
Gregory...
August 28, 2003 at 7:40 pm
Here is a query that would work for you, but is slow on large sets if no index is available. I would create a composite index on group, qty,...
August 28, 2003 at 3:00 pm
Try using the replace something like:
declare @lz varchar(10)
set @lz = '000001'
select @lz
select replace(@lz,'0','')
Gregory Larsen, DBA
If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples
August 28, 2003 at 11:23 am
The evaluation copy is a great idea, but why not own your very own copy of SQL Server. The price of buying the developer edition of SQL Server...
August 28, 2003 at 7:24 am
I think if you would have created the following clustered, or nonclusted index on you test table like below, then ran the update command I supplied you would find that...
August 27, 2003 at 12:30 pm
Now, since the UNION statement removes duplicates the UNION example will only work if there are no duplicate records in table A and B. Here is an example where...
August 27, 2003 at 8:17 am
Nice way to use the UNION statement to determine if two sets are equal.
Gregory Larsen, DBA
If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples
August 27, 2003 at 8:11 am
I would expect this to be a CPU bound process that might cause your CPU to spike, but I'm not sure how you are came up with the 7,540,000 number....
August 26, 2003 at 2:37 pm
You probably caught my typo. These query should have been:
select * from test a
where disamount in (select top 20 disamount from test where area = a.area order by...
August 26, 2003 at 12:30 pm
Think something like this might work for you:
select * from test a
where disamount in (select top 20 disamount from testz where area = a.area order by disamount desc)
Gregory Larsen,...
August 26, 2003 at 12:27 pm
You could write yourself some code that does that, like:
create table a (a int primary key, b int)
create table b (a int primary key, b int)
insert into a values(1,1)
insert into...
August 26, 2003 at 11:09 am
Try something like:
SELECT * INTO #temp
from Select * from TBL_test
or
SELECT * INTO #temp2
from Select * from TBL_test where col1 = 'abc'
Gregory Larsen, DBA
If you looking for...
August 26, 2003 at 10:03 am
You might also try:
select * from information_schema.columns where table_name = '<yourtable>'
Gregory Larsen, DBA
If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples
August 26, 2003 at 9:33 am
I have to admit Calvin Lawson is correct the while loop is much easier to read and understandable, but I had to see for myself which performed better. ...
August 25, 2003 at 8:09 am
The real solution is on my website. You just need two more replace statements like so to handle all cases. Also if you want an inline solution a...
August 21, 2003 at 5:38 pm
Viewing 15 posts - 181 through 195 (of 907 total)