Viewing 15 posts - 1,216 through 1,230 (of 3,348 total)
If you just used copy/paste on what Raghavender posted, then you told the SQLCmd tool to execute a single query (listing all data from one of the AdventureWorks tables) and...
January 6, 2016 at 2:08 am
You can use EXEC sp_changedbowner to change the ownership.
(In fact, that is probably exactly what the SSMS UI does when you click those buttons).
January 6, 2016 at 1:26 am
First, be careful with the UI options in Management Studio. Some of the dialogs that pretend to select from a view actually read the underlying definition and then connect straight...
January 5, 2016 at 4:07 pm
Meatloaf (1/5/2016)
I have created an After Update trigger and wanted to know if there is a SQL table called UPDATED in 2012.
No, there is not.
Or do I need to do...
January 5, 2016 at 3:56 pm
To give a user generic rights in a database, the easiest solution is to add them to a fixed database role. E.g. database_reader can read all tables, database_writer can modify...
January 5, 2016 at 3:52 pm
SQLisAwE5OmE (1/5/2016)
Thanks Jacob, that worked.I also tried this way and it worked as well, just FYI.
Select * from activity where product_code like '%WELL%' and transaction_date between '2013-01-01' and '2014-12-31'
Thanks again.
Consider...
January 5, 2016 at 2:20 pm
Not tested but I guess this would work:
1. Add the user to the model database. New databases are created as a copy of model so I expect the user to...
January 5, 2016 at 2:11 pm
Yes, you are right. I did not think about XML.
If you need to return data in unpredicatable and ever changing form, then XML is a good tool. But remember that...
January 5, 2016 at 2:06 pm
Hi Lee,
Based on the plans you posted and the query text (thanks for catching my mistake with the update / union clash!), I can see the following:
Based on the available...
January 5, 2016 at 2:03 pm
I am sorry to hear that the CLR aggregate does not support the newer windowing extensions. But you are right that this invalidates the idead and that it makes no...
January 5, 2016 at 1:38 pm
sandesh_krishnan (1/5/2016)
I have a T-SQL query provided by users of our data, which goes after multiple tables and generates an output. There are multiple queries similar to...
January 5, 2016 at 1:31 pm
Lowell (1/4/2016)
sounds like a one procedure to rule them all situation, not the best way to do things.
I would modify the...
January 5, 2016 at 12:34 am
The best way to troubleshoot dynamic SQL is to add PRINT @SQLString just before the EXEC or sp_executesql statement. That way you can look at the SQL that was submitted,...
January 5, 2016 at 12:21 am
As Scott mentions, an OR in a query makes it almost impossible to get a seek. But a rewrite can help you get two seeks instead of one scan -...
January 4, 2016 at 2:47 pm
When you restart the services, Tempdb is dropped and created fresh, based on its default settings. Have you verified the size of tempdb immediately after the restart? If it was...
January 3, 2016 at 1:44 pm
Viewing 15 posts - 1,216 through 1,230 (of 3,348 total)