TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
baskaran chellasamy
NA
114
151.1k
what is the query for updating null value with datetime value
Aug 24 2012 2:38 PM
Hi friends
I have a table which contain 5 columns .first three column insert with value and 4 and 5 were set to null.
This is my stored procedure
alter procedure sp_excelforgeneralholidays(@filname nvarchar(max),@getdate datetime,@adminid int)
as
declare @datavar nvarchar(max)
declare @sql varchar(1000)
--set @getdate=coalesce(@getdate,Getdate())
set @datavar = 'Excel 8.0;Database=' + @filname
set nocount on
begin
--create table #temptable (Date date ,Day varchar(30),Reason varchar(100))
set @sql ='insert into General_holydays_details(Date,Day,Reason) SELECT * FROM OPENROWSET(''Microsoft.jet.OLEDB.4.0'','''+@datavar+';HDR=YES'',''SELECT Date,Day,Reason FROM [Sheet1$]'')'
exec (@sql)
update General_holydays_details set createddatetime= @getdate where createddatetime=null
update General_holydays_details set adminid=@adminid where adminid=null
end
but when i executing this stored procedure, only excel file is updated and createddatetime and adminid remain null value.
but i pass createddatetime value and adminid to this stored procedure from my coding.
What is the problem please find out and help me
Reply
Answers (
1
)
After Trigger in SQL Server 2012
how can i create working days