Viewing 15 posts - 526 through 540 (of 1,923 total)
Some examples:
DECLARE @IPTable TABLE ( IP_Address VARCHAR(15))
INSERT INTO @IPTable (IP_Address)
SELECT '1.2.3.4'
UNION ALL SELECT '11.12.13.14'
UNION ALL SELECT '21.22.23.24'
UNION ALL...
February 16, 2012 at 5:06 pm
You can use PARSENAME function to accomplish that.
February 16, 2012 at 5:01 pm
THere is something called as Output Parameters while defining a Stored Procedures. Thats what you are looking for .
Here is the link : CREATE PROCEDURE
To be precise, Example C...
February 16, 2012 at 4:59 pm
Cross Post.. divert your replies here http://www.sqlservercentral.com/Forums/Topic1253537-392-1.aspx
February 16, 2012 at 4:53 pm
Or:
SELECT
Id,
Overseas,
scholarship,
ResultCol =
STUFF( ( CASE WHEN OVERSEAS = 'True' THEN ',FRN' ELSE '' END
...
February 16, 2012 at 4:52 pm
How about this?
SELECT
Id,
Overseas,
scholarship,
ResultCol =
CASE WHEN OVERSEAS = 'True' THEN ',FRN' ELSE '' END
+ Case WHEN scholarship = 'True' THEN ',SCH' ELSE '' END
FROM #sample;
Results:
IdOverseasscholarshipResultCol
111,FRN,SCH
201,SCH
310,FRN
February 16, 2012 at 4:49 pm
Like this:
DECLARE @Table TABLE ( TextData VARCHAR(100))
INSERT INTO @Table ( TextData )
SELECT 'Product 123'
UNION ALL SELECT 'Another Product 14 XX'
UNION...
February 9, 2012 at 11:03 pm
This?
declare @table table ( id int, sourcecode int, dt datetime)
insert into @table
select 1, null ,'02/06/12'
union all select 2, 2333 ,'02/07/12'
union all select 2, 2345 ,'02/07/12'
union all select 2, null ,'02/07/12'
union...
February 8, 2012 at 6:33 pm
Not sure and clear on your requirement. Can you please take a gander at the following article and give us more information?
I sense your requirement is going to be...
February 7, 2012 at 6:00 pm
fahey.jonathan (2/7/2012)
ColdCoffee (2/7/2012)
This?
DECLARE @Date1 DATE = GETDATE()-1,@Date2 DATE = GETDATE()-29
SELECT @Date1 , @Date2
[invoice date] BETWEEN @Date1 AND @Date2
This code will not...
February 7, 2012 at 5:26 pm
here
Use tempdb
GO
create proc getsthedate @dateval datetime
as
select @dateval ;
GO
declare @d datetime = getdate()
exec getsthedate @dateval = @d;
exec getsthedate @dateval = getdate() ;
drop proc getsthedate;
February 7, 2012 at 5:16 pm
You cannot use Functions as direct input parameters. Initialize it to a variable and use it as an input parameter
February 7, 2012 at 4:53 pm
Not unless you can code using Dynamic-SQL or a series of IF clauses!
February 7, 2012 at 3:19 pm
This?
DECLARE @Date1 DATE = GETDATE()-1
,@Date2 DATE = GETDATE()-29
SELECT @Date1 , @Date2
[invoice date] BETWEEN @Date1 AND @Date2
February 7, 2012 at 11:29 am
Viewing 15 posts - 526 through 540 (of 1,923 total)