Viewing 15 posts - 886 through 900 (of 1,923 total)
Why would u run that as sp_send_DBmail ? You should use EXEC or sp_ExecuteSQL for this..
March 19, 2011 at 11:16 am
Here you go:
IF OBJECT_ID('DisplayMatrixAsWeeks','P') IS NOT NULL
DROP PROC DisplayMatrixAsWeeks
GO
CREATE PROCEDURE DisplayMatrixAsWeeks
@Input_Month INT,
...
March 18, 2011 at 4:03 pm
Josh, with 162 visits and 47 points, you would atleast be knowing how to post a question.. without your table structure, sample data we are just going to guess and...
March 18, 2011 at 1:02 am
These are the problems .
1. No source tables (tables that are addressed in the SP)
2. No sample data for the tables
3. No sample input parameters for the SP
last but not...
March 17, 2011 at 11:15 pm
How about this:
select * from #test where right(SUBSTRING((col+' '),(CHARINDEX('rate',col)),5),1) = ' '
March 16, 2011 at 6:09 pm
There are 3 ways with which u can do that
This may use indexes, if present.
Select * from #test where col LIKE '%rate is 5%'
THis wont use indexes
Select * from...
March 16, 2011 at 3:50 pm
How about this?
declare @table table
( OrderDate datetime ,
CustomerID int,
OrderAmount int
)
insert into @table
select '1/1/2000', 1, 10
union all select '1/1/2000' ,1, 25
union all select '2/1/2001'...
March 16, 2011 at 1:05 am
Thats a function much like your normal IDENTITY property of a column.
You can refer and learn more about that function HERE
I'am sorry , i am actually in the middle...
March 16, 2011 at 12:46 am
How about this?
SELECT IDENTITY(INT, 1, 1 ) AS ID , Col1 , Col2 ......Col52
INTO New_Table
FROM Old_Table
CREATE UNIQUE NONCLUSTERED INDEX IDX_New_Table_ID
ON New_Table(ID)
March 16, 2011 at 12:34 am
Try this:
declare @employeetype table
( typeid int , emptype varchar(25) )
insert into @employeetype
select 1 ,'FTE'
union all select 2, 'Trainee'
union...
March 15, 2011 at 11:03 pm
The number of column returned by the EXEC statement is dynamic ?? I mean, for each execution of the SP, will it return inconsistent number of COLUMNS ?
March 15, 2011 at 10:48 pm
GilaMonster (3/15/2011)
What's the logic for the new date column? How does it relate to the other columns?
Gail, i guess the OP is trying to convert the as_of_date in the table...
March 15, 2011 at 1:53 pm
Try this:
UPDATE #TableName
SET AS_OF_DATE2 = CAST ( STUFF( STUFF (AS_OF_DATE,5,0,'-') , 8 ,0,'-') AS DATETIME)
March 15, 2011 at 1:49 pm
Cross post - Please redirect ur replies to http://www.sqlservercentral.com/Forums/Topic1077515-149-1.aspx
March 13, 2011 at 7:37 pm
THis is the proc:
IF OBJECT_ID('CalculateTax','P') IS NOT NULL
DROP PROCEDURE CalculateTax
GO
CREATE PROCEDURE CalculateTax
AS
BEGIN
UPDATE P
SET P.Tax = T.Tax_Amount
FROM Products P
JOIN Tax T
ON p.amount BETWEEN T.range_start AND T.range_end
...
March 13, 2011 at 7:07 pm
Viewing 15 posts - 886 through 900 (of 1,923 total)