Viewing 15 posts - 931 through 945 (of 1,229 total)
Bob
Have a look at the output from this:
CREATE TABLE #Test ([Response ID] INT, Company VARCHAR(15), Amount MONEY, [Quarter] INT, [Year] INT)
INSERT INTO #Test ([Response ID], Company, Amount, [Quarter], [Year])
SELECT...
April 19, 2011 at 8:07 am
kr.nithin (4/19/2011)
This is a Vendor table. This already has a primary key. The requirement is Alphabets as the unique key rather than the numeric primary key.
So the numeric "primary...
April 19, 2011 at 7:51 am
Comment out the joins to the tables apart from bm and bp:
FROM[VEMA-FACS1].FUELFACS.dbo.bulk_movement AS bm
INNER JOIN[VEMA-FACS1].FUELFACS.dbo.bulk_product AS bp
ON bp.bulk_movement_id = bm.bulk_movement_id
--INNER JOIN[VEMA-FACS1].FUELFACS.dbo.terminal_product AS tp
--ON tp.terminal_product_number = bp.terminal_product_number
--INNER JOIN[VEMA-FACS1].FUELFACS.dbo.supplier AS...
April 19, 2011 at 7:37 am
kr.nithin (4/19/2011)
I have a table that is already populated. I need to add a new column & the values in the column should be AA, AB, AC, AD, AE,...
April 19, 2011 at 7:24 am
For an update like this, the Running Totals algorithm described here[/url] by Jeff Moden can't be beaten. If you were looking to output the results in the manner you describe...
April 19, 2011 at 6:43 am
Karan_W (4/19/2011)
... If all the statement inside try clause execute successfully then commit the transaction else roll back all transaction...
How about posting the whole sproc?
April 19, 2011 at 6:37 am
marwa.elghali (4/19/2011)
April 19, 2011 at 4:00 am
Check out the rules for identifiers in Books Online. Embedding a "dot" in the column name breaks the rules for regular identifiers and forces the use of delimiters. Why not...
April 19, 2011 at 3:11 am
Put the COLLATE into the SELECT from the #temp table:
Declare @SaleCategory as varchar(255)
Set @SaleCategory = 'Outer Wear, Mens, Foot Wear, N/A'
select Item
INTO #mytemp
from [dbo].[DelimitedSplitN4K] (@SaleCategory, ',')
Select distinct...
April 18, 2011 at 1:44 pm
doug 40899 (4/18/2011)
April 18, 2011 at 12:55 pm
Jeff's posted an updated version of the string splitter here.
I usually stream the results of a string-splitter into a #temp table then use that in the main query.
April 18, 2011 at 11:50 am
Tom.Thomson (4/18/2011)
Jeff Moden (4/17/2011)
Tom.Thomson (4/17/2011)
Incidentally, you can't call a stored procedure using OPENQUERY either.Maybe not, but OPENROWSET works a treat.
.... Spending too much time on learning Castellano and...
April 18, 2011 at 11:38 am
parthi-1705 (4/18/2011)
Lynn Pettis (4/18/2011)
parthi-1705 (4/18/2011)
Lynn Pettis (4/18/2011)
select
'id: ' + id + ';' +
'name: ' + name + ';'...
April 18, 2011 at 11:35 am
applebutton (4/18/2011)
DECLARE @SaleDate datetime;
SET @SaleDate = GETDATE();
EXEC dbo.GetSales @SaleDate, '''Outer Wear'', ''Mens'', ''Foot Wear'', ''N/A''';
GO
DB table has data.
If hard code it like this:
a.
category...
April 18, 2011 at 10:24 am
parthi-1705 (4/18/2011)
Lynn Pettis (4/18/2011)
select
'id: ' + id + ';' +
'name: ' + name + ';' +
...
April 18, 2011 at 10:11 am
Viewing 15 posts - 931 through 945 (of 1,229 total)