Viewing 15 posts - 1 through 15 (of 38 total)
BTW, I checked and the code does work.
While I agree that a csv and delimitedSpilt8K are OK for this simple case, I often deal with more complex structures that are...
November 14, 2013 at 9:03 am
If OBJECT_ID('TEST_procedure','P') is not Null Drop procedure TEST_procedure
Go
create procedure TEST_procedure
@exampleid XML
as
update tablea
set text_field = 'Y'
where
example_id in (Select x.value('(.)','varchar(100)') from @exampleid.nodes('/List/Field/text()') as x(x))
Go
If object_id('tablea') is Not Null Drop Table tablea
Create...
November 14, 2013 at 6:21 am
Try this
DECLARE @PDFFileName VARCHAR(8000) =
(
SELECT STUFF(( SELECT ', ' + PDF_FileName + '.pdf' + char(13) + char(10)
FROM @PDFResult
...
October 8, 2013 at 7:01 am
Declare @NextDOW Int,@Date SmalldateTime
Set @NextDOW=2
Set @Date='20111205'
Select dateadd(dd,-datediff(dd,6+@NextDOW,@Date)%7+7,@Date)
December 10, 2011 at 8:23 am
Try wingdings font character 0xA1
November 29, 2011 at 8:37 pm
This will require SQL 2005
/*
Reference:
Tally OH! An Improved SQL 8K “CSV Splitter” Function
By Jeff Moden, 2011/05/02
http://www.sqlservercentral.com/articles/Tally+Table/72993/
*/
If Object_id('Tempdb..#Temp') is Null Create Table #Temp(LineText varchar(1024))
Bulk Insert #Temp from...
October 25, 2011 at 6:12 am
Using an in-line Table Function to split the time.
Go
If object_id('SplitTimeCrossingMidnight') is not null Drop Function SplitTimeCrossingMidnight
Go
Create Function SplitTimeCrossingMidnight(
@StartDateTime SmalldateTime,
@EndDateTime SmalldateTime
)
Returns Table
As
Return(
With DT as
(select
...
January 9, 2011 at 9:17 am
SELECT
b.NumericalRanking,
(select my alpharanking From rankings where NumericalRanking =b.NumericalRanking )
AS AlphaRanking
FROM MYTables a
Cross Apply(Select NumericalRanking =(really complicated code with Case statements) )b
Test with Set Statistics Profile on and confirmed that that...
December 12, 2010 at 11:02 am
Try providing the result from the function as a Cross Apply
Cross Apply(Select Result=dbo.Function(Parameter1,etc)) b
At least the code is cleaner.
December 12, 2010 at 6:02 am
See attached spreadsheet with Examples
November 22, 2010 at 7:25 am
Sorting by Month in SSRS, I use the following
CDate(Parameters!MonthName.Value + " 01, 1900").Month
November 22, 2010 at 5:41 am
The Format function is locale aware and can be used as follows [not the case senstivity]
Set Language=User!language in the Report properties and use the Format function with the following codes:
Standard...
November 21, 2010 at 7:53 am
Have you tried OPENROWSET?
SELECT a.*
FROM OPENROWSET('MSDASQL',
'DRIVER={SQL Server};SERVER=servername;UID=userid;PWD=passsword',
databasename.dbo.tablename) AS a
This performs well and is convenient
May 27, 2010 at 6:51 am
Excellent article.
I have a huge volume of historical data [3 years of data at 15 minute intervals] and will try out the method this weekend
Thanks
March 4, 2010 at 5:15 am
Viewing 15 posts - 1 through 15 (of 38 total)
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy