Reputation
Next tag badge:
945/1000 score
190/200 answers
Badges
10 120 226
Newest
 Nice Answer
Impact
~3.2m people reached

19h
comment What started this SQL Server job?
sysjobhistory only shows the login name that made the request, which isn't going to help if it's sa or a domain account (it won't tell you the workstation it came from, unless it's a local Windows account, and it won't tell you whether it was an application, a stored procedure, T-SQL in a query window, a job, etc.).
22h
comment MySQL: Using DATE_SUB to subtract business days instead of all calendar days
Did you search at all? stackoverflow.com/a/1829033
1d
comment MySQL: Using DATE_SUB to subtract business days instead of all calendar days
Create a calendar table.
1d
awarded  Nice Answer
2d
answered Insert data between 30 minute time intervals
2d
answered I want to add a user/login to role in another database without switching databases
2d
comment How to do a 'SUM' of a COUNT(*) in your select to be grouped by a particular column in SQL SERVER
Can't Crystal Reports call a stored procedure? Why should Crystal Reports limit what T-SQL you can use?
2d
comment Insert data between 30 minute time intervals
What are the data types? What is the longest interval you can have (e.g. are all start/end times for any given row guaranteed to be on the same day or within 24 hours of each other)? Why does your table bother storing elapsed time? This is redundant information you can already get from Start Time and End Time.
2d
comment Why are my jobs not running and next run is not scheduled?
What is "an error"? Could you list it explicitly so we don't have to guess?
2d
comment Unable to change database owner to a user that is already mapped as user
Well, what error message are they getting?
2d
revised Unable to change database owner to a user that is already mapped as user
added 343 characters in body
2d
comment Unable to change database owner to a user that is already mapped as user
@Chineshinho then you didn't alter all of the schemas they currently own.
2d
comment How to execute stored procedure from other database?
@Thronk that would yield Database 'db1' does not exist.
2d
comment Unable to change database owner to a user that is already mapped as user
@Chinesinho NO. Did you try it? This isn't renaming acct1 to dbo. It is merely changing its ownership. Ownership of a schema is not the same thing as the schema container of a table - it is just confusing in this case because dbo has multiple purposes.
2d
comment How to execute stored procedure from other database?
And is it actually complaining about sp1 (or a procedure that sp1 is calling)? Are you sure sp1 is in the dbo schema? Are you sure it exists in db1? What does this yield: SELECT name,schema_id FROM db1.sys.procedures WHERE name = N'sp1';?
2d
comment Unable to change database owner to a user that is already mapped as user
The application isn't going to care who has authorization on the schema. The tables will still belong to the same schema (you are referencing the schema name explicitly in your app, right?). You can't change the schema to be owned by login_name because login_name doesn't exist in the database. Since you mapped login_name to dbo (by making them the database owner), the user name is now dbo. Perhaps you should ask yourself why you want this user to be the database owner.
2d
comment How to execute stored procedure from other database?
You should be able to use three-part naming without difficulty. What is the actual problem? e.g. when you call dbo.sp2, what happens? Error message? Wrong results? Something else?
2d
answered Unable to change database owner to a user that is already mapped as user
Jul
2
comment List of all missing order numbers that are not in the table
Well, I presume your table has a column named OCROrderNo, not ORDERNUMBER. You need to adjust the sample code to your own schema, which means correcting table and column names.
Jul
2
revised How do I troubleshoot error 26: “Error Locating Server/Instance Specified”
deleted 50 characters in body