Viewing 15 posts - 5,536 through 5,550 (of 8,731 total)
You need a combination of LEFT with PATINDEX.
SELECT LEFT( String, PATINDEX('%[0-9]%', String) - 1)
FROM (VALUES('BT67 8kT'),('B68 4HY'))x(String)
November 14, 2014 at 9:45 am
You don't need to use an additional table. You just need to use the dynamic sql correctly.
DECLARE @QUERY NVARCHAR(4000)
DECLARE @STARTTIME DATETIME
DECLARE @ProdDBName_testlog VARCHAR(30)
DECLARE @ProdTableName_testlog VARCHAR(30)
SET @ProdDBName_testlog = 'master'
SET @ProdTableName_testlog =...
November 14, 2014 at 8:29 am
Sean Lange (11/14/2014)
Something like this.
insert into OrderB
(
City
,...
November 14, 2014 at 8:13 am
Jason-299789 (11/14/2014)
I don't disagree, and as Lynn states maybe if MS enforced it so that code wouldn't compile without the use of the statement terminators, like they do in C#/C++...
November 14, 2014 at 8:10 am
Why do you want to use an IF? That's why we have WHERE clauses.
UPDATE dbo.OrderB
SET OrderCity = 'London'
WHERE OrderCity = ''
November 13, 2014 at 3:35 pm
g.britton (11/13/2014)
SeanNerd (11/13/2014)
I have a table where we cannot use the typical int identity primary key column. The table can have...
November 13, 2014 at 3:29 pm
You could also try cross tabs. Read the following articles on how to work with them and how to make them dynamic.
Part 1: http://www.sqlservercentral.com/articles/T-SQL/63681/
Part 2: http://www.sqlservercentral.com/articles/Crosstab/65048/
November 13, 2014 at 3:16 pm
November 13, 2014 at 3:15 pm
sqldriver (11/13/2014)
Luis Cazares (11/13/2014)
I was expecting something like that. I don't have a similar procedure because I usually don't need it.
Do you have your...
November 13, 2014 at 1:45 pm
I was expecting something like that. I don't have a similar procedure because I usually don't need it.
November 13, 2014 at 1:32 pm
And there's another alternative based on "best practices" 🙂
DECLARE @PrVers NVARCHAR(128)
, @PrVersNum DECIMAL(10,2)
, @command NVARCHAR(4000)
SET @PrVers = CAST(SERVERPROPERTY('ProductVersion') AS NVARCHAR(128));
SELECT @PrVersNum = SUBSTRING(@PrVers, 1,CHARINDEX('.', @PrVers) + 1 )
PRINT @PrVers
PRINT...
November 13, 2014 at 1:00 pm
What about creating the table and adding or dropping columns as needed?
Here's an example dropping the column to preserve the order and prevent confusing the Intellisense.
DECLARE @PrVers NVARCHAR(128)
, @PrVersNum DECIMAL(10,2)
SET...
November 13, 2014 at 12:07 pm
Gazareth (11/13/2014)
=StrConv(Fields!FieldName.Value,vbProperCase)
Note there's a Reporting Services section further down the page where you'll have more luck with VB, anything you...
November 13, 2014 at 11:21 am
We're giving you the code for the user defined functions(UDFs). There's no system function that will complete the problem easily and correctly.
The code in the functions might be complex but...
November 13, 2014 at 9:55 am
This is a common topic and the functions have pros and cons.
Here's a function by Jeff Moden that will run amazingly fast despite being a scalar function.
CREATE FUNCTION [dbo].[InitialCap](@String...
November 13, 2014 at 9:00 am
Viewing 15 posts - 5,536 through 5,550 (of 8,731 total)