Viewing 15 posts - 826 through 840 (of 901 total)
Cursors in MS T-SQL should be avoided unless absolutely necessary as they are extremely slow and inefficent.
Using one of the methods mentioned in previous posts is a better and more...
March 21, 2011 at 3:07 am
If you're using SQL 2008 then its simple
Select CONVERT(DATETIME,CONVERT(DATE,GETDATE()),112)
This will automatically strip off the Time part of the date.
PS : The 112 is option, and an old habit of mine.
March 18, 2011 at 9:57 am
Jeff
A unique contraint would elimate the chance that there are 2 or more records with the same EmpId.
However it could also be a circular reference in the Employee,Supervisor chain,...
March 11, 2011 at 7:58 am
Look at using the Binary_checksum() function in SQL for all columns but the Business Key and meta data columns.
So
Update
Destination
Set
Col1 = Source.Col1
:::::
From
...
March 10, 2011 at 3:03 am
Look at using the Binary_checksum() function in SQL for all columns but the Business Key and meta data columns.
So
Update
Destination
Set
Col1 = Source.Col1
:::::
From
DestTable...
March 10, 2011 at 2:59 am
Nice Article Jeff, and having spent a lot of time recently working with them its good to see alternative solutions.
One common problem is people come across is when they...
March 10, 2011 at 1:50 am
To use the anology of the car from a previous post, would you expect to go onto the internet and expect someone t be able to teach you how to...
March 8, 2011 at 3:57 am
aravind-305595 (3/8/2011)
Do we have an option incase if we are not scheduling them in SQL job ? I mean if...
March 8, 2011 at 1:52 am
Can I check that you have SSMS R2 installed on your local machine (version 10.50.1600.1 or greater), though I dont know why that would stop you connecting via Excel 2010,...
March 7, 2011 at 9:39 am
Glad to help, I did find the problem interesting hence the quick response. 🙂
March 7, 2011 at 9:28 am
For SQL Server 2005 you need to do a little more work,
SET @stmt = N'DECLARE @AllocPages int;
SELECT @AllocPages=sum(total_pages) FROM '
+ QUOTENAME(@dbname) + '.sys.allocation_units;
INSERT #AllocTable (Database_id,Database_Name,AllocPages)
values...
March 7, 2011 at 7:45 am
The problem isnt in the CTE its in the Dynamic SQL thats within the cursor, where you have SUB Select in the Insert statement.
March 7, 2011 at 7:21 am
Is there a reason that you haven't migrated the cubes to SSAS 2008 as that would be a better solution.
I'm not sure that the .Net supports calls to the older...
March 7, 2011 at 7:14 am
I cant see anything wrong, the only issue may be the DB_NAME function, out of curisoity have you tried substituting it with the at.Database_Name reference from the Temp Table?
March 7, 2011 at 5:51 am
Personally I only resort to table variables during proof's and avoid them in production code, thanks to a previous boss who was a bit of a zealot on the matter....
March 7, 2011 at 2:29 am
Viewing 15 posts - 826 through 840 (of 901 total)