14,739,502 members
Sign in
Email
Password
Forgot your password?
Sign in with
Search within:
Articles
Quick Answers
Messages
home
articles
Chapters and Sections
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View VB.NET questions
View C++ questions
View SQL questions
View Javascript questions
discussions
forums
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
ASP.NET
JavaScript
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
.NET (Core and Framework)
Android
iOS
Mobile
Silverlight / WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
stuff
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
Product Showcase
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Articles by Elina Blank (Tip/Tricks: 6)
Tip/Tricks: 6
Articles
Technical Blogs
Tips and Tricks
Reference Articles
Projects
No articles have been posted.
No blogs have been submitted.
Average tips rating: 4.75
Database
General
Get Column values as comma seperated string [Tip/Trick]
Posted: 13 Apr 2012 Updated:
13 Apr 2012
Views: 15,551 Rating: 5.00/5 Votes: 4 Popularity: 3.01
Licence: The Code Project Open License (CPOL)
Bookmarked: 7
Downloaded: 0
Please
Sign up or sign in
to vote.
Another option:declare @commaStringList varchar(max)set @commaStringList = ''select @commaStringList = @commaStringList + ', ' + CAST(ColumnName as VARCHAR) from MyTable -- remove leading commentif len(@commaStringList) > 3 set @commaStringList =...
Programming Tips
General
Query for running total in SQL Server [Tip/Trick]
Posted: 24 Aug 2011 Updated:
24 Aug 2011
Views: 10,030 Rating: 4.00/5 Votes: 1 Popularity: 0.00
Licence: The Code Project Open License (CPOL)
Bookmarked: 1
Downloaded: 0
Please
Sign up or sign in
to vote.
Using window functions (partition by) will speed up the process:SELECT Val, SUM(Val) OVER (Partition BY [YourPartitionValue] Order BY [OrderColumn] as CumulativeSumFROM [Table]
Always close your cursor [Tip/Trick]
Posted: 13 Oct 2011 Updated:
13 Oct 2011
Views: 31,290 Rating: 4.50/5 Votes: 2 Popularity: 1.35
Licence: The Code Project Open License (CPOL)
Bookmarked: 2
Downloaded: 0
Please
Sign up or sign in
to vote.
When cursors are inside transaction, it is sometimes easy to forget to close the cursor
Always close your cursor [Tip/Trick]
Posted: 13 Oct 2011 Updated:
13 Oct 2011
Views: 4,390 Rating: 5.00/5 Votes: 1 Popularity: 0.00
Licence: The Code Project Open License (CPOL)
Bookmarked: 1
Downloaded: 0
Please
Sign up or sign in
to vote.
An alternative (simpler way :) ) is:BEGIN TRANDECLARE IdCursor CURSOR FOR SELECT Id FROM MyTable OPEN IdCursor FETCH NEXT FROM IdCursor INTO @CurrentIdWHILE (@@FETCH_STATUS) = 0 BEGIN -- do work IF @@error 0...
Always close your cursor [Tip/Trick]
Posted: 18 Oct 2011 Updated:
18 Oct 2011
Views: 8,920 Rating: 5.00/5 Votes: 3 Popularity: 2.39
Licence: The Code Project Open License (CPOL)
Bookmarked: 1
Downloaded: 0
Please
Sign up or sign in
to vote.
To see the default value of the cursor scope:select * from sys.databases(if value of "is_local_cursor_default" is 0 then scope id global, otherwise it is local).The scope is GLOBAL by default (for compatibility reasons).To change default scope use following:ALTER DATABASE...
How to do a "LastIndexOf" in sql [Tip/Trick]
Posted: 31 Jan 2012 Updated:
31 Jan 2012
Views: 35,951 Rating: 5.00/5 Votes: 2 Popularity: 1.51
Licence: The Code Project Open License (CPOL)
Bookmarked: 1
Downloaded: 0
Please
Sign up or sign in
to vote.
sometimes we need last occurance of the character in the string
No reference articles have been posted.
No projects have been posted.
Elina Blank
Software Developer (Senior)
The Code Project
United States
Elina joined the Code Project team as a software developer in order to make the site run even smoother than it is now. She will also take care of making wishes and promises on the site improvements come to the light sooner than later. When not at work, she enjoys being with her family and wishes there will be at least 30 hours in a day