Viewing 15 posts - 316 through 330 (of 1,082 total)
does my solution not work???
I'll test it with a million rows and see what happens...
OH and you haven't given us an example of a different start position?
March 17, 2009 at 4:58 am
Here is a solution that doesn't use a loop.
It uses a tally table.
The only thing missing from the query is that I'm not 100% sure how the StartPostion comes into...
March 17, 2009 at 4:51 am
at least you not getting an error now.
So all that needs to be is to make sure your data is correct that you searching for 🙂
March 17, 2009 at 3:16 am
March 16, 2009 at 11:20 am
cool I'll wait for your reply.
It might also be funny data in your table.
but I can't see any columns being used for the dynamic build...
March 16, 2009 at 11:06 am
cool please could you post the full CREATE PROCEDURE code.
Sorry to be a pain, but something is missing here...
March 16, 2009 at 10:59 am
where is the code that sets the variables and declares the variables???
I need a script I can copy directly from here and paste into a SSMS window and run to...
March 16, 2009 at 10:40 am
Ok.
But you still haven't post the exact script that you are running...
We can't help if we don't know the values of the variables
March 16, 2009 at 10:35 am
nah it's cool I been editing my posts 🙂
March 16, 2009 at 9:54 am
mmm you basically just wrapping you " in Quotes but it seems wierd cause there are 4 of them I know.
Sorry I'm not 100% sure how to explain this...
But basically...
March 16, 2009 at 9:49 am
oh sorry about that.
try this
select left([name], 1) from table1 where left([name], 1) ="""" and right([name], 1) =""""
March 16, 2009 at 9:41 am
both of the posting that I have made run 100% and the only thing I have changed was adding the )
So I think the actually variable values that are being...
March 16, 2009 at 9:34 am
what about if you run this?
CREATE TABLE InsSales
(
region VARCHAR(100),
SaleYear INT,
salesPerson VARCHAR(100),
SalesMonth INT,
TotalSales INT )
GO
DECLARE @CYear VARCHAR(100)
DECLARE @PYear VARCHAR(100)
DECLARE @SalesPerson VARCHAR(100)
DECLARE @Salesmonth VARCHAR(100)
SELECT
@CYear = 2009,
@PYear = 2008,
@SalesPerson = 'Smith',
@Salesmonth =...
March 16, 2009 at 9:27 am
🙂
Thanks
You need to use single quotes around the double quotes
DECLARE @table1 TABLE
([name] VARCHAR(100))
INSERT INTO @table1
SELECT '"STICHTING WERELDHULP-BELGIE"'
select left([name], 1) from @table1 where left([name], 1) ='"' and right([name], 1) ='"'
March 16, 2009 at 9:26 am
running this code gives no errors.
CREATE TABLE InsSales
(
region VARCHAR(100),
SaleYear INT,
salesPerson VARCHAR(100),
SalesMonth INT,
TotalSales INT )
SELECT x.SaleYear, x.TotalSales
FROM (SELECT SaleYear,
TotalSales =...
March 16, 2009 at 9:21 am
Viewing 15 posts - 316 through 330 (of 1,082 total)