Tag Info

Hot answers tagged

3

Try changing the function to a non-inline table value function, with a clustered index. This will store the tvf's result set in an internal temp table, which may help you. A draft of what I mean: CREATE FUNCTION [dbo].[GetIndicator] ( @indicator varchar(50), @refDate datetime ) RETURNS @out TABLE ( Id int NOT NULL, ColINT_1 int NOT NULL, ...


3

A #temp table works just like any other table in the sense that you can write SELECT, UPDATE, INSERT and DELETE statements on it. Examples: UPDATE #someTable SET someColumn=123 WHERE someCriteria=1; SELECT * FROM #someTable;


3

When you create job using maintenance plan automatically job is created in SQL Server agent under Jobs. So now go to SQL Server agent expand jobs look for your job. Right click on it and select Script job as...Drop and recreate to..New query editor window. you can get the script Edit: You can export the maintenance plans as well. You need to connect to ...


2

I read that the change in recovery model only has effect after a backup is taken. However, if after the performing the above I do This is mainly for when you change from simple recovery to full. After changing from simple to full you need to take full backup to take database out of Pseudo simple recovery. Pseudo simple recovery means even if database is ...


2

You can use the hint WITH (RECOMPILE) while creating / executing your store procedure. CREATE PROCEDURE sp_GetRespond WITH RECOMPILE OR EXECUTE sp_GetRespond WITH RECOMPILE Every times, the sp is run SQL Engine re-compiles it and generate the most optimal execution plan.


2

It depends on the method you're using to alter the column. We'll start with a simple table: CREATE TABLE dbo.Customers (ID INT IDENTITY(1,1) PRIMARY KEY CLUSTERED, CustomerName NVARCHAR(200)); CREATE INDEX IX_CustomerName ON dbo.Customers(CustomerName); Then use the SQL Server Management table designer to change the CustomerName column to a VARCHAR(200) ...


2

Carlo, do you have other ideas? You jus took a backup, so when you write the execute SQL Statement part of your job reference the MSDB backup history information tables to pull out the latest full and any other diffs/logs/etc that you would like to apply. The data can be found in msdb under the dbo schema and will give you the file names, etc, so there ...


2

I primarily use them when I'm moving or copying a database to a new instance of SQL Server. In that case, the DMK in the database will be re-encrypted with the new instance's service master key, but the objects encrypted by the DMK (in your case, the symmetric keys) will not be updated accordingly. You'll need to restore the DMK from a separate backup using ...


2

Stop using CAST and use CONVERT. Specifically because, in this case, you need to use a certain style parameter in order to get the right string comparison (otherwise it is just converting 0xwhatever to the string value represented by 0xwhatever, which is not 0xwhatever. Compare: SELECT CONVERT(VARCHAR(32), 0x48656C6C6F21), CONVERT(VARCHAR(32), ...


1

You might try looking at msdb.dbo.sysjobactivity. This table includes the session_id and the job_id for actively running jobs. I would expect you could take that and then connect back into the sessions DMVs to get your information.


1

Why not just use the SQLNCLI10 provider? Are you required to use MSDASQL? Here is a sp_addlinkedserver script adding a linked server named ServerST that points to ServerAR. EXEC master.dbo.sp_addlinkedserver @server = N'ServerST', @srvproduct=N'ServerST', @provider=N'SQLNCLI10', @datasrc=N'ServerAR' Update 19/082014 Download SQL Query Stress Tool ...



Only top voted, non community-wiki answers of a minimum length are eligible