Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options user 37015

All versions of Microsoft SQL Server (not MySQL). Please also add a version-specific tag, like sql-server-2016, since it is often relevant to the question.

-1
votes
If the output has some sort of logical order, or even some arbitrary order that fits in with your 10 rows requirement, you could use the ROW_NUMBER() window function, like so: SELECT * FROM ( S …
answered Aug 9 by nateirvin
3
votes
It turns out the culprit was our old friend, ARITHABORT! In the view documents, poNumber is actually the output of a scalar-function call. One of the inputs was a BIGINT that I was trying to pass to …
answered Mar 1 '17 by nateirvin
0
votes
The biggest flaw that I see is that if any of your users ever found a way to access your database directly (I realize it might be locked down, but accidents and hacks happen), they'll then have the ab …
answered Jun 3 '15 by nateirvin
4
votes
3answers
I have two servers, SERVER-01 and SERVER-00 (not their real names). SERVER-00 is a SQL Server 2005 Standard instance, SERVER-01 is a SQL Server 2014 Standard instance. I have this query that runs in a …
asked Feb 28 '17 by nateirvin
0
votes
1answer
I'm trying to get replication set up - this is my first time ever doing it, so I'm probably making some rookie mistake here. Right now I'm just working in the dev environment. I've been following the …
asked Jul 24 '15 by nateirvin
15
votes
2answers
We have a number of tables in our database that have VARCHAR(MAX) columns where a VARCHAR(500) (or something much smaller than max) will suffice. Naturally I want to clean these up, and get the sizes …
asked Jan 28 '15 by nateirvin
13
votes
In SSMS, right-click on the database and go to "Reports", "Standard Reports", "Disk Usage by Table". It will tell you the total size, the data size, the index size, and the unused size for each table …
answered Aug 25 '15 by nateirvin
2
votes
The expression you're looking for is (regardless of whether you do a computed column or an external UPDATE): CASE WHEN HasValidHours = 1 AND NoDemerits = 1 AND NoAccidents = 1 THEN 1 ELSE 0 END
answered Mar 11 '15 by nateirvin
0
votes
0answers
I'm not a SAP developer. We already have a big SSIS package that pulls data from the SQL Server instance that our SAP installation uses and I need to add discount data to it. I've usually had pretty g …
asked Feb 9 '17 by nateirvin
1
vote
I doubt Microsoft has anywhere published the logic that is used to determine how SSMS will script a table change. It should be noted that the way SSMS has handled these has evolved over the years - I …
answered Feb 9 '17 by nateirvin
4
votes
2answers
I'm new to DW/BI, and this seems like a pretty basic question, but I can't seem to find a good answer. I have a fact table that would have more than one date associated with it, so I was thinking th …
asked Dec 5 '14 by nateirvin
1
vote
If you just need this for a one-time query, I'd recommend something like this: WITH AdjustedVehicleInfo AS ( SELECT DATEADD(HOUR, -7, Timestamp) AS MST_Timestamp FROM Vehicle ) SELECT MST_Ti …
answered Feb 2 '15 by nateirvin
0
votes
Your current setup seems to be on the right track. I would cut SSIS out of the equation - the stored procedure INSERTs into the staging table, and then a C# app pulls the data out, creates the XML fil …
answered Apr 2 '15 by nateirvin
2
votes
I've had to import Access files into SQL Server before and haven't found the Import and Export wizard to be a very good tool for the job. What I ended up doing was opening up the Access file, finding …
answered Sep 28 '17 by nateirvin
2
votes
2answers
We've been running SQL Server 2014 for almost a year now, but SQL Server 2012 SP3 continues to appear in the Windows Update list (as an optional install). It seemed ridiculous to install a service pac …
asked Jun 20 '16 by nateirvin