sql-server-2000

Update big table (a lot of columns). C# .NET

℡╲_俬逩灬. 提交于 2019-12-22 05:05:46
问题 I have to update a big table with over 270 update fields. I am relative new to .NET and need advise what is better to use in this case: SqlCommand, some kind of memory-mapped table or DataSet or maybe it exists some kind of auto-generated objects using meta-data from DB? Please help. Reason: I have an old big Delphi7 application, a part of which is responsible for listening on socket some packets which are marshaled to big structures and, in final step, stored in DB. Now I am porting this

SQL query to return one single record for each unique value in a column

冷暖自知 提交于 2019-12-22 04:19:18
问题 I have a table in SQL Server 2000 that I am trying to query in a specific way. The best way to show this is with example data. Behold, [Addresses] : Name Street City State -------------------------------------------------------- Bob 123 Fake Street Peoria IL Bob 234 Other Street Fargo ND Jim 345 Main Street St Louis MO This is actually a simplified example of the structure of the actual table. The structure of the table is completely beyond my control. I need a query that will return a single

Why does the order of join clauses affect the query plan in SQL Server?

最后都变了- 提交于 2019-12-22 03:15:48
问题 I am building a view in SQL Server 2000 (and 2005) and I've noticed that the order of the join statements greatly affects the execution plan and speed of the query. select sr.WTSASessionRangeID, -- bunch of other columns from WTSAVW_UserSessionRange us inner join WTSA_SessionRange sr on sr.WTSASessionRangeID = us.WTSASessionRangeID left outer join WTSA_SessionRangeTutor srt on srt.WTSASessionRangeID = sr.WTSASessionRangeID left outer join WTSA_SessionRangeClass src on src.WTSASessionRangeID =

What happened with SQL English query?

喜夏-厌秋 提交于 2019-12-22 01:44:42
问题 SQL Server 2000 was deployed with English Query. At that time, I was young and new to SQL so I skipped that chapter. Now after years, there is again an idea of making a logical program which can understand simple user questions. Is there any alternative to that? Where is English Query now? 回答1: Though it's not the same thing, Full Text Search is the closest thing to "English Query" that exists in SQL 2005+. 回答2: English Query was discontinued after SQL Server 2000. 回答3: English query not part

Have you ever encountered a query that SQL Server could not execute because it referenced too many tables?

▼魔方 西西 提交于 2019-12-22 01:27:37
问题 Have you ever seen any of there error messages? -- SQL Server 2000 Could not allocate ancillary table for view or function resolution. The maximum number of tables in a query (256) was exceeded. -- SQL Server 2005 Too many table names in the query. The maximum allowable is 256. If yes, what have you done? Given up? Convinced the customer to simplify their demands? Denormalized the database? @(everyone wanting me to post the query): I'm not sure if I can paste 70 kilobytes of code in the

SQL Server 2000/2005 identity column + replication

感情迁移 提交于 2019-12-22 01:18:04
问题 I have looked at some resources already and just want to clarify and get an opinion. First of all to totally avoid any problems we could just not bother using identity columns as primary keys instead have them generated ourselves and just have those values replicated both ways presuming they are always unique at any time of creation. For the purposes of this question I am talking about 2 or more way replication to solve global access issues and we do have identity columns. Now we are setting

Getting age in years in a SQL query

佐手、 提交于 2019-12-21 23:08:09
问题 Hello I've been tasked with doing a few queries on a large SQL Server 2000 database. The query I'm having trouble with is "find the number of people between ages 20 and 40" How would I do this? My previous query to get a count of everyone looks like this: select count(rid) from people where ... (with the ... being irrelevant conditions). I've googled some but the only thing I've found for calculating age is so large that I don't see how to embed it into a query, or it is a stored procedure

Getting age in years in a SQL query

筅森魡賤 提交于 2019-12-21 22:57:32
问题 Hello I've been tasked with doing a few queries on a large SQL Server 2000 database. The query I'm having trouble with is "find the number of people between ages 20 and 40" How would I do this? My previous query to get a count of everyone looks like this: select count(rid) from people where ... (with the ... being irrelevant conditions). I've googled some but the only thing I've found for calculating age is so large that I don't see how to embed it into a query, or it is a stored procedure

How to duplicate a SQL Server 2000 table programatically using .NET 2.0?

可紊 提交于 2019-12-21 22:13:59
问题 I want to backup a table saving the copy in the same database with another name. I want to do it programatically using .NET 2.0 (preferably C#). Someone can point me what should I do? 回答1: Just send this query to the server: SELECT * INTO [BackupTable] FROM [OriginalTable] This will create the backup table from scratch (an error will be thrown if it already exists). For large tables be prepared for it to take a while. This should mimic datatypes, collation, and NULLness (NULL or NOT NULL),

SQL 2000: T-SQL to get foreign key relationships for a table

孤街浪徒 提交于 2019-12-21 05:41:10
问题 Similar but NOT IDENTICAL to SQL Server 2000 - Query a Table’s Foreign Key relationships I need a T-SQL statement that will work SQL 2000 that given a table name, will return the foreign key relationships for that table e.g. Table MyFristTable has a foreign key to MySecondTable, where MyFirstTable.ColA must be in MySecondTable.ColB. I'd be delighted, if the sql statement (or stored proc) is ran for MyFirstTable and returned a result set on the lines of Column | FK_Table | FK_COLUMN ----------