Viewing 15 posts - 76 through 90 (of 532 total)
This would give you the rest of the char string after the first colon that appears after the first semi-colon:
declare @init varchar(50) = 'abc:de;fgh:abcde';
select substring(@init, charindex(':', @init, charindex(';', @init)) +...
January 4, 2012 at 1:23 pm
Use brackets to group your "and" and "or" conditions correctly. Right now it's going to return everything with the end date greater than the date specified regardless of the...
December 29, 2011 at 3:01 pm
First of all, in the future, please include the DDL and insert statements ...
create table dbo.organizationtable(
oid int primary key,
orgname varchar(20) not null,
parentid int not null);
insert into dbo.organizationtable
values
(10, 'unit1', 0),
(11,...
December 27, 2011 at 12:22 pm
It's not an old post, it's from this morning. Rather than making excuses and being dishonest accept the correction and learn from it. People are trying to help...
December 27, 2011 at 12:15 pm
Only time I've used it has been in COLUMNS_UPDATED filters for triggers.
December 21, 2011 at 11:46 am
Forbidding views doesn't really help anything in my opinion. Simply taking tools out of the toolbox doesn't prevent anyone from mishandling the tools that are still available. Like...
December 19, 2011 at 5:13 pm
Not sure what exactly you're asking, but I think that's it is possible you have unrealistic expectations of what READ COMMITTED does for you. If that is the case,...
December 13, 2011 at 7:20 pm
Do a Google search on "dynamic sql pivot" and you will find lots of info. Just make sure if you use dynamic sql to use sp_executesql. You'll find...
December 5, 2011 at 2:14 pm
Ninja's_RGR'us (12/5/2011)
There are probably 1000 myths about @t vs #t.The article I linked to list all the pros & cons of each.
http://www.sqlservercentral.com/articles/Temporary+Tables/66720/
Good article, but I would highlight a point that...
December 5, 2011 at 11:37 am
It's actually safer not to use the separators anyway. '01-02-2011' does not inherently mean anything because it's not the ANSI standard way to express a date. Rather, it's...
December 5, 2011 at 11:22 am
So you would need to use dynamic SQL to build either a crosstab query or use the PIVOT operator. Take a crack at it.
December 5, 2011 at 11:08 am
One of the (many) problems in your execution plan provided is that the optimizer is expecting to get 707 records from FileSummaries but is instead getting 28,296. Because it's...
December 1, 2011 at 1:13 pm
Not sure that I understand exactly what you're doing, but don't forget you can pass variables both into and out of dynamic sql (the latter with output params.) You...
December 1, 2011 at 11:53 am
You can also do a crosstab which tend to work better as the queries get more complex ...
selectinReview = sum(case when name = 'in review' then 1 end)
,withApplicant = sum(case...
December 1, 2011 at 11:32 am
Itzik Ben-Gan has a good code example of a T-SQL basic (and limited) equivalent to what what the hierachyID datatype does behind the scenes (and without the coding overhead on...
November 30, 2011 at 6:36 pm
Viewing 15 posts - 76 through 90 (of 532 total)