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
You schedule a job to run every minute what will happen if the first job runs more than 1 min? Will the second instance of the job start?
explain what is raid and what are different types of raid configurations? : Sql server database administration
What is the use of toad or sqldbx.?
What are exact numeric data types in ms sql server?
Where do you find the default Index fill factor and how to change it?
What is bulkcopy in sql?
my name is sejal I have cleared the sbi clerk exam. I am BCA graduate My favorite subject RDBMS Relational database management system. so please send me rRDBMS related interview questions
Explain an automatic checkpoint
What is the difference between mysql and mysqli?
What is data source in connection string?
Mention the uses of stored procedures.
What are “phantom rows”?
What does dml stand for?
What is SQL Azure?
How do I create a stored procedure in dbml?