Viewing 15 posts - 4,426 through 4,440 (of 7,636 total)
wrt the missing bits: you should be aware that SQL Server places severe restrictions on what you can do in and with user defined functions. In particular, you cannot...
December 14, 2008 at 11:17 pm
Hmm, I think that we must have interpreted his post differently, Chris.
December 14, 2008 at 1:47 pm
Something like this:
Select *
From yourTable
Order By (Case When col=1 then 0 else 1 End), Col1
December 14, 2008 at 1:45 pm
I think that most of us have been there at one time or another and it usually takes a little bit to get over the idea that we will get...
December 14, 2008 at 1:29 pm
Itzsam (12/12/2008)
" Msg 8152, Level 16, State 10, Procedure ddllogger, Line 7
String or binary data would be truncated.
The statement has been terminated....
December 14, 2008 at 12:32 pm
washingtonen (12/14/2008)
If condition = N then the data is retrieved in 5 seconds else it take about 5 minutes, and that's exactly what...
December 14, 2008 at 12:01 pm
Oops, I missed these replies before my answer above...
December 14, 2008 at 11:57 am
A table-valued function is used just like you would a table or a view:
Select * from dbo.fnDim_Concept()
You can use the function reference anywhere in a query that you would put...
December 14, 2008 at 11:56 am
Try it like this:
where (case when @Store ='Country' then [Country]
when @Store ='State' then [State]
when @Store ='City' then [City]
when @Store ='Region' then [Region]
when @Store ='Store Name' then...
December 13, 2008 at 10:23 pm
here is a start:
CREATE FUNCTION dbo.fnDim_Concept()
RETURNS
@tblVar TABLE
(col1 int,
col2 int)
AS
BEGIN
if (select failed from dimstatus) = 'N'
INSERT Into @tblVar select * from dim_region_mgr
else
...
December 13, 2008 at 9:50 pm
A table-valued function can be used just like a View. And yes, that includes being called from a View.
December 13, 2008 at 7:24 pm
Take the IsPrimary flag out of UserAddress and put a PrimaryAddressID column into the Users table.
December 13, 2008 at 7:21 pm
Ah, well in that case then timothy has the right solution. If that performs slowly, then that is a different problem.
You cannot use an IF statement in a view....
December 13, 2008 at 7:19 pm
How does the Flagsta table relate to the dim_concept table?
In other words how do you determine which row in dim_concept or vw_dim_concept to dispaly if a row in Flagsta based...
December 13, 2008 at 6:38 pm
Viewing 15 posts - 4,426 through 4,440 (of 7,636 total)