Viewing 15 posts - 76 through 90 (of 898 total)
Sean Lange (7/2/2014)
Kingston Dhasian (7/2/2014)
Sean Lange (7/2/2014)
Kingston Dhasian (7/2/2014)
Sean Lange (7/2/2014)
Kingston Dhasian (7/2/2014)
July 2, 2014 at 8:54 am
Sean Lange (7/2/2014)
Kingston Dhasian (7/2/2014)
Sean Lange (7/2/2014)
Kingston Dhasian (7/2/2014)
But, I would like...
July 2, 2014 at 8:02 am
Sean Lange (7/2/2014)
Kingston Dhasian (7/2/2014)
But, I would like to avoid any INSERT's,...
July 2, 2014 at 7:40 am
kapil_kk (2/10/2014)
ChrisM@Work (2/10/2014)
kapil_kk (2/10/2014)
ChrisM@Work (2/10/2014)
balu.arunkumar (2/10/2014)
/*------------------------
SELECT*, SUM( Price ) OVER( Partition BY Customer_Name ORDER BY DatePurchased) AS Total_Till_Date
FROM#sample where Customer_Name='A'
------------------------*/
Msg 102, Level 15, State 1, Line...
February 10, 2014 at 7:15 am
Something like this..
SELECT*
FROM(
SELECT*, ROW_NUMBER() OVER( PARTITION BY Customer_Name ORDER BY DatePurchased ) AS RN
FROM(
SELECT*, SUM( Price ) OVER( PARTITION BY Customer_Name ORDER BY DatePurchased ) AS Total_Till_Date
FROM#sample
) AS S
WHERETotal_Till_Date >=...
February 10, 2014 at 5:19 am
The below given script is one that I use for such random tasks
DECLARE@strSQL VARCHAR(MAX)
DECLARE@strTableName VARCHAR(100)
DECLARE @strWhereClause VARCHAR(MAX)
SET@strTableName = 'mstEmployees' -- Put you View Name here
--SET@strWhereClause = 'EmployeeID IN (2,26,38)' --...
November 13, 2013 at 12:36 am
I don't think you need to generate an INSERT script from the VIEW for that
Try something like this
INSERTYourTableName( Column1, Column2, ... )
SELECTColumn1, Column2, ...
FROMYourViewName
(optional WHERE Clause)
November 12, 2013 at 4:16 am
Why do you want to create INSERT script from a VIEW? You cannot insert data into all views.
INSERTS are generally done on tables and you should creating scripts out of...
November 12, 2013 at 3:49 am
david.kotchie (9/12/2013)
I feel like I owe you my firstborn!! Can't thank you enough for this, worked like a charm!!!
You guri know your stuff. I should have known it...
September 12, 2013 at 8:15 am
Your explanation is not very clear enough. What do you mean by return( return a value or a result or a column name or ... )?
You can use the INFORMATION_SCHEMA.COLUMNS...
September 11, 2013 at 4:17 am
These are all same in my opinion except your 3rd query( It will always print an "1" as an output which is not what you want )
You can check the...
September 11, 2013 at 2:58 am
One of the ways to achieve it..
DECLARE@tableSTK TABLE
(
ItemIDVARCHAR(8),
ItemDescVARCHAR(100),
PriceMONEY
)
DECLARE @tableABC TABLE
(
ItemIDVARCHAR(8),
ConditionAmtMONEY,
Return_AmtMONEY
)
INSERT@tableSTK
( ItemID, ItemDesc, Price )
SELECT'04400110', 'A4 Paper', 30.00 UNION ALL
SELECT'08800220', 'Bic Pen 5.0',...
September 11, 2013 at 2:34 am
I am not sure if this is the best way to do it. But, this is what I could come up with( An UNPIVOT followed by a CROSS-TAB )..
DECLARE@tbl TABLE
(
CategoryVARCHAR(10),
PrevWk2NUMERIC(5,2),
PrevWk1NUMERIC(5,2),
CurrWkNUMERIC(5,2)
)
INSERT@tbl
...
September 11, 2013 at 1:02 am
Please note that this thread is more than 3 years old.
August 23, 2013 at 6:42 am
Viewing 15 posts - 76 through 90 (of 898 total)