Viewing 15 posts - 61 through 75 (of 167 total)
This process was designed on a SQL 2000 system and ported to SQL 2005 with minimal changes. When I refactor it for SQL 2005 that would be the way to...
June 23, 2008 at 11:19 pm
I'm not a fan of dedup either, and didn't expect a harty round of approbation from this article...
I've found that you should ALWAYS consider your alternatives when it comes to...
June 23, 2008 at 9:33 am
Try something like this (adapted to your environment):
Declare @s-2 varchar(256),@v varbinary(256)
Select
@s-2='String with wierdness'+Char(127)+' in it...',
@v-2=cast(@s as varbinary)
Print @s-2
Print @v-2
Print patindex('%'+Char(127)+'%',cast(@v as varchar))
I've run into cases where the above PATINDEX may...
June 18, 2008 at 8:16 am
We sometimes create our own "full-Text" indexes instead of using SQL's Full-Text feature because we have non-standard requirements...
I'll create a Multi-Statement table-valued function that parses a string parameter into a...
June 16, 2008 at 9:15 am
This looks like an HTML or XML data conversion. Are you using either to post your queries to SQL?
May 28, 2008 at 8:19 am
The answer to this question is technically correct...
While Len(@c) is in fact 4000 the type and maximum len of @c is VarChar, 8000.
Try concatenating another 4000 VarChar characters to @c...
May 28, 2008 at 8:08 am
If the ratio of duplicate to unique phone numbers is "small" AND you have a unique row identifier on the table you might be better off doing something like this...
If...
April 18, 2008 at 3:07 pm
I use a function like this for general interval timing in TSQL...
If Object_Id('TimeSpan','fn') is not Null Drop Function TimeSpan
Go
Create Function TimeSpan
(
@StartDT DateTime,
@EndDT DateTime
)
Returns VarChar(16)
As Begin
Declare @s-2 VarChar(64),@s1...
April 17, 2008 at 9:25 am
...or you could use:
sp_OACreate 'Scripting.FileSystemObject'...
sp_OAMethod ...'Write or WriteLine'...
Create a sproc to open the output file then use a function to write lines to it...
March 28, 2008 at 9:22 am
I've seen code like this (.. is an indentation, this forum strips leading spaces?!?):
IF somecondition
..dosomething
where the program will come along later and add another command after the IF thinking...
February 26, 2008 at 8:46 am
The previous poster is correct about using RAISERROR as opposed to PRINT to eliminate output queing, however, RAISERROR has a feature that my cause you problems if you are not...
February 20, 2008 at 8:27 am
Case
When x in ('a','b','c') then 'yep'
Else 'nope'
End
February 19, 2008 at 8:40 am
In MSSQL Server Management Stdio with "Include Actual Execution Plan" turned on I ran this using a table with lots of rows and a WHERE clause with low specificity...
dbcc dropcleanbuffers;
set...
February 12, 2008 at 8:21 am
If you know all the potential course names you could play this game...
Use Tempdb
if object_id('dbo.#Course') is not Null Drop table dbo.#Course
Select 'John'[Student],'Math'[Course] into dbo.#Course
Union All Select 'Steve','Science'
Union All Select 'Don','Math'
Union...
February 8, 2008 at 8:53 am
No question, just ran across this issue while researching another topic, thougth I'd drop my 2 cents worth for the forum...
I'll use Scripts next time.
January 25, 2008 at 8:07 am
Viewing 15 posts - 61 through 75 (of 167 total)