tag:blogger.com,1999:blog-6082652835152798567.post672749289016278216..comments2024-03-28T00:58:12.736-07:00Comments on Sql server, .net and c# video tutorial: Derived table and CTE in sql server - Part 48Unknownnoreply@blogger.comBlogger10125tag:blogger.com,1999:blog-6082652835152798567.post-15922755297065506052020-12-21T23:04:35.244-08:002020-12-21T23:04:35.244-08:00you need to select all the statements together be...you need to select all the statements together before hitting execution otherwise you will see the error that you mentioned .So select everything like one single query you will get result thanks <br />vijayhttps://www.blogger.com/profile/15121955634662830956noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-73628977383434899412018-09-04T04:45:52.911-07:002018-09-04T04:45:52.911-07:00Just change the line:
Insert @Employeecount =>...Just change the line:<br /><br />Insert @Employeecount => Insert Into @EmployeecountAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-52847854364566600862017-12-27T03:19:38.727-08:002017-12-27T03:19:38.727-08:00@ Mathews: Need to use pivot function to convert c...@ Mathews: Need to use pivot function to convert column data row data for your requirement.Prasad Pandit .Net Developerhttps://www.blogger.com/profile/03120009636711429765noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-49996212155890910472017-02-13T22:39:01.142-08:002017-02-13T22:39:01.142-08:00Sir, how to implement a table with query to record...Sir, how to implement a table with query to record monthly fee collection of N student and display the paid & unpaid months of each student and corresponding fee informations<br /><br />o/p interface like<br />--------------<br /><br /><br />user_info<br />------------------------------<br />|user name|-----|fee info btn|<br />------------------------------<br /><br />when clicked on fee info btn shows below information<br />fee_info<br />--------------------------------<br />|JAN|FEB|.................|DEC|<br />-------------------------------<br />| y | n | ----------------| y |<br />-------------------------------<br />Anonymoushttps://www.blogger.com/profile/14056192713829980967noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-76299125968386980052016-11-02T05:23:36.537-07:002016-11-02T05:23:36.537-07:001.Temp table Can have constraints where CTE cannot...1.Temp table Can have constraints where CTE cannot, 2.TT Can be referenced by other queries or subprocedures where CTE cannot. 3. A temp table is a table created on disk so you can use it more than once while the CTE only use within specific the Query as its not in the memory. Anonymoushttps://www.blogger.com/profile/03847058444168519633noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-7941218799921416162016-01-20T22:16:18.642-08:002016-01-20T22:16:18.642-08:00Respected Venkat Sir,
I also want to know about th...Respected Venkat Sir,<br />I also want to know about this question,<br />They all seem to serve the same purpose, which is providing a temporary set of data, correct? Anonymoushttps://www.blogger.com/profile/09443814941773588072noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-69615982206099767932015-10-06T21:57:02.879-07:002015-10-06T21:57:02.879-07:00Hope you have got the answer by now! if not.
- Ta...Hope you have got the answer by now! if not.<br /><br />- Table name example ? it should be tblemployee<br /><br />- you have to select Declare statement & select statement both and hit execute.<br /> Anonymoushttps://www.blogger.com/profile/05817111496693232383noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-52071832199882465512015-07-28T15:55:06.575-07:002015-07-28T15:55:06.575-07:00Dear Venkat, Thanks for all the videos. I was prac...Dear Venkat, Thanks for all the videos. I was practicing with the Table variable example given by you. When I am running the example I am getting the error to declare the Table Variable. My Code is as below. Can you please let me know, what mistake I am making here.<br /><br />Declare @Employeecount Table<br />(DeptName varchar(15), Departmentid int, TotalEmployees int)<br />Insert @Employeecount<br /> Select Department.Dept_name, example.Dept_id, count (*) As TotalEmployees<br /> from example<br /> Join Department<br /> on example.Dept_id = Department.Dept_id<br /> Group By Department.Dept_name, example.Dept_id<br /><br />Select Deptname, TotalEmployees from @Employeecount<br />Where TotalEmployees>=2 <br /><br />Manjinderhttps://www.blogger.com/profile/12007203600638021095noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-41973595225367480612015-02-27T05:17:28.964-08:002015-02-27T05:17:28.964-08:00Yes Mr. Venkat You are trillionth one best online ...Yes Mr. Venkat You are trillionth one best online Anonymoushttps://www.blogger.com/profile/00420147464294007374noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-82580941058184631762013-12-11T10:07:29.395-08:002013-12-11T10:07:29.395-08:00Dear Venkat,
First of all, thank you so much for a...Dear Venkat,<br />First of all, thank you so much for all the tutorial videos. You are truly one of the best online. <br /><br />Can you tell me what scenarios I should consider using table variable, temp table, or CTE? They all seem to serve the same purpose, which is providing a temporary set of data, correct? What are the advantages and disadvantages of using each?Anonymousnoreply@blogger.com