Viewing 15 posts - 541 through 555 (of 7,191 total)
DECLARE @SYSTEM_USER sysname = 'DOMAIN\Joe.Bloggs';
WITH SystemUser (UserName) AS (
SELECT REPLACE(@SYSTEM_USER,'\','.')
)
SELECT
PARSENAME(UserName,2) AS FirstName
, PARSENAME(UserName,1) AS LastName
FROM SystemUser;
John
March 8, 2019 at 9:36 am
The error message tells you exactly what's wrong. You need to rewrite the subquery so it returns only one value.
John
February 26, 2019 at 1:45 am
Use MIN and MAX dateID, grouped by RecordID and Quantity. That'll work for your sample data, but it'll give strange results if you ever go back to the same Quantity...
February 21, 2019 at 9:24 am
I think those numbers refer to the schema versions, not the compile time and run time.
John
February 13, 2019 at 9:13 am
Perhaps it didn't get installed properly. Can you see SQL Server in the Services applet?
John
February 4, 2019 at 9:47 am
Have you tried running SQL Server Configuration Manager to find out the name of the instance, and possibly also the port number on which it listens?
John
February 4, 2019 at 9:25 am
Grant the user UPDATE permission on the tables in question, and deny DELETE on the same tables. You can do that directly or via membership of a role that you...
February 1, 2019 at 9:32 am
ALTER DATABASE myDatabase SET COMPATIBILITY_LEVEL = 120;
Don't do this on the production server unless you really know what you're doing.
John
January 30, 2019 at 2:22 am
The SELECT is there to assign a value to @SalesTaxDue. It's necessary because unlike in some other languages, you can't assign a value with an equality expression alone - you...
January 30, 2019 at 2:13 am
Put an extra task in your package to run whoami and put the result in a text file or a table. That will tell you under what security context the...
January 28, 2019 at 9:13 am
January 28, 2019 at 7:56 am
No, don't shrink your logs after backing up. They'll only grow again, causing fragmentation and unnecessary use of resources. Increasing the frequency of log backups may reduce the size that...
January 28, 2019 at 2:26 am
The error message explains what the problem is - it isn't finding any files. I don't know whether that's because there aren't any files that match the pattern, or whether...
January 28, 2019 at 1:55 am
You've posted in the SQL Server 2012 forum. Are you actually using SQL Server 2008 R2 or below?
John
January 25, 2019 at 6:49 am
Viewing 15 posts - 541 through 555 (of 7,191 total)