Viewing 15 posts - 5,956 through 5,970 (of 7,185 total)
Karthik
First off, if @abc is varchar, then -1 isn't a valid value, although '-1' is.
Second, in the code snippet you posted, you were only using @abc as a means to...
April 28, 2008 at 8:16 am
As I said, if you can't change your function to a stored procedure then you're going to have to change the design of your database. Perhaps you could create...
April 28, 2008 at 8:11 am
Art
The best way is to have a separate "numbers table" or "tally table", and to join to that. They have a multitude of uses and usually come out on...
April 28, 2008 at 8:05 am
...
LEFT OUTER JOIN sys.types types
ON ...
April 28, 2008 at 8:00 am
April 28, 2008 at 7:51 am
The first part of your WHERE clause is effectively turning your second OUTER JOIN into an INNER JOIN. Try putting this condition as a join predicate instead.
John
April 28, 2008 at 7:46 am
OK, well you will have to replace the "..." in the snippet Gail gave to get you started with some actual code. Don't forget ROW_NUMBER always has a "()"...
April 28, 2008 at 7:22 am
You could combine the two, something like this:
SELECT
FROM Address a JOIN Publication p
ON LEFT(a.Addr_PostCode, CHARINDEX(' ',a.Addr_Postcode)-1)
= LEFT(p.Pub_PostCode, CHARINDEX(' ',p.Pub_Postcode)-1)
WHERE p.Pub_PublicationID =
John
April 28, 2008 at 7:00 am
OK, now please show us what you expect the query to return, and what you've tried so far.
John
April 28, 2008 at 7:00 am
Ganesh
Please supply table DDL in the form of a CREATE TABLE statement, sample data in the form of INSERT statements, and the result set you expect to see. If...
April 28, 2008 at 6:41 am
Example 1 fails because you can't have a variable setting the database name. Example 2 fails because the dynamic SQL that you use executes in a different context from...
April 28, 2008 at 6:37 am
First of all, you need already to have a full backup and a differential backup of your database. If you do, then restore from the full backup with no...
April 28, 2008 at 6:24 am
You could try something like this:
DECLARE @tv table (reviewed char(1))
IF @reviewed IN ('P','B','N') INSERT INTO @tv VALUES ('P')
IF @reviewed IN ('F','B','N') INSERT INTO @tv VALUES ('F')
IF @reviewed = 'N' INSERT...
April 28, 2008 at 6:19 am
Yes, I should have spotted this the first time. Just get rid of the SELECT and it should work.
If you ever get a syntax error message, your first port...
April 28, 2008 at 3:33 am
Chandrachurh Ghosh (4/28/2008)
a #table has a local scope, so it will not work.....
Not true. A temp table will persist until it is dropped or the user connection terminates. ...
April 28, 2008 at 3:23 am
Viewing 15 posts - 5,956 through 5,970 (of 7,185 total)