Using SQl Server 2000 I have a stored procedure that joins 2 tables and then returns the data. I want this sp to be able to do this for whatever table name I pass into it, otherwise I\'ll have the exa
This pseudocode (inaccurate SQL) shows what I want to do. upd开发者_如何学运维ate tableA (colA, colB, colC, colD)
Will queries internal having one or more subquery result in cursors at SQL Server level. In otherwords I am not explicitly using cursors but i have query with a sub query. Now for processing this que
I have a query that looks like this: Insert Into tblX (a,b,c) Select x as a, y as b (select top 1 whatever from tblZ as z where z.aID= y.aID order by z.s desc) as c
Please forgive me if this has been answered before. I\'m looking for some advice on how to build a pivot or cross tab query.
There are 2 tables: report (which has a primary key of reportId and a bit field called migrated) and report_detail (which has a foreign key of reportId). I want to delete all the rows from report_deta
I have a set of students at a high school.The counselors want to divide the students up by last name.Here is the break down:
Table A has column X, which is an int made up of the concatenation of columns Y and Z (which are both floats) in table B. I want to join tables A and B in a manner similar to this开发者_开发知识库:
How do I fix 开发者_JAVA技巧up this part of my stored procedure? The select will either return 1, 0, or null. If the select returns 1 or 0, I want @override to be set to that value. If it returns nul
Only for MSSQL 2000-2005 by SQL query and no stored procedures No cursors and temp tables The table create table my_table