Answer Posted / vijayalakshmi u
Create Table emp
(
dbID int NOT NULL IDENTITY (1,1) PRIMARY KEY,
customerNumber NVARCHAR(100) auto_increment,
Name Varchar(100)
)
Create function CustomerNumber (@id int)
returns varchar(10)
as
begin
DECLARE @ret varchar(10) ;
select @ret='gt' + right('0000' + convert(varchar(10), @id), 4)
RETURN @ret
end
create trigger emp_insert on emp
after insert as
update emp
set
emp.customerNumber = dbo.CustomerNumber(emp.dbID)
from
emp inner join
inserted on emp.dbID= inserted.dbID
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is reference section?
how you can deploy an ssrs report?
Which are the olap features?
What is difference between aggregate and analytic function?
Explain about analysis services?
what is raid? : Sql server database administration
Which trace flags are enabled in sql server?
What do you mean by cardinality?
Explain differentiate between a having clause and a where clause?
What is raid, and how it can influence database performance?
What are the 7 disadvantages to a manual system?
Name some of the open source software that you can use in alternative to SSR?
What does man by sql wildcard characters in sql server?
What are relationships and mention different types of relationships in the dbms
Where sql server usernames and passwords are stored in a sql server?