sql-server-2000

Convert Legacy SQL Outer JOIN *=, =* to ANSI

十年热恋 提交于 2019-12-13 03:49:16
问题 I need to convert a legacy SQL outer Join to ANSI. The reason for that being, we're upgrading from a legacy DB instance (2000/5 ?) to SQL 2016. Legacy SQL query :- SELECT --My Data to Select-- FROM counterparty_alias ca1, counterparty_alias ca2, counterparty cp, party p WHERE cp.code *= ca1.counterparty_code AND ca1.alias = 'Party1' AND cp.code *= ca2.counterparty_code AND ca2.alias = 'Party2' AND cp.code *= p.child_code AND cp.category in ('CAT1','CAT2') Here, Party1 and Party2 Are the party

Sql collation issues when deploying live

霸气de小男生 提交于 2019-12-13 03:10:26
问题 History: I had a deployment the other night which involved executing a script that creates a stored procedure. However when running the script, an error occurred about the collation of the DB. The Problem: With the help of our friend Google, I managed to find out that the problem I was having was because on our live environment's db has one collation and the temporary DB's collation is different, and I was getting an error when trying to insert into a variable table. The Question: What is the

how to convert all datetime columns in a sql server 2005 express database with data to UTC

孤街醉人 提交于 2019-12-13 01:52:28
问题 background: We recently upgraded to handle UTC. ie., went thru each sp and func and changed the t-sql code to handle utc. For eg., changed getdate() to getutcdate() etc. For new shipments we are good where the db is blank. For our older customers who want to keep their data we need to run a script that will update all the dates to utc. I am about to code in t-sql something like below and want to know if this is best way. Below is pseudo code. thanks foreach (table in mydb.tables()) { foreach

How can I query an which Active Directory account is associated with a SQL Server user?

妖精的绣舞 提交于 2019-12-13 01:29:52
问题 I have have two SQL Server's that I primarily use (a 2005 instance and a 2000.) My permission structure works as such-- First I create an Active Directory Group and then I add all necessary user's to it. Then, I go to SQL-MS and I add a user by select the Windows Authentication option, and then selecting the AD Group which I just created. Impertinent to this post but I then associate the new login account with all of the necessary data tables, views and SPs. After selecting the group, I have

Sql Server. Why field value of [almost] any type may be treated as quoted string in Query/DML?

余生长醉 提交于 2019-12-13 00:24:31
问题 I discovered SUDDENLY that in SQL Server (2000) any field type value may be treated as quoted string (in query or DML). Question: Is it normal behavior or accidentally successful result? Example: CREATE TABLE [Test_table] ( [int_field] [int] NULL , [float_field] [float] NULL , [date_field] [datetime] NULL , [id] [int] NOT NULL ) ON [PRIMARY] GO update test_table set int_field = 100, float_field = 10.01, date_field = CAST('2013-11-10' AS DATETIME) where id = 1 update test_table set int_field =

Convert Single SQLSERVER 2005 Script to a SQL SERVER 2000 script

心不动则不痛 提交于 2019-12-13 00:13:10
问题 Hi guys first of all I have no expirience with DB programing only basic SQL queries. I have an sql script that was devolped for SQL Server 2005 FB and I need to run it in SQL server 2000. I don't have the original 2005 DB. only a script and a SQL 2000DB I found many guides for converting a whole DB but what can I do with a single script? it is a very long script that I cannnot share here because of datasecurity issues. here is the error please assist me. 回答1: The syntax for specifying index

SQL Server: Any value in vertical partitioning when i'm always going to re-JOIN them?

感情迁移 提交于 2019-12-12 20:08:20
问题 i'm faced with having to add 64 new columns to table that already had 32 columns. For examples sake: Customers ( CustomerID int Name varchar(50) Address varchar(50) City varchar(50) Region varchar(50) PostalCode varchar(50) Country varchar(2) Telephone varchar(20) ... NewColumn1 int null NewColumn2 uniqueidentifier null NewColumn3 varchar(50) NewColumn4 varchar(50) ... NewColumn64 datetime null ... CreatedDate datetime LastModifiedDate datetime LastModifiedWorkstation varchar(50)

How to create sql procedure for calculating Total dues

♀尐吖头ヾ 提交于 2019-12-12 18:38:29
问题 Can anyone help me by showing a create procedure statement for calculating Total Dues from three tables? Here are the tables along with their data .. Table_1 accountno shipername shiperaddress Executivename 001 john 123, London Paul 002 Robi 127, China Soma Table_2 Executivename shipername shiperaddress accountno currentamount anotheramount paul john 123,london 001 10500 12000 soma robi 127,china 002 11000 6800 Table_3 accountno Date ReceivedAmount MoneyReceiptNo 001 1/1/2012 6500 G 256412

How to query hierarchical information with SQL-Server 2000?

烂漫一生 提交于 2019-12-12 18:37:35
问题 I've got a table Folders with hierarchical information about folders: FolderID FolderName ParentID 1 Folder1 0 2 Folder2 1 3 Folder3 2 4 Folder4 3 For Folder4 I would like to get the parent folders in the following format: Folder1\Folder2\Folder3\ Note: I have asked this before, but I cannot use CTE because I am using SQL-Server 2000. 回答1: I've written a SQL function that should return what you're looking for. /* Set up test data */ create table Folders ( FolderID int, FolderName varchar(10),

LINQ, Skip, OrderBy, and SQL Server 2000

若如初见. 提交于 2019-12-12 18:31:15
问题 I'm accessing a data context object that is auto-generated by using LINQ to SQL. The SQL database is a SQL Server 2000 box. The class I'm working with is a SQL View. I have a statement that is similar to this: query = _context.OrderDetails .Where(w => w.Product == "TEST") .OrderBy(o => o.DateCompleted) .ThenBy(t => t.LineItemId) .Skip(startRowIndex) .Take(maximumRows); However, when the value of Skip is anything but 0, I get this error: This provider supports Skip() only over ordered queries