Tag Info

New answers tagged

2

Actually, I think this is the opposite of a bug. the 2008 document states "Source and target tables must share the same filegroup" but it looks as though they only started paying attention to their rules in 2014. This article (made for 2014 / 2016 CTE) states "The corresponding indexes, or index partitions, must also reside in the same filegroup" TechNet


1

Every trigger have some internal tables , INSERTED and DELETED. In this case, we use only the INSERTED table, which hold the records inserted. ALTER TRIGGER [xxx] ON [dbo].[Main] AFTER INSERT AS BEGIN SET NOCOUNT ON; INSERT INTO dtsx.dbo.main(refno,subject,recdate,dateind,officefrom,author,status) SELECT ...


1

You can't install UTF-8 as a character set because it's not a character set, it is an encoding. If you want to store Unicode text you use the nvarchar data type. If you want to store text encoded using UTF-8, you store it as binary data (varbinary).


3

As answered by ypercube in a comment to the question There are one or more trigger(s) on your table. The multiple (1 row(s) affected) messages are generated not just by your single-row update statement, but also by other statements in the triggers fired from that original action.


1

Please pay attention. The answer from Julien is correct. BUT if you attach the database to an SQL Server 2008 instance it will be upgraded! If the application can't handle SQL Server 2008 and needs SQL Server 2005 you're in trouble. Take an extra step and make a backup. Furthermore you have to create the needed logins on the new server. You might want to ...


1

You first have to detach it on your old server: USE Master GO -- drop all active connections and roll back open transactions ALTER DATABASE YourDB SET SINGLE_USER WITH ROLLBACK IMMEDIATE GO -- detach it EXEC sp_detach_db 'YourDB' GO On your new server, once the files have been move, you can now attach it: USE master; GO CREATE DATABASE YourDB ON ...


6

In addition to the additional space marked "in-use" by SQLPERF you might have space in your transaction log that is not being freed for other reasons. You should probably take a look at the log_reuse_wait_desc column of sys.databases. If it says NOTHING or LOG_BACKUP then what you are seeing is probably the space taken up by the current VLF. If however if ...


5

It could be that a transaction running in another database has a hold on some objects in foo database. Using dbcc opentran(foo) only reports on transactions in foo, not in some other database. Also, it might help you to read this description (from 2001(!)) on How DBCC SQLPERF (Logspace) Reports Percentage Used at: ...


8

The problem you're facing is that you are not actually re-enabling your constraint (as defined by the NOCHECK). The syntax for re-enabling a constraint is as follows: ALTER TABLE <tablename> WITH { CHECK | NOCHECK } CHECK CONSTRAINT <constraintname>; The WITH CHECK|NOCHECK tells SQL Server whether or not you want to check the existing data in ...


1

Figured it out myself. My where clause is telling sql to only show rows that are 'Bet' and have that date criteria, so without me realising it I'm telling sql to show me rows that had bets. Here is my alternative query... select i.accountnumber, i.firstname, i.lastname, sum(isnull(amount,0)) from accountinformation i left join accountactivity a on ...


2

Instead of using "Copy-and-paste" to copy from the user-interface; use a T-SQL script to copy the rows from one table to another. Setup a test-bed with two tables, one will be the source, the other the destination: USE tempdb; CREATE TABLE dbo.StatusTable1 ( StatusNumber NUMERIC(18,10) ); CREATE TABLE dbo.StatusTable2 ( StatusNumber NUMERIC(28,2) ...


0

for a database that is NOT involved in replication I have added my notes below. -- script to restore database IntEng2 -- to a point in time 22-aug-2014 at 11:30 AM -- marcelo miorelli -- 22-aug-2014 --================================================ -- 6 THINGS TO DO BEFORE DOING A RESTORE: --================================================ ...



Top 50 recent answers are included