Question I am using the below query to pull back database sizes for our SQL instances.
This cannot pull data larger than 2TB back because of the maximum number the int data type can pull back. How do I go about altering the query to return the database size, …
Question I realize this is likely a simplistic question but my searches only return results for Drive Letters or Database names if I include SQL Server. Please feel free to point me to existing articles or answers, and my apologies in advance :)
Question Diving on dba.stackexchange.com I found a nice answer that teach me how to open a .bacpac file with File Explorer.
I gave it a try with the database AdventureWorks2008R2 and all I did was:
Save the database as .bacpac file Rename the file extension …
Question I have seen on this site how to get the the third Friday of the month:
select quote_date FROM table where datename(weekday, quote_date) = 'Friday' and datepart(day, quote_date)>=15 and datepart(day, quote_date)<=21; How would I get the first Monday …
Question Is there a query I can run that will show me all tables with an identity column? Trying to figure out if there are any identity based tables whose current identity is nearing upper bound of int32 or int64.
Question I came across some weird behavior: While passing a float value into a varchar column, the values are getting converted from integers into scientific notation, and it's that scientific notation that gets stored as a string.
if …
Question I have been using linked server with the old provider (SQLNCLI) without any issue, as recommended by Microsoft, I'm planning to switch to new provider (MSOLEDBSQL). I'm able to add linked server using following T-SQL after installing the drivers
EXEC …
Question I understand that table partitioning is mostly done for data management. I understand that table maintenance becomes more difficult for large tables, since e.g. an index rebuild cannot fit in memory or because e.g. sorts scale with O(n*log(n)) and …
Question My organization had a security audit and was told that we need to DISABLE the "allow remote connection to this server" option for all of our SQL Servers. What impact would this have on connection to the SQL Server via Management Studio (SSMS) from a …
Question When saving a number with leading zeros into a string variable or column, leading zeros are truncated.
When I run this query:
declare @varchar as nvarchar(50) set @varchar = 011 print @varchar The result I get is 11.
Is there any way to get 011?