sql-server-2012

Updating columns values from another table SQL

喜你入骨 提交于 2020-02-05 02:52:07
问题 I want to update my table from another table in another database.I have two table that has two same columns.There are ID and iexp column.What i want is update every row from k_monster table to my database's k_monster table but there are other columns such as iHP iMP so i want to just update iExp column.what do you suggest? 回答1: Assuming Target_Database is the database where the table is that you want to update and Source_Database is the database where the table is you are using to update from

OLEDE Error: Login failed for user 'DOMAIN\ComputerName$'.;28000

和自甴很熟 提交于 2020-02-03 08:22:13
问题 I am trying to deploy an Analysis Services cube in SQL Server 2012. My user account is REALM\Merin where REALM is the domain and my computer's name is Hercules . I am already in Analysis Service's administrator group. When I process the cube using SQL Server Data Tools, I get following error. OLE DB error: OLE DB or ODBC error. Login failed for user 'REALM\Hercules$'.; 28000. My user account is REALM\Merin but I don't know why it is complaining about user REALM\Hercules$. What does this

OLEDE Error: Login failed for user 'DOMAIN\ComputerName$'.;28000

风流意气都作罢 提交于 2020-02-03 08:21:51
问题 I am trying to deploy an Analysis Services cube in SQL Server 2012. My user account is REALM\Merin where REALM is the domain and my computer's name is Hercules . I am already in Analysis Service's administrator group. When I process the cube using SQL Server Data Tools, I get following error. OLE DB error: OLE DB or ODBC error. Login failed for user 'REALM\Hercules$'.; 28000. My user account is REALM\Merin but I don't know why it is complaining about user REALM\Hercules$. What does this

Default sort order for a select query in SQL Server 2005 and SQL Server 2012

心已入冬 提交于 2020-02-03 06:36:36
问题 Is there a difference between default sort order for a select query in SQL Server 2005 and SQL Server 2012? I have a table variable without a primary key. When I execute a select query on the table variable in SQL Server 2005, the records are selected and displayed in alphabetical order as per one of the columns. In SQL Server 2012, the records are displayed in the same order as in the parent table. 回答1: There is no default sort order. Unless you specify it in the ORDER BY clause, there is no

Default sort order for a select query in SQL Server 2005 and SQL Server 2012

天涯浪子 提交于 2020-02-03 06:36:13
问题 Is there a difference between default sort order for a select query in SQL Server 2005 and SQL Server 2012? I have a table variable without a primary key. When I execute a select query on the table variable in SQL Server 2005, the records are selected and displayed in alphabetical order as per one of the columns. In SQL Server 2012, the records are displayed in the same order as in the parent table. 回答1: There is no default sort order. Unless you specify it in the ORDER BY clause, there is no

SQL Server xp_delete_file parameters

假装没事ソ 提交于 2020-01-31 23:00:23
问题 Who can explain list of xp_Delete_file parameters in sql server. I don't find msdn document for this stored procedure. I got script of xp_Delete_file from maintenance plan but didn't understand first parameter. 回答1: Xp_delete_file take five parameters: File Type = 0 for backup files or 1 for report files. Folder Path = The folder to delete files. The path must end with a backslash "\". File Extension = This could be 'BAK' or 'TRN' or whatever you normally use. Date = The cutoff date for what

SQL Server xp_delete_file parameters

人盡茶涼 提交于 2020-01-31 22:59:27
问题 Who can explain list of xp_Delete_file parameters in sql server. I don't find msdn document for this stored procedure. I got script of xp_Delete_file from maintenance plan but didn't understand first parameter. 回答1: Xp_delete_file take five parameters: File Type = 0 for backup files or 1 for report files. Folder Path = The folder to delete files. The path must end with a backslash "\". File Extension = This could be 'BAK' or 'TRN' or whatever you normally use. Date = The cutoff date for what

Getting offset of datetimeoffset in SQL Server

会有一股神秘感。 提交于 2020-01-31 22:19:39
问题 In SQL Server I need to find the offset of a given datetimeoffset(7) . I have researched the documentation and there are all ways to change the offset but not a way to know the offset of a particular value (sorry if I missed it). Well I came up with the following piece of code that I find too complicated although seems to work. DECLARE @datetimeOffset datetimeoffset(7) SET @datetimeOffset = CAST('2007-05-08 22:35:29.1234567-05:00' AS datetimeoffset(7)) DECLARE @result datetimeoffset(7)

Getting offset of datetimeoffset in SQL Server

一个人想着一个人 提交于 2020-01-31 22:19:18
问题 In SQL Server I need to find the offset of a given datetimeoffset(7) . I have researched the documentation and there are all ways to change the offset but not a way to know the offset of a particular value (sorry if I missed it). Well I came up with the following piece of code that I find too complicated although seems to work. DECLARE @datetimeOffset datetimeoffset(7) SET @datetimeOffset = CAST('2007-05-08 22:35:29.1234567-05:00' AS datetimeoffset(7)) DECLARE @result datetimeoffset(7)

How to write a stored procedure to insert values into two tables with a foreign key relationship?

余生长醉 提交于 2020-01-26 04:10:08
问题 I created two tables, Employeeinfo and Employeerequests . Table Employeeinfo can have one unique user with columns: id (primary key, auto increment) name dep address and table Employeerequests can have multiple requests against one unique user ID with columns id (primary key, auto increment) CustomerID(foreign key to Employeeinfo(ID column)) category requests. Now I want to design a stored procedure in such a way so that I can insert values into both tables at the same time. Please help. I am