Viewing 15 posts - 3,661 through 3,675 (of 5,588 total)
All the pieces from above, all put together.
SELECT 'ALTER LOGIN ' + QuoteName(name) + ' WITH CHECK_POLICY = ON;'
FROM sys.server_principals
WHERE [type] = 'S' -- SQL Server...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
August 11, 2010 at 9:24 am
dennisv (8/11/2010)
Sorry I asked here.Please eveyone just forget about it.
But yes, we are all happy to do away with 1000+ stored procedures and 400+ views and 350+ temporary tables.
So...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
August 11, 2010 at 9:05 am
David,
This is definitely an excellent, thought-provoking article. Thanks!
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
August 11, 2010 at 7:37 am
Hi Anil,
This is actually a good example of why you need to provide accurate test data to demonstrate the issue that you're having. The test data did not work for...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
August 11, 2010 at 6:19 am
I'm surprised that nobody has yet pointed to the excellent DelimitedSplit8K function, developed here on this web site. (Actually, I bet Jeff's getting ready to showcase it later tonight!)
I used...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
August 10, 2010 at 4:59 pm
Tara-1044200 (8/10/2010)
DECLARE @rowcount int
SET @rowcount = 100000
SET rowcount 100000
WHILE @rowcount >0
BEGIN
BEGIN TRAN
Update dbo.Employee set jobcode = 1 Where jobcode <> 1
SET @rowcount =...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
August 10, 2010 at 10:29 am
Might I suggest the SQL Server 2008 Upgrade Technical Reference Guide?
You probably need to convert those to varchar(max) first.
Don't forget to run the SQL 2008 upgrade advisor - it will...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
August 10, 2010 at 7:29 am
ODPOA (8/10/2010)
My task.-Create daily backups of the changes made that day
-Apply those changes to a remote database
Here's my two cents worth:
1. You're running on MSDE.
2. As Gail pointed out, this...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
August 10, 2010 at 6:40 am
Anil,
This method, just for SQL 2005+, utilizes a CTE to build a dynamic tally table. Not much else is different.
-- declare and initialize variables
DECLARE @CNTPRD INT;
SET @CNTPRD = DATEDIFF(D,'2005-12-31',GETDATE());
-- this...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
August 10, 2010 at 5:31 am
See how this works for you.
-- since you already have a clustered index, we need to dump the table to a temp table
-- where we can build the clustered index...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
August 10, 2010 at 5:25 am
BTW, you've been posting in the SQL 7/2000 forums. Is it safe to assume that this code is for SQL 2000? If not, what version are you using?
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
August 10, 2010 at 5:01 am
Thanks for the table structure and inserts... good to see that you've learned!
How does this work for you?
DECLARE @CNTPRD INT;
SET @CNTPRD = DATEDIFF(D,'2005-12-31',GETDATE());
-- these two lines of code are to...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
August 10, 2010 at 4:59 am
Okay, I just noticed that part of what you are doing is based on the previous record. This will require a different approach.
Do you have any indexes on this table?...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
August 10, 2010 at 4:38 am
Your insert statements don't run...
Msg 109, Level 15, State 1, Line 54
There are more columns in the INSERT statement than values specified in the VALUES clause. The number of...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
August 10, 2010 at 4:28 am
Jeff Moden (8/8/2010)
drew.allen (8/7/2010)
Here's an example using the Information_Schema.Tables view. WARNING: XML is case sensitive
Thanks, Drew. Rumor has it that it's also pretty touchy about special characters like...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
August 9, 2010 at 9:51 pm
Viewing 15 posts - 3,661 through 3,675 (of 5,588 total)