Viewing 15 posts - 1,291 through 1,305 (of 1,472 total)
That error likely comes from this:
SET @MasterName = 'MasterList'+@TableCount+''
which needs to be:
SET @MasterName = 'MasterList'+CAST(@TableCount as varchar(5)) +''
October 24, 2008 at 11:53 am
As Ninja said, views are normally used to solve this kind of issue.
CREATE VIEW EmailList1
AS
SELECT *
FROM EmailList
WHERE ID < 10000
CREATE VIEW EmailList2
AS
SELECT *
FROM EmailList
WHERE ID BETWEEN 10000 AND 19999
October 24, 2008 at 10:17 am
And what is week number? It could be defined in several different ways.
October 24, 2008 at 6:55 am
Since many companies have their own dates for when weeks start and end (ie. payweeks, Thu - Wed, or Mon - Sun, etc), I normally generate a table that encompasses...
October 24, 2008 at 6:43 am
My pleasure. Please let us know which ones end up performing the best in your environment.
October 24, 2008 at 6:31 am
No problem. This is the method I was referring to:
[font="Courier New"]DECLARE @ColA VARCHAR(5),
@ColID INT
UPDATE #MyTable
SET @ColA = ISNULL(ColA, @ColA),
ColA = @ColA,
@ColID = ColID
FROM #MyTable WITH (INDEX(0))
[/font]
The key here...
October 24, 2008 at 5:56 am
Actually, he probably did. Jerry edited his post 😉 I make a habit of looking for that, as a lot of times people answer questions as edits to...
October 23, 2008 at 10:43 pm
It may not be. Old style outer join syntax confuses me. Conditions in your where clause are independent of your join structure. For instance, if you do...
October 23, 2008 at 10:32 pm
You can do it using Dynamic SQL. The more important question is why you need to do it at all. 40K rows is awfully small to look at...
October 23, 2008 at 10:17 pm
This can provide the solution you are looking for:
http://www.sqlservercentral.com/articles/Advanced+Querying/61716/
If you need me to help you get it working, I'd be happy to do so if you'd provide some sample data...
October 23, 2008 at 10:10 pm
Try this:
SELECT givenName AS FirstName, sn AS LastName, uid as UserEmail, manager AS ManagerEmail
FROM OPENQUERY (ADSI, 'SELECT givenName,sn,uid,manager FROM ''LDAP://LDAP.HP.com:389/ou=People,DC=hp,DC=com'' WHERE hpOrganizationChart=''Procurve*''')
October 23, 2008 at 11:22 am
Left Joins and a coalesce:
SELECT COALESCE(A.Value, B.Value)
FROM Source
LEFT JOIN TableA A ON Source.ID = A.ID
LEFT JOIN TableB B ON Source.ID = B.ID
October 23, 2008 at 11:12 am
[EDIT]
This was wrong. I was half asleep when I initially wrote it, and I get lazy when people don't provide DDL / Sample data. The following should work...
October 23, 2008 at 6:21 am
Yep, I pasted it directly into QA on my SQL 2000 server and ran it. I get 61 rows returned.
October 22, 2008 at 3:07 pm
From what you've posted so far, I highly doubt you'll need a cursor for this. Read the post we're both talking about and try to give us as much...
October 22, 2008 at 3:04 pm
Viewing 15 posts - 1,291 through 1,305 (of 1,472 total)