sql-server-2000

Multiple Versions of SQL Server using Entity Framework in a single ASP.NET application

笑着哭i 提交于 2019-11-30 08:11:31
问题 I am using the Entity Framework in a web application that utilizes SQL server 2000, 2005, and 2008. When I create a new EDMX file using anything other than 2008 (version of the first edmx created) I receive error 0172: All SSDL artifacts must target the same provider. The Provider 'MyDatabase' is different from ' MyDatabase ' that was encountered earlier. It seems that somewhere in the code the connection is wired to a 2008 datastore and when it checks the SSDL file and sees a different

How to fix the embedded text qualifier issue while exporting data to CSV flat file?

纵饮孤独 提交于 2019-11-30 06:24:48
问题 RFC 4180: RFC 4180 defines Common Format and MIME Type for Comma-Separated Values (CSV) Files . One of the requirements of the RFC 4180 is stated as below. This is the point #7 in the RFC link. If double-quotes are used to enclose fields, then a double-quote appearing inside a field must be escaped by preceding it with another double quote. For example: "aaa","b""bb","ccc" SQL Server 2000: DTS Export/Import Wizard in SQL Server 2000 seems to conform to the above mentioned standards even

What exactly does the T-SQL “LineNo” reserved word do?

十年热恋 提交于 2019-11-30 05:42:10
I was writing a query against a table today on a SQL Server 2000 box, and while writing the query in Query Analyzer, to my surprise I noticed the word LineNo was converted to blue text. It appears to be a reserved word according to MSDN documentation, but I can find no information on it, just speculation that it might be a legacy reserved word that doesn't do anything. I have no problem escaping the field name, but I'm curious -- does anyone know what "LineNo" in T-SQL is actually used for? OK, this is completely undocumented, and I had to figure it out via trial and error, but it sets the

t-sql replace on text field

不想你离开。 提交于 2019-11-30 04:24:46
I have hit a classic problem of needing to do a string replace on a text field in an sql 2000 database. This could either be an update over a whole column or a single field I'm not fussy. I have found a few examples of how to use updatetext to achieve it but they tend to be in stored procedures, does anyone know of a similar thing that is wrapped into a function so I can use it like I would usually use Replace(). The problem with the Replace() function for anyone who isn't aware is that it doesn't support text fields. Edit: I realised I could probably get away with varchar(8000) so have

Entity Framework 6 supports SQL Server 2000?

血红的双手。 提交于 2019-11-30 03:15:12
问题 Anybody knows if SQL Server 2000 is supported in EF 6 for Code First? In the official websites I haven't found anything about which SQL Server versions are supported in EF 6. In some blogs I've found that SQL Server 2000 is not supported, but these blogs aren't from official sources. Looking at the source code of EF 6 it seems that is supported I've found some code with SQL Server 2000 considerations. For example: SqlVersion is a class with an enum of SQL Server versions, SQL Server 2000 is

How can I find sql server port number from windows registry?

独自空忆成欢 提交于 2019-11-30 03:09:25
问题 How can I find sql server port number from windows? Is there any generic way to find port number for sql server 2000, 2005 and 2008? 回答1: SQL Server 2000 Default instance HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\MSSQLServer\SuperSocketNetLib\TCP Named instance HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\(InstanceName)\MSSQLServer\SuperSocketNetLib\TCP SQL Server 2005 There is no distinction between default and named instances. An instance is assigned a number based on

What is this operand (*= star-equals) in SQL server 2000?

Deadly 提交于 2019-11-30 01:07:31
问题 I have a query that I pulled from ms sql 2000 and plugged into a MySql query. It did not work, MySql would choke on the *= operator. In this example I have two varchar columns called person_name. SELECT * FROM tbl1 a, tbl2 b WHERE a.id = b.id AND a.person_name *= b.person_name I know in other languages myInt *= myTotal could also be read as myInt * myInt = myTotal. However, I'm working with varchars that contain all chars, no integers. I wrote it out like: AND a.person_name * a.person_name =

Select column, if blank select from another

谁说我不能喝 提交于 2019-11-29 23:50:01
How does one detect whether a field is blank (not null) and then select another field if it is? What I really need is a IsBlank function that works the same as IsNull but with with blanks. REPLACE doesn't work with blanks, COALESCE only works with NULLS. How about combining COALESCE and NULLIF. SELECT COALESCE(NULLIF(SomeColumn,''), ReplacementColumn) FROM SomeTable You can use a CASE statement for this select Case WHEN Column1 = '' OR Column1 IS NULL OR LEN (TRIM (Column1)) = 0 THEN Column2 ELSE Column1 END as ColumnName from TableName EDIT: You can't use IF() in mssql. Use an IF statement in

SQL Server 2000 - Query a Table’s Foreign Key relationships

坚强是说给别人听的谎言 提交于 2019-11-29 22:31:08
问题 Nearly identical to Query a Table's Foreign Key relationships, but for SQL Server 2000 For a given table 'foo', I need a query to generate a set of tables that have foreign keys that point to foo. 回答1: SELECT o2.name FROM sysobjects o INNER JOIN sysforeignkeys fk on o.id = fk.rkeyid INNER JOIN sysobjects o2 on fk.fkeyid = o2.id WHERE o.name = 'foo' 回答2: Try this T-SQL: select col_name(fkeyid, fkey) as column_name, object_name(rkeyid) as referenced_table_name, col_name(rkeyid, rkey) as

Execute stored procedure from a Trigger after a time delay

ⅰ亾dé卋堺 提交于 2019-11-29 20:18:05
问题 I want to call stored procedure from a trigger, how to execute that stored procedure after x minutes? I'm looking for something other than WAITFOR DELAY thanks 回答1: Have an SQL Agent job that runs regularly and pulls stored procedure parameters from a table - the rows should indicate also when their run of the stored procedure should occur, so the SQL Agent job will only pick rows that are due/slightly overdue. It should delete the rows or mark them after calling the stored procedure. Then,