16,020,111 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
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 C++ questions
View Visual Basic questions
View Javascript questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
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
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
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
Search within:
Articles
Quick Answers
Messages
Comments by RTK The Limited Edition (Top 17 by date)
RTK The Limited Edition
21-Jul-15 11:03am
View
Is this possible without join keyword ??
RTK The Limited Edition
18-Jul-15 16:19pm
View
I don't see the answer here. Please give the SOLUTION (THE SP)at your earliest
RTK The Limited Edition
15-Jul-15 11:34am
View
I think I can't make understand you. can you give alternative of cursor??
RTK The Limited Edition
15-Jul-15 6:45am
View
Though that was an example the real problem is. I'll finally give a project to a client but he needs to create new table and I don't know how many columns he add but my project'll create its' respective audit table using SP. Now I ask you how should I get column one by one without using cursor. Please give the query for the above example as soon as possible.
RTK The Limited Edition
15-Jul-15 6:36am
View
Though it was an example now I'm saying you the real problem. When I'll give a project to a client and they need to create new table(s) but system'll create audit table with respect to every table but there I won't know how much columns they'll create.I need an iteration to know how much columns he would add. Now I'm asking you how should I know to get rows one by one without using cursor. Please give me the query for that above example as soon as possible.
RTK The Limited Edition
14-Jul-15 16:03pm
View
Please give me at least one solution without cursor. because i can't understand Mika's solution.
RTK The Limited Edition
12-Jul-15 13:14pm
View
Actually I want to show profile details according their name,class,roll,sec...
searching should made may be either individually use a particular field or more than one field. If you help for one field I'll do another. Please give an example for that above sample query. I don't like cursor. If you can please avoid it.
RTK The Limited Edition
12-Jul-15 9:20am
View
Then please give the solution query for this
RTK The Limited Edition
12-Jul-15 9:12am
View
Is it possible without use CURSOR ?
RTK The Limited Edition
4-May-15 15:41pm
View
If I use instead of trigger then after insert into statement it's never contain any data.
RTK The Limited Edition
4-May-15 13:34pm
View
I can't solve this problem. please help with example
RTK The Limited Edition
30-Apr-15 14:36pm
View
Just think client want this
RTK The Limited Edition
29-Apr-15 13:42pm
View
Thank you for the solution. Another problem is arise that is :
if I Add new column at employee table which contains default value like
create table employee(empid [varchar](10),empname [varchar](50),salary [decimal](18, 2),status [varchar] (100)(default ''))
create table employeeHistory(EffectDate [datetime],empid [varchar](10),empname [varchar](50),salary [decimal](18, 2),status [varchar] (100)(default ''))
create trigger UpdateEmployee on employee
after update AS
begin
declare @empid as [varchar](10)
declare @empname as [varchar](50)
declare @salary as [decimal](18, 2)
declare @status as [varchar](100)
select @empid =d.empid from deleted d
select @empname =d.empname from deleted d
select @salary =d.salary from deleted d
if update(status)
select @status=i.statusfrom deleted i
else
begin
select @status=i.status from deleted i
update [employee]
set status='' where empid=@empid
end
Insert into employeeHistory([EffectDate],[empid],[empname],[salary],[status])
SELECT getdate(), empid, empname, salary,status
FROM deleted
end
Example: emp001 xxxx 10000.00 paid
emp002 yyyy 12000.00 paid
emp003 zzzz 10000.00 paid
emp004 aaaa 15000.00 paid
emp005 bbbb 12000.00 paid
emp006 cccc 12000.00 paid
emp007 pppp 10000.00 paid
update employee set salary =11000.00 where salary =10000.00
after update first updated row set its default value but rest rows don't set it in employee table. Please give me a solution at your earliest.
RTK The Limited Edition
28-Apr-15 16:12pm
View
create table employee(empid [varchar](10),empname [varchar](50),salary [decimal](18, 2))
create table employeeHistory(EffectDate [datetime],empid [varchar](10),empname [varchar](50),salary [decimal](18, 2))
create trigger UpdateEmployee on employee
after update AS
begin
declare @empid as [varchar](10)
declare @empname as [varchar](50)
declare @salary as [decimal](18, 2)
select @empid =d.empid from deleted d
select @empname =d.empname from deleted d
select @salary =d.salary from deleted d
Insert into employeeHistory([EffectDate],[empid],[empname],[salary]) values
(getdate(),@empid, @empname,@salary)
end
Now I explain it, I have 2 table employee and employeeHistory as well as a trigger on update of employee table. The employeeHistory table contains the updated record (i.e. when we update employee table then updated data will store in employee table and the deleted data will store in employeeHistory table. If I update single row then it's returns currect output. when I update multiple row at a time then it's fired only one that is 1st row. Actually it's update employee table but trigger is not work properly. that is trigger fired only for 1st row.
update employee set salary =11000.00 where salary =10000.00
Example: emp001 xxxx 10000.00
emp002 yyyy 12000.00
emp003 zzzz 10000.00
emp004 aaaa 15000.00
emp005 bbbb 12000.00
emp006 cccc 12000.00
emp007 pppp 10000.00
Now suggest me what is the how to solve it.
RTK The Limited Edition
15-Apr-15 16:37pm
View
create table Student
(srNo int IDENTITY(1,1) not null,
RollNo int not null default as srNo-- This column will contains as default if user doesn't provide any. Here I need 'srNo' as default for 'RollNo' column.
StudentName varchar(50) not null)
RTK The Limited Edition
25-Mar-15 5:36am
View
Can you give a query(i.e. example) to build it
RTK The Limited Edition
2-Jan-15 10:26am
View
1. Print out should be either fit in page or center of page where page size=height=5.5 inch and width=9
2.or if I set the page at compile time as landscape the output should give in portrait mode.
Show More