Viewing 15 posts - 1,441 through 1,455 (of 5,588 total)
GilaMonster (5/2/2011)
Ninja's_RGR'us (5/2/2011)
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
May 2, 2011 at 9:53 am
Jeff Moden (5/1/2011)
WayneS (5/1/2011)
BTW, I'm aghast --- you've actually used...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
May 2, 2011 at 9:45 am
Jeff, I had to rate this article 5 stars, because that's as high as the ratings allow. It deserves a 15!
BTW, I'm aghast --- you've actually used a SQL CLR...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
May 1, 2011 at 2:04 pm
You know, the people that help out here are all un-paid volunteers, so please HELP US HELP YOU. Providing the DDL scripts (CREATE TABLE, CREATE INDEX, etc.) for the tables...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
April 29, 2011 at 9:56 am
Since you're only getting a previous row's value, and not actually doing a running total, this should work:
UPDATE t1
SET PreviousArea = CASE WHEN t1.System_Id = t2.System_Id THEN...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
April 29, 2011 at 8:38 am
Jason,
Nice new avatar.
Edit: It goes with your nice, new handle.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
April 29, 2011 at 7:14 am
Edit: posted advice won't work...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
April 28, 2011 at 9:16 pm
No problem. If you have any questions, just ask away. As the tagline in my signature states, don't use the code in production until you can understand what it's doing.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
April 28, 2011 at 3:05 pm
How's this work for you?
(You'll have to modify it to do the actual update; I'm just selecting the corrected data.)
DECLARE @CLI_CleanUp table
(CLI varchar(20))
insert into @CLI_CleanUp (CLI) values ('123456789')
insert into...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
April 28, 2011 at 1:03 pm
Chrissy321 (4/28/2011)
How about this update statement?UPDATE CLI_CleanUp
SET CLI = stuff (CLI, patindex( '%[^0-9]%', CLI),1,'')
WHERE patindex( '%[^0-9]%',CLI) <>0
This doesn't handle non-numeric values that aren't at the start of the...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
April 28, 2011 at 1:01 pm
How does this work for you?
-- See how you start off by actually creating a table and then
-- inserting the data into it? Your doing this makes it a...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
April 28, 2011 at 12:40 pm
DECLARE @test-2 VARCHAR(20);
SET @test-2 = '1,2,3,16';
DECLARE @MyTestTable TABLE (RowId INT);
INSERT INTO @MyTestTable
SELECT 1 UNION ALL
SELECT 2 UNION ALL
SELECT 3 UNION ALL
SELECT 4 UNION ALL
SELECT 5 UNION ALL
SELECT 6 UNION ALL
SELECT...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
April 26, 2011 at 1:25 pm
;
WITH cteAddressIDOrder (AddressId, SortOrder) AS
(
SELECT 8, 1 UNION ALL
SELECT 1, 2 UNION ALL
SELECT 3, 3 UNION ALL
SELECT 2, 4 UNION ALL
SELECT 4, 5 UNION ALL
SELECT 5, 6 UNION ALL
SELECT 6,...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
April 26, 2011 at 1:15 pm
This is a Kerbosis error message...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
April 26, 2011 at 1:09 pm
I know this isn't PowerShell. From SQL, you could run this:
LEFT(@@SERVERNAME, CHARINDEX('\', @@SERVERNAME)-1)
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
April 24, 2011 at 7:43 pm
Viewing 15 posts - 1,441 through 1,455 (of 5,588 total)