Tag Info

Hot answers tagged

5

when I try to use Management Studio to attach to the .mdf file There's not really a gentle way to say this: Stop doing that. The GUI is full of bugs and bad defaults; more importantly, unless you take a screencast, we have no way to identify exactly what steps you're taking as you point and click your way through the GUI. Log in as a system ...


5

Check if another process has claimed port 1434: netstat -ano | findstr 1434 This will give you the process id of the offending process, which you can then identify: tasklist | findstr /c:"<process id>"


3

First add a row_number() value to the mix, because I'm guessing you can't rely on ID to have no gaps. WITH NumberedRows AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY Number, Name ORDER BY SubNumber) AS RowNum FROM [Table] ) --now compare RowNum to SubNumber. When the difference changes, there's been a gap in the sequence of SubNumber values. , Diffs ...


3

You're querying two different things here. xp_fixeddrives will show you the amount of free space on the disk. Using sys.dm views will tell you how much free space there is in the tempdb data file. If the data file is 50GB, then you're only using 5GB of it and the rest is empty. Even though it's empty, the file exists and is taking up 50GB of space on your ...


2

@AaronBertrand's answer is great. Here's a variation with a bit more info from here SELECT (physical_memory_in_use_kb/1024) AS Memory_usedby_Sqlserver_MB, (locked_page_allocations_kb/1024) AS Locked_pages_used_Sqlserver_MB, (total_virtual_address_space_kb/1024) AS Total_VAS_in_MB, process_physical_memory_low, process_virtual_memory_low FROM ...


2

Please help me on how can i find for what could have been possibly going wrong where data does not match between both the DB. You can use tablediff utility to find out the difference in data between your Publisher and Subscriber server. Check How to run TableDiff utility for ALL replicated tables ? article by Chris Skorlinski on REPLTalk. This blog has ...


1

Will suggest you to go through this whitepaper SQL Server 2012 Upgrade Technical Guide, to get a proper understanding on what all is needed for the activity. There are many points which would be need to be think upon, i.e. Just upgrading by keeping the compatibility level at a older version is not real upgrade. Evaluate at using some of the new features ...


1

You can try selecting into a temp table with the zip criteria only, and then select from the temp table with the additional criteria. SELECT * INTO #MyTemp FROM (SELECT * FROM MyTable where zip='1234') data SELECT * from #MyTemp where other = 'Y' DROP Table #MyTemp Not sure if this will be faster, but since the zip-only query runs fast, then you're just ...


1

Is there a better way to write this type of query? No, the way you've written it is the "best" way. Unless, of course, that way doesn't work. The joy and frustration of using a declarative language is the optimiser. It is your best friend when it works and worst enemy when it doesn't. One way to kick the optimiser into doing the right thing is to ...



Only top voted, non community-wiki answers of a minimum length are eligible