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
Fareeda Hussain
NA
93
92.4k
Showing error Invalid object name 'INFORMATION_SCHEMA.COLUM'
Dec 21 2016 5:19 AM
When I try to execute the below procedure showing error 'INFORMATION_SCHEMA.COLUM'
create procedure data
(
@tablename varchar(50),
@userid int =''
)
AS
BEGIN
Declare @tsql varchar(50)
IF (@tablename = '')
SELECT * FROM tbl;
--ELSE
BEGIN
set @tsql = 'select Column_name
from INFORMATION_SCHEMA.COLUMNS
where Table_name like '+@tablename
exec(@tsql);
--set @tsql = 'select * from '+@tablename +' where userid ='+@userid
--exec(@tsql);
END
END
Reply
Answers (
1
)
sql server counts of columns
write trigger after insert to send mail to employeee