Viewing 15 posts - 1,696 through 1,710 (of 2,458 total)
I think this should do the trick:
WITH t1 AS
(
SELECT * FROM #Test1
CROSS APPLY (VALUES ('Actual'),('Budget')) ab(RecType)
)
SELECT
RecType,
recID, MyDate,
CASE...
March 20, 2015 at 10:26 am
1. The TIME datatype does not exist in 2005 (it was introduced it 2008)
2. Your query appears to have been cut off.
March 20, 2015 at 10:06 am
It's also worth noting that sometimes a cursor performs much better than a loop (e.g. the WHILE logic that you are using).
That said, and has already been mentioned, you...
March 20, 2015 at 10:02 am
DECLARE @i tinyint = 1;
WHILE @i <= 5
BEGIN
If exists (select fieldID from #tmploginfo where status <> 0
group by fieldID
having count(*) > 0)
begin
backup log rdb to disk = N'C:\rdb1.trn'
End;
SET...
March 20, 2015 at 9:58 am
mattech06 (3/19/2015)
I seem to have an odd situation.
I have a view that when created holds about 40k of rows.
when I use
SELECT DISTINCT RefTypeWord FROM vw_Referrals where ClientRef = 'EPS' or...
March 20, 2015 at 9:29 am
twin.devil (3/20/2015)
March 20, 2015 at 9:03 am
Sorry, I completely misunderstood your requirement. I will look at this again later today.
March 20, 2015 at 8:47 am
You're returning a Table Valued Function so you need to return a IEnumerable (Note: CLR Table-Valued Functions)
I have not written a CLR in a while but I think that
public...
March 20, 2015 at 8:46 am
If by "remove log files" you want to delete the records in tempsysdatabase where the names are: rdb_log3 and rdb_log4
This should work:
DELETE FROM #tempsysdatabase
WHERE name IN
(
select #tempsysdatabase.name, count (#temploginfo.FieldId) as...
March 19, 2015 at 4:45 pm
jbalbo (3/19/2015)
Thanks for getting back so quick.
I get most if it, just a bit confused on the dataset part.
Here is the dataset I am using, if you could incorporate...
March 19, 2015 at 3:21 pm
I don't believe that you can disable/enable a parameter (I could be wrong but I am pretty sure that you can't).
One thing you can do is this:
You have a parameter...
March 19, 2015 at 1:55 pm
These problems are fun. If the data format is always the same (##/##/####) you could also do this:
DECLARE @TestString VARCHAR(50)
SET @TestString = 'LastName, FirstName (DOB: 01/01/1900)'
SELECT SUBSTRING(@TestString, PATINDEX('%[0-1][1-9]/%', @TestString),10);
March 19, 2015 at 1:18 pm
Had a second to kill. I put together a test to demonstrate why multi statement TVFs (mTVF) are terrible
Using TempDB (a DB I know you have) this code will create...
March 18, 2015 at 9:54 pm
Great article. There is a good article about this at on SQLMag.com. This is huge news indeed and is all the rage where I work.
March 18, 2015 at 8:39 pm
PSB (3/18/2015)
I have a report where there are fields like Field1,Field2,Field3,Field4 etc . In the report query there is a field named IsParentAccount . If it is 0 then I...
March 18, 2015 at 2:56 pm
Viewing 15 posts - 1,696 through 1,710 (of 2,458 total)