Viewing 15 posts - 46 through 60 (of 152 total)
"...how do I get the list of names into the procedure incuding the single quotes?"
That depends on the source of the list. I could provide you with Visual Basic...
May 31, 2006 at 11:16 am
The most common way to do this is to use dynamic SQL and create your SQL String on the fly, e.g.:
CREATE PROCEDURE sp_GetCertainNames
@variable varchar (100) AS
DECLARE @sql varchar(2000)
SET...
May 31, 2006 at 10:55 am
You still may have permission issues related to the user accounts being used by SQL Server. From BoL:
When xp_cmdshell is invoked by a user who is a member of...
May 31, 2006 at 10:20 am
Did your previous restore steps (including RESTORE DATABASE) include either WITH STANDBY or WITH NORECOVERY? If not, this message is expected. All of the steps, except the final...
May 31, 2006 at 10:14 am
You can only have one JOIN / WHERE combination in an update statement. Thus, this should be:
UPDATE reportTable
SET programName = description,
period = currentPeriod
FROM ReportTable...
May 31, 2006 at 10:05 am
First, I would recommend that you look at this article here:
http://www.sqlservercentral.com/columnists/dpeterson/lookuptablemadness.asp
What you are doing seems to me to be an example of what he talks about. However, back to your question.
The...
April 6, 2006 at 1:08 pm
IMO, this calls for a User-defined function:
-- Create a testing table
Create Table TestTable (ID int, TestStr varchar(20))
GO
Insert Into TestTable Values (1, 'ABC')
Insert Into TestTable Values (1, 'DDD')
Insert Into TestTable Values...
February 27, 2006 at 8:12 pm
There is, in fact, a mechanism to do what you need (though it is not in the most convenient format ever): Session Context information. To quote from BoL:
February 22, 2006 at 11:50 am
Personally, I would use something like this structure (Sample code and test below):
Create Table ConditionChecks (
CheckID int identity,
CheckDescription varchar(250)) -- Just descriptions so you know what conditions mean what
GO
Create...
February 21, 2006 at 1:47 pm
I don't see the need for a temp table here when a derived table is just as easy. Also, the check for Yesterday will go slightly faster in this...
December 31, 2005 at 5:16 am
There are a few details that I feel are missing. Without this information, I could not answer your question. Looking at the items in your cart:
2302, '000765-03', 'IDS...
December 31, 2005 at 4:58 am
I think that this can be done with a simpler, single query, thusly:
Update TBL_B
Set OrderItemID =
Coalesce((Select Max(ID) maxID
FROM TBL_A A2
INNER JOIN
(Select OrderID, InstanceID
FROM TBL_A A3...
August 17, 2005 at 1:57 pm
Just as a debugging question, did you run the alternate form:
INSERT INTO @tmpView (ID)
SELECT ID FROM @tmpTasks
WHERE ID >= @BlockStart AND ID <= @BlockEnd
If so, did it give similar or...
August 15, 2005 at 6:22 pm
One approach would be a custom transformation script. Here is a simplistic example (for a table with two columns only)
'**********************************************************************
' Visual Basic Transformation Script
' Copy each source...
August 10, 2005 at 5:57 pm
I'm not *quite* certain what you are attempting here - SUM works across rows, and you are using it within a single row?
Perhaps a small dataset showing what you want...
August 9, 2005 at 5:42 pm
Viewing 15 posts - 46 through 60 (of 152 total)