Viewing 15 posts - 1,516 through 1,530 (of 2,007 total)
Yet another way: -
DECLARE @TABLE AS TABLE (col VARCHAR(100))
INSERT INTO @TABLE
SELECT 'Rice FarmingT'
UNION ALL SELECT 'Fruit and Tree Nut FarmingT'
UNION ALL SELECT 'Tree' --Non-modified row
UNION ALL SELECT 'Fruit' --Non-modified row...
September 22, 2011 at 9:43 am
RichardBo (9/22/2011)
Eg
DECLARE @val CHAR(19)
SET @val='08/31/2011 14:34:56'...
September 22, 2011 at 9:18 am
greg.bull (9/22/2011)
I am LEFT joining to a lookup table by product code to find a product cost. The problem is that in the lookup table there are multiple rows for...
September 22, 2011 at 7:12 am
Good afternoon!
It seems that your DDL script, which I'm sure you provided after visiting SSC more than 200 times, has somehow become detached and in its place is a...
September 20, 2011 at 6:23 am
MuraliKrishnan1980 (9/20/2011)
September 20, 2011 at 6:15 am
SELECT CASE WHEN firstname IS NULL
THEN 'xyz'
...
September 20, 2011 at 5:33 am
Firstly, this is the correct way to post sample data: -
DECLARE @TABLEA AS TABLE (account CHAR(8), HCS_Code CHAR(4))
DECLARE @TABLEB AS TABLE (account CHAR(8), HCS_Code CHAR(4))
INSERT INTO @TABLEA
SELECT 'AC_1234', 'ICP1'
UNION ALL...
September 20, 2011 at 5:29 am
nhimabindhu (9/20/2011)
option (maxrecursion 0)now Recursssion error wont occur if i write this code in that program
Yes, but it's still over 2x slower than the tally table solution I suggested.
StartDate '1901-01-01',...
September 20, 2011 at 4:45 am
nhimabindhu (9/20/2011)
DECLARE @EDATE DATETIME
DECLARE @MLIST TABLE
(MName VARCHAR(30))
SET @SDATE = '2000-09-20'
SET @EDATE = GETDATE()
WHILE (@SDATE < @EDATE)
BEGIN
INSERT INTO @MLIST
SELECT...
September 20, 2011 at 4:32 am
nhimabindhu (9/20/2011)
declare @date1 datetime
declare @date2 datetime
set @date1=GETDATE()
set @date2='2011-12-25'
;with cte as (
select datename(month,@date1) as [Month_Name],@date1 as dat
union all
select datename(month,DateAdd(Month,1,dat)),DateAdd(Month,1,dat) from cte
where DateAdd(Month,1,dat) < @date2)
select [Month_Name]...
September 20, 2011 at 4:06 am
Homework question?
How's this?
DECLARE @startdate DATE = '2011-09-20', @endate DATE = '2011-12-21'
SELECT a.months
FROM (VALUES(1,'January'),(2,'February'),(3,'March'),(4,'April'),(5,'May'),(6,'June'),(7,'July'),
(8,'August'),(9,'September'),(10,'October'),(11,'November'),(12,'December')) a(number,months)
WHERE a.number >= DATEPART(month,@startdate) AND a.number <= DATEPART(month,@endate)
September 20, 2011 at 3:41 am
rmechaber (9/16/2011)
jcrawf02 (9/16/2011)
rmechaber (9/16/2011)
September 16, 2011 at 10:14 am
ranask_47 (9/16/2011)
September 16, 2011 at 8:45 am
Please read this article[/url], to find out how you should be posting your query and about sample data which is required for us to help.
Obviously obfuscate your data in some...
September 16, 2011 at 8:29 am
Sudhir Dwivedi (9/16/2011)
DECLARE @str VARCHAR(255) =' rajneeh
kumar
is
working in technext'
SET @str = REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(@str, ' a', ' A'), ' b', ' B'), '...
September 16, 2011 at 7:13 am
Viewing 15 posts - 1,516 through 1,530 (of 2,007 total)