Viewing 15 posts - 6,601 through 6,615 (of 6,678 total)
From BOL on UPDATE STATISTICS:
UPDATE STATISTICS WITH RESAMPLE updates all the statistics on a table at the current sampling rate. This means that statistics tied to indexes, which are created...
May 20, 2008 at 10:13 am
This sounds like a perfect case for using EXCEPT or INTERSECT. Example:
-- Create the tables
CREATE TABLE #temp (a int, b int, c int);
CREATE TABLE #temp1 (a int, b int,...
May 20, 2008 at 9:32 am
I know exactly what you mean - I knew about this but couldn't find it, so wrote my own. Then, of course - I found it again. 😀
May 19, 2008 at 3:51 pm
Actually just found a different approach:
SELECT object_name(@@procid);
-- with SCHEMA
SELECT schema_name(schema_id) + '.' + object_name(object_id)
FROM sys.objects
WHERE object_id = @@procid;
Jeff
May 18, 2008 at 12:16 pm
Well, after thinking about this a little - I remembered something that simplifies this a little. Here is the updated script:
ALTER PROCEDURE dbo.TestProcedure
AS
DECLARE @sessionid smallint;
SELECT @sessionid =...
May 18, 2008 at 12:09 pm
Here is a better version, forgot a couple of things:
ALTER PROCEDURE dbo.TestProcedure
AS
DECLARE @objectid int;
DECLARE @sessionid smallint;
-- Get the object id for this procedure
SELECT @objectid = objectid
...
May 18, 2008 at 10:41 am
How about using something like:
DECLARE @sessionid smallint;
SELECT @sessionid = session_id
FROM sys.dm_exec_requests r
CROSS APPLY sys.dm_exec_sql_text(r.sql_handle) a
WHERE object_name(a.objectid) = 'MyTestProcedure';
IF (@sessionid IS NOT NULL)
BEGIN;
RAISERROR('Process...
May 18, 2008 at 10:20 am
You can determine the object name with the following:
SELECTobject_name(a.objectid)
FROMsys.dm_exec_requests r
CROSSAPPLY sys.dm_exec_sql_text(r.sql_handle) a
WHEREsession_id = @@spid;
If you need/want the schema also, you have to...
May 18, 2008 at 10:00 am
After adding a new drive to a cluster (both nodes, right?), then you have to add the drive to the cluster using Cluster Administrator as a resource in your SQL...
May 15, 2008 at 3:03 pm
The best way to shrink is: DON'T. Size your database and log files appropriately and expand them as needed.
May 14, 2008 at 10:58 pm
You can use the Import/Export wizard in SQL Server 2005, or - you can create an SSIS (Integration Services) package. If you use Import/Export wizard and save the package...
May 14, 2008 at 10:54 pm
Looking at what you are providing, there really is not too much we can do to identify the problem. Try just selecting the variable instead of executing it and...
May 14, 2008 at 10:49 pm
Of course - and probably additional checking to validate that we have 9 characters, etc...
May 14, 2008 at 12:56 pm
SQL-challenged (5/13/2008)
May 13, 2008 at 10:58 pm
I agree with Jeff - but, just to have some fun - I would not use the 'correct' answer for this one. I would use this:
UPDATE Employee
SET SocialSecNumber =...
May 13, 2008 at 6:19 pm
Viewing 15 posts - 6,601 through 6,615 (of 6,678 total)