Tag Info

New answers tagged

3

What you are referring to is deferred name resolution and is further explained here Deferred Name Resolution and Compilation. Deferred name resolution can only be used when you reference nonexistent table objects. All other objects must exist at the time the stored procedure is created. For example, when you reference an existing table in a stored ...


1

I believe that in sql server 2005 you can create a stored procedure that references a table that does not exist. I have just done it, see my example below. --set parseonly on select @@version --Microsoft SQL Server 2005 - 9.00.5000.00 (X64) --Dec 10 2010 10:38:40 --Copyright (c) 1988-2005 Microsoft Corporation --Enterprise Edition (64-bit) on Windows NT ...


2

I think your problem is the fact your WHERE clause has multiple predicates on the same table. This article by Paul White explains the issue. It may be possible to get around this issue by having a computed column that does what your current WHERE clause does. You could then use this column on it's own but this would need a bit of testing to make sure it ...


3

There is no inconsistency: 1048576 * 8 = 8388608 KB => 8 GB; Both Perfmon and sys.dm_os_sys_info show 8 GB; [bpool_visible], [bpool_commit_target] and [bpool_committed] - in SQL 2005 all these are defined as "Number of 8-KB buffers ..." (http://msdn.microsoft.com/en-us/library/ms175048(v=sql.90).aspx), so you have to multiply the result by 8 to get ...


4

Your code is valid SQL but not in SQL-Server. They haven't yet implemented the syntax (a,b) IN ((1,11), (2,12), ...) or (a,b) IN (SELECT expa, expb....). You can work around with either an EXISTS subquery: DELETE FROM tableA AS a WHERE EXISTS ( SELECT 1 FROM tableA AS b WHERE b.IDA = a.IDA AND b.IDB = a.IDB HAVING COUNT(*) ...


3

update a set a.CHK = 1 from tableA a join tableB b on b.IDA = a.IDA and b.IDB = a.IDB


0

I tilted on your "data loss could have legal ramifications here" comment. Then, you definitely want to get a powerful 3rd party tool (like DPM) that can handle backups (and recover from catastrophics events in a flash and minimal fussing around) alot faster and alot better than any script you can pull off the Internet. Having backups is one thing. Knowing ...


1

you can create a table variable(or temp table) and insert all the .bak file metadata in that table and then fetch the row with max value of modified time. DECLARE @FileMeta table (columns nvarchar(200)); INSERT INTO @FileMeta EXEC sys.xp_cmdshell 'dir D:\FolderName\*.bak'; SELECT * FROM @FileMeta WHERE columns not like '%volume%' AND columns is not ...


1

You could consider raising a connect item (Microsoft bug report) as you have a reliable "repro", but then there are a number of workarounds for the problem - eg there is no real need for the APPLY, eg ;WITH TableA AS ( SELECT 101 as A_ID ), TableB AS (SELECT 1 as B_ID, 101 as B_A_ID , 'xxx' as B_Courses UNION ALL SELECT 2 , 101 , 'YYY' ...


1

There are a number of them, a lot of articles on the topic if you have google at it. Some of them: Default Schema for Windows Groups User Defined Server Roles Enhancments to Auditing User Contained Databases, authentication without logins. TDE - Transparent Data Encryption Hashing Functions - improved.


1

Since you have downtime, best is to use this powershell script- with backup restore option This script will take care of moving databases, logins, jobs,etc on the new server. make sure to use backup restore switch as opposed to detach/attach.



Top 50 recent answers are included