Viewing 15 posts - 136 through 150 (of 240 total)
Try this:
declare @Items table(ItemID int, Location char(3), Quantity int)
insert @Items values(1234,'mux',25)
insert @Items values(1234,'lux',30)
insert @Items values(1234,'abc',21)
insert @Items values(1234,'cbe',15)
insert @Items values(5647,'mux',1)
insert @Items values(5647,'kuc',3)
insert @Items values(5647,'jud',6)
select mux.ItemID
,mux.Quantity as 'mux'
,lux.Quantity as 'lux'
,abc.Quantity as 'abc'
,cbe.Quantity...
February 28, 2006 at 9:08 am
Try this:
declare @Items table(ItemID int, Location char(3), Quantity int)
insert @Items values(1234,'mux',25)
insert @Items values(1234,'lux',30)
insert @Items values(1234,'abc',21)
insert @Items values(1234,'cbe',15)
insert @Items values(5647,'mux',1)
insert @Items values(5647,'kuc',3)
insert @Items values(5647,'jud',6)
select mux.ItemID
,mux.Quantity as 'mux'
,lux.Quantity as 'lux'
,abc.Quantity as 'abc'
,cbe.Quantity...
February 28, 2006 at 9:07 am
Personally, I always use a permanent copy of the "Numbers" table too. It is one of the first things that I install on each SQL server. I was just including a...
February 26, 2006 at 7:25 pm
Is MS DTC running on Server 2?
February 24, 2006 at 2:14 pm
I am not clear but in each of the 10 2000 character fields, do you intend on string a comma delimited list of emails?
This should be further normalized into a...
February 24, 2006 at 1:13 pm
I may have misread you problem and realized that you are using European style dates and what you really want is the dates between 01 Jan 2005 and 05 Jan 2005.
This...
February 24, 2006 at 1:03 pm
Won't this just return all dates between the two earliest and latest rows in the database, including dupclicates?
This would work better:
SELECT DISTINCT MyDateField
FROM MyTableName
WHERE MyDateField > @MinDateField
AND MyDateField < @MaxDateField
But,...
February 24, 2006 at 12:55 pm
This is the method that I've used to do this.
Using a cursor concatenate the varchar() field won't work because of the 8000 character limit on varchar fields.
Any method involving...
February 24, 2006 at 12:47 pm
Are you sure that the problem is on the SQL server and not the client application?
February 24, 2006 at 12:43 pm
Its acceptable to use when it needs to be but there are some extra percautions that need to be taken to ensure security.
When using arguments that are passed in they...
February 24, 2006 at 9:24 am
It is a good idea not to try and do data layout in a stored procedure or SQL statement. You should return the data as a set and have some...
February 24, 2006 at 9:17 am
set @i = ID = @i + 1, read from right to left increments the value of the local variable @1, assigns this value to the ID column of the...
February 24, 2006 at 9:11 am
I usually find that the use of an IN is slower than doing an inner join to the function or table.
February 24, 2006 at 9:00 am
Actually, in this case the default size is 1.
CREATE PROCEDURE dbo.GET_USER_DETAIL (@lan_id varchar)
AS
print '<' + @lan_id + '>'
GO
exec GET_USER_DETAIL 'jeff'
The output is <j>
February 24, 2006 at 8:49 am
Antares second option is what I frequently use. Here is a sample
DECLARE @paramlist NVARCHAR(100)
SET @paramlist = '7|2|8|65' -- test data; string can be any number of indices
SET @paramlist = '|'...
February 23, 2006 at 12:50 pm
Viewing 15 posts - 136 through 150 (of 240 total)