71,605 reputation
994183
bio website sqlsentry.com
location Rhode Island
age 40
visits member for 3 years, 10 months
seen 1 hour ago

Senior Consultant at SQL Sentry, SQL Server MVP, @AaronBertrand on twitter, blogger at sqlperformance.com, blogs.sqlsentry.com, and sqlblog.com, Mac user, volleyball player, curler, hockey/football/tennis fan, big-time loser at fantasy football, proud father of two beautiful girls, and a Canadian, eh?

profile for Aaron Bertrand on Stack Exchange, a network of free, community-driven Q&A sites

3h
comment Quickly clone a database in SQL Server Management Studio
Better starting points: 2012 SP2 | 2014
4h
comment Counting SQL Server Transactions
You mean historically, or going forward? If historically, no, SQL Server doesn't track this information for you.
5h
revised Can't cast a SPROC parameter?
added 722 characters in body
5h
comment Can't cast a SPROC parameter?
Dynamic SQL (or date only) are terrible excuses for converting a date to a string. Your dynamic SQL should still be safely parameterizing a date variable through sp_executesql, not concatenating and double-single-quoting some date that has been changed to a string.
5h
answered Can't cast a SPROC parameter?
5h
comment Can't cast a SPROC parameter?
Why are you casting a date as nvarchar then casting back to date? Also stored procedure parameters can't take expressions - only constants and variables. Finally, don't use nvarchar without length, and never mind why is this a string, why is it nvarchar instead of varchar?
6h
revised Need to query records based on Date only (Sample Query given)
added 1027 characters in body
6h
answered Need to query records based on Date only (Sample Query given)
7h
comment changing SQL data types from varchar(50) to smaller rational types increases table space
In order to reclaim space used by reducing column widths, you'll need to rebuild.
8h
comment Problem to access the SQL Server
That you can attach... maybe. MDF/LDF files are not as reliable as proper backups. If the SQL Server service that can't be connected to is still running, you won't be able to move the files. And if it's running, they could be corrupt, depending on how SQL Server was brought down.
10h
comment Table size is not changed after new column is added
@gotqn yes, that's right. And the table will get bigger whenever you update any of those existing rows, too, and new rows will inherit the explicit value of course. So it's not a permanent benefit (unless you never touch any rows). I'm not sure what happens if that column is later indexed, the table is rebuilt, etc.
10h
comment Table size is not changed after new column is added
I like how they say "ADD COLUMN syntax"... you can say ADD but you can't say ADD COLUMN. :-)
10h
revised Problem to access the SQL Server
deleted 233 characters in body
11h
comment SQL Multiple JOINS Interpretation order
Why is this tagged mysql?
11h
comment SQL Multiple JOINS Interpretation order
For inner joins, I agree. For outer joins, order certainly does matter.
22h
comment SSMS IntelliSense doesn't work on particular database
See the bit here that starts with, "And finally, you may just need to be patient." I suspect this particular database is a lot more objects, a lot of schemas, or has a very complex set of dependency chains. Once it finally all loads, you should be fine, as long as your network connectivity is somewhat reliable and there aren't a lot of schema changes happening. Leaving Management Studio open instead of opening/closing it a lot should relieve some of this too.
1d
comment Cleaning disabled SQL agent jobs in SQL Server 2005 and above
Object Explorer Details will allow you to right-click and script, too. So, you know, if you don't know PowerShell, you don't have to go learn it to save yourself a right-click. :-)
1d
answered Copy of a database with an existing database with schema and data in sql server
1d
comment Login failed for user - Error: 18456, Severity: 14, State: 38
Check that login's default database - I bet it's not NordenWeb. Or, somehow, Access is specifying a different database.
1d
comment Numeric Latitude & Longitude values are rounded up when querying SQL Server Database
Stored using what data type? What is the definition of the view? Where are you actually observing this rounding? Are you using PRINT, SELECT, or is it after it is written out by your application?