sql-server-2000

Sql Server Index on Bit fields

只愿长相守 提交于 2019-12-11 07:38:40
问题 I am using Sql Server 2000 and want to know why we can not create index on bit fields? 回答1: Just a limitation of the product. SQL Server 2005+ does allow this. Because of the Tipping Point a single column bit index is unlikely to be very useful unless the values are heavily skewed (a scenario for which filtered indexes in 2008 can help) Still - could be useful as part of a composite covering index though. 回答2: I would guess this is by design. A bit field can only have 1 of 2 values, so it

Corrupted Files Microsoft Office 2007 ASP.NET 1.1 and SQL Server

微笑、不失礼 提交于 2019-12-11 06:22:34
问题 I am working on an ASP.NET 1.1 website that stores files in the database. The website has been working great with no problems uploading and downloading any type of documents since 2001. However, recently the customer noticed that all Microsoft Office 2007 documents DOCX , XLSX , ect are corrupted when any user try to download them. What I have noticed is that SQL Server adds an extra byte to the DocumentContent (image column). Before uploading the document the content and length are fine.

Automated SMTP (not MAPI) emails using SQL Server Job Scheduler

痞子三分冷 提交于 2019-12-11 06:04:01
问题 Work on SQL Server 2000.i want to send birthday wishes to all customers whose birthday matches the current day.I have created a database Customers with a table called CustomerDetails with the following fields ID Name BirthDate Email I have written the SQL script shown below. The SQL script loops through the CustomerDetails table and matches all records birth day and birth month with the current day and month. If the two matches then it sends an email to the particular customer to its email

SQL 2000 and SQL 2008 Express side by side?

自闭症网瘾萝莉.ら 提交于 2019-12-11 04:28:40
问题 This question has been asked in regards to 2005, but did not see anything with 2000. We have a new application that needs to run on 2005 or better but everything else we have is geared towards 2000. We could upgrade, but that is not within budget at this time. We were thinking we could run SQL Server 2008 Express on the same server as 2000 for the period of time it takes before we upgrade. Anyone do this? Have any issue? Ok to proceed? Thanks in advance 回答1: On our development server we have

Syntax error on SQL Server

这一生的挚爱 提交于 2019-12-11 04:13:19
问题 this could be a stupid syntax error but I just keep reading my procedure but i cannot figure out where are my errors. Msg 156, Level 15, State 1, Line 41 Incorrect syntax near the keyword 'FOR'. Here is my code : alter procedure LockReservation as DECLARE @edition_id tinyint, @stockid tinyint; DECLARE @creservation CURSOR FOR select edition_id from reservation where (date_fin - GETUTCDATE()) <= 12; open creservation; while @@fetch_status = 0 BEGIN fetch creservation into @edition_id; DECLARE

PHP and SQL Server 2000 - odbc_connect not working and NO ERROR MESSAGE

孤街浪徒 提交于 2019-12-11 03:42:52
问题 I tried re-run the earlier working code to connect SQL Server 2000 from PHP. I used the following code to connect: $connection = odbc_connect($databaseURL, $databaseUName, $databasePWord); if (!$connection) { echo 'dyeing'; die('Something went wrong while connecting to database ' + $databaseName); } else { echo "connection successful"; } But no code, after $connection = odbc_connect($databaseURL, $databaseUName, $databasePWord); is working. Not even echo statements. What will be wrong in the

Creating multiple columns from one column

无人久伴 提交于 2019-12-11 03:32:46
问题 My database is structured like this: Number | Month | Country ------------------------ 63 | June | Ireland 48 | June | England 55 | June | Spain 66 | May | Ireland 33 | May | England 53 | May | Spain 44 | April | Ireland 44 | April | England 44 | April | Spain I want to use an SQL statement to call this from the data above. Can anyone help me out please. Basically I want to split the number column into multiple other columns according to the month associated with it. I'm using sql-server 2000

Login Failed for linked server

时光怂恿深爱的人放手 提交于 2019-12-11 03:28:27
问题 How to create a linked server...? 1st Server name is ABC.DATABASE1 2nd server name is EFG.DATABASE2 EFG database username is sa password is sa I want to retrive the data's from 2nd server thourgh 1st server In the 1st server, i exectue the store procedure like this.... exec sp_linkedserver 'EFG' Executed successfully, When i tried to retrive the data, it is showing error as " login failed for user sa, Reason: Not associated with trusted sql server connection " How to solve this problem...

How to avoid OutOfMemoryException while loading large chunks of data from a database?

假如想象 提交于 2019-12-11 02:43:41
问题 Say, we have a table with some large text field containg jpg-files' binary data. The task is to get those files from a database on disk. So, at first I decided to do the following: MyDataContext dc = new MyDataContext(); foreach(ImageTable t in dc.ImageTable.OrderBy(i=>i.Id)) { using (StreamWriter writer = new StreamWriter(new FileStream(string.Concat(t.Name,".jpg"), FileMode.CreateNew), Encoding.GetEncoding(1251))) { writer.Write(t.Data); writer.Close(); } } But as soon as the table had

SQL Server, Can a T-SQL operator be used like a variable ? Or something like that

社会主义新天地 提交于 2019-12-11 02:34:15
问题 What I want to do is something like this DECLARE @operator nvarchar; SET @operator = 'AND' SELECT * FROM MyTable WHERE first_column = "1" @operator second_columnt = "2" is there a way to implement a logic like that one ? 回答1: You can do that using dynamic sql: declare @query varchar(max) set @query = 'select * from MyTable where first_column = ''1'' ' + @operator + ' second_column = ''2''' exec (@query) Sometimes, where statement logic is sufficient, like: select * from MyTable where