sql-server-2005

How to check for mutual existence of Fields in same table in Two columns

◇◆丶佛笑我妖孽 提交于 2019-12-13 02:00:12
问题 I tried using "Exist" and "IN". Not only did I not succeed, it didn't seem as an efficient solution. Here is a simplified example: TblMyTable UserName1 - Grade - UserName2 - Grade I need a query where there is a mutual relation / existence. What I mean is that the returned result from the query will only include the users where on the same row there is both UserName1 and UserName2 mutually (see image below for a better example / explanation). Any user can work with any other user. So 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

I want to connect SQL Server database which is in .bak format to the ASP.net web application that I have created

偶尔善良 提交于 2019-12-13 01:42:18
问题 I have created an ASP.Net web application with SQL Server 2005 database on another computer. I want to transfer it to another PC. Therefore, I have copied the ASP.Net Project and also the SQL database in .bak format. I need to configure the application to connect to the database and need help to get the correct connection string. PS: the database created was by SQL Server 2005 and I need to deploy on SQL Server 2012 回答1: bak files are Sql Server backup files. You need to restore it into the

How to split cell content and extract information into a new column in an SQL select statement?

和自甴很熟 提交于 2019-12-13 01:41:36
问题 I have a table where one of the columns are storing key/value pairs separated by semicolons, like this: KEY1:VALUE1;KEY2:VALUE2;KEY3:VALUE3 I would like to construct a view where I have additional columns where the value will be extracted from the field above. My question is how to extract VALUE1, VALUE2 and VALUE3 in a SELECT query. There will not be more than three key-value pairs in this field. 回答1: I've already answered an incredibly similar question today, so look at the answer: SQL

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

How to view and change data of a .mdf file using MS Access?

我的未来我决定 提交于 2019-12-13 01:25:25
问题 Background: I have an .mdf database containing some numeric values that I need to change (specifically, scale and offset values for sensors). The database was created by a Visual Basic program that controls some lab equipment and stores pertinent data in the .mdf file. Please excuse my rudimentary knowledge of the topic; I'm a complete novice when it comes to SQL Server and VB. After searching through many posts, I understand that to open the .mdf file, you must "attach" it in Microsoft

Decrypt SQL Server encrypted data from .net

半城伤御伤魂 提交于 2019-12-13 00:59:16
问题 Is it possible to decrypt the EncryptByCert-encrypted data that is stored in a SQL Server column from within .net? I want to use EncryptByCert in a stored procedure to store a value RSA-encrpyted in a column. Then a client application will connect to SQL Server and request the encoded data and then needs to decode with the private key of the certificate. Is this possible? I don't have a profound knowledge of encryption. That's why I ask this question. Maybe there is a good example for doing

SSAS: named queries

試著忘記壹切 提交于 2019-12-13 00:44:52
问题 I must first admit that I'm new to Analysis Services but now must extend an existing complex cube with a new dimension. So its even difficult to tell where my problem is without saying that i dont even have a plan how to start. Ok, i will try to tell what i want to achieve. Given is a Datasourceview with a named calculation 'Returns'. Its expression is: CASE WHEN fimaxActionCode IN (1, 2, 3, 4, 5, 8, 9, 12, 14, 17, 18, 20, 21, 22, 23, 24, 25, 30, 31, 32, 35) THEN 'yes' ELSE 'no' END

Pre-allocate varbinary(max) without actually sending null data to the SQL Server?

别等时光非礼了梦想. 提交于 2019-12-13 00:32:31
问题 I'm storing data in a varbinary(max) column and, for client performance reasons, chunking writes through the ".WRITE()" function using SQL Server 2005. This works great but, due to the side effects, I want to avoid the varbinary column dynamically sizing during each append. What I'd like to do is optimize this by pre-allocating the varbinary column to the size I want. For example if I'm going to drop 2MB into the column I would like to 'allocate' the column first, then .WRITE the real data

Using SQL Server Express 2008 with SQL Server 2005 database -how to check for compatibility

不想你离开。 提交于 2019-12-13 00:24:10
问题 I am using SQL Server 2008 express edition but I want to make my databases still in 2005. How can I set it up to only show features that a 2005 database can use? Like for instance I don't remember there being a "date" type. I only remember "dateTime". I don't want to be using features that 2005 can't support and I later on upload my db to the my hosting site that uses 2005 still and find out I am using things not supported by it. 回答1: You won't be able to upload the database, just a script of