sql-server-2005

How to create default instance after creating a named instance?

孤街浪徒 提交于 2019-12-18 14:52:42
问题 when installing SQLServer2005 developer edition (not express) I created a named instance: MYSERVERNAME/MYINSTANCENAME Is it possible to 1) change the name of my named instance to default: MYSERVERNAME OR 2) create a new default instance (MYSERVERNAME as above). any help would be appreciated! 回答1: Hm, when I use the "Change" button in Add/Remove Programs, SQL Server 2005 setup offers me the instance selection screen, and even allows me to list the existing instances. (I'm running XP SP2, by

Can someone explain DBCC DROPCLEANBUFFERS?

安稳与你 提交于 2019-12-18 14:46:38
问题 Can someone explain the use of DBCC DROPCLEANBUFFERS together with the CHECKPOINT operator and provide an example? I understand it is useful to test performances running before your queries but I don't fully grasp it. Also I have no clue about the use in combination with the CHECKPOINT operator. If I execute it before my queries they take much longer to run, so I am guessing it is good to compare performances but not to accurately evaluate them. Any help would be appreciated! 回答1: CHECKPOINT

How can SCOPE_IDENTITY return null when @@IDENTITY does not?

一笑奈何 提交于 2019-12-18 14:42:14
问题 After executing an insert, I either select SCOPE_IDENTITY or @@IDENTITY . SCOPE_IDENTITY returns null but @@IDENTITY does not. I don't understand how this is possible. Can you think of a reason why this happens? 回答1: here is one example of how SCOPE_IDENTITY() will be null but @@IDENTITY will have a value: insert into a table with no identity, that table has an insert trigger that then inserts into a history table with an identity. SCOPE_IDENTITY() will be null (no identity in the local scope

How can SCOPE_IDENTITY return null when @@IDENTITY does not?

不问归期 提交于 2019-12-18 14:42:11
问题 After executing an insert, I either select SCOPE_IDENTITY or @@IDENTITY . SCOPE_IDENTITY returns null but @@IDENTITY does not. I don't understand how this is possible. Can you think of a reason why this happens? 回答1: here is one example of how SCOPE_IDENTITY() will be null but @@IDENTITY will have a value: insert into a table with no identity, that table has an insert trigger that then inserts into a history table with an identity. SCOPE_IDENTITY() will be null (no identity in the local scope

What are the problems with a join between two tables in two different databases?

岁酱吖の 提交于 2019-12-18 14:09:40
问题 I am interested in your thoughts about the the pitfalls of joining two or more tables from different databases. I'll try to give an example. Suppose table Table1 is located in DatabaseA database and Table2 is located in DatabaseB . Let's say i have a view, in DatabaseA that pulls out some data from Table1 , and some other tables in DatabaseA '. This view is used to push data to another database, let's call this one, unimaginatevely, DatabaseC . If i need some data from Table2 , my instinct is

Add empty row to query results if no results found

青春壹個敷衍的年華 提交于 2019-12-18 14:03:53
问题 I'm writing stored procs that are being called by a legacy system. One of the constraints of the legacy system is that there must be at least one row in the single result set returned from the stored proc. The standard is to return a zero in the first column (yes, I know!). The obvious way to achieve this is create a temp table, put the results into it, test for any rows in the temp table and either return the results from the temp table or the single empty result. Another way might be to do

Add empty row to query results if no results found

a 夏天 提交于 2019-12-18 14:03:07
问题 I'm writing stored procs that are being called by a legacy system. One of the constraints of the legacy system is that there must be at least one row in the single result set returned from the stored proc. The standard is to return a zero in the first column (yes, I know!). The obvious way to achieve this is create a temp table, put the results into it, test for any rows in the temp table and either return the results from the temp table or the single empty result. Another way might be to do

Is there a way I can retrieve sa password in sql server 2005 [closed]

橙三吉。 提交于 2019-12-18 13:39:48
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I just forgot the password. Can anyone help me how to get back the password. 回答1: There is no way to get the old password back. Log into the SQL server management console as a machine or domain admin using integrated authentication, you can then change any password (including sa). Start the SQL service again and

Is there a way I can retrieve sa password in sql server 2005 [closed]

左心房为你撑大大i 提交于 2019-12-18 13:39:31
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I just forgot the password. Can anyone help me how to get back the password. 回答1: There is no way to get the old password back. Log into the SQL server management console as a machine or domain admin using integrated authentication, you can then change any password (including sa). Start the SQL service again and

Nhibernate filtering by user defined function output

空扰寡人 提交于 2019-12-18 13:36:37
问题 I'm reasonably new to NHibernate and everything has been going pretty well so far but I've come across a problem I'm not exactly sure of how to go about solving. Basically I need to filter by the output of a User Defined function. If I was writing in SQL this is what I'd write: declare @Latitude decimal declare @Longitude decimal declare @radius int set @Latitude = -118.4104684 set @Longitude = 34.1030032 select * from store where dbo.CalculateDistance([Latitude], [Longitude], @Latitude,