Viewing 15 posts - 9,211 through 9,225 (of 15,381 total)
spencer_robinson (2/28/2013)
--DROP TABLE IF IT EXISTS
IF OBJECT_ID('TempDB..#StoreItemWeeksHave','U') IS NOT NULL
BEGIN
DROP TABLE #StoreItemWeeksHave
END
IF OBJECT_ID('TempDB..#StoreItemWeeksNeed','U') IS NOT NULL
BEGIN
DROP TABLE #StoreItemWeeksNeed
END
IF OBJECT_ID('TempDB..#Weeks','U') IS NOT NULL
BEGIN
DROP TABLE #Weeks
END
--CREATE THE...
February 28, 2013 at 9:48 am
I like the CTE approach that Erin posted. Just a couple changes to it so that it will produce the desired output.
;with cte
as
(
select IndName
, Account
, AddressType
, AddressLine1
, AddressLine2
,...
February 28, 2013 at 9:43 am
Hi and welcome to SSC. Your post does not contain a whole lot of information. I cobbled together some stuff based on what you posted. I changed your column names...
February 28, 2013 at 9:33 am
Duplicate post. Direct all replies to the original thread. http://www.sqlservercentral.com/Forums/Topic1425086-392-1.aspx
February 28, 2013 at 9:14 am
As Eugene already said it is far more helpful if you can provide ddl and data in a consumable format. I had a little time so I did this for...
February 28, 2013 at 9:13 am
There is nowhere near enough information to provide anything other than a shot in the dark. Please read the following article about what to post for performance problems. http://www.sqlservercentral.com/articles/SQLServerCentral/66909/%5B/url%5D
February 28, 2013 at 7:37 am
Glad you got it sorted out.
And thanks Jeff for the extra points. 😉
February 28, 2013 at 7:19 am
asco5 (2/27/2013)
Sean Lange (2/27/2013)
asco5 (2/26/2013)
this is a example of what i want to do
as you see i have my data base and i have...
February 28, 2013 at 7:16 am
jancas08 (2/27/2013)
February 27, 2013 at 3:27 pm
You have the wrong wildcard in your LIKE. The asterisk is from Access. SQL Server use percent.
when ERRORMESSAGE LIKE 'ED%' then 'Education'
February 27, 2013 at 3:26 pm
Sean Lange (2/27/2013)
declare @sql varchar(max) = ''
--First is the updates
select @sql =...
February 27, 2013 at 2:54 pm
adonetok (2/27/2013)
One table as below.How to code to select top 2 records?
IDSEQUECENOTE
10011AAA
10012BBB
10013CCC
10014DDD
10015EEE
20021GGG
20022HHH
20023KKK
20024MMM
20025NNN
20026PPP
20027QQQ
20028RRR
I need to select top 2 records:
IDSEQUECENOTE
10014DDD
10015EEE
20027QQQ
20028RRR
Something like this should work.
select * from
(
select ID, SEQUECE, NOTE, ROW_NUMBER() OVER...
February 27, 2013 at 2:52 pm
This should cover the Updates and Deletes. I don't understand how the insert logic is supposed to work.
declare @sql varchar(max) = ''
--First is the updates
select @sql = stuff ((
select...
February 27, 2013 at 2:37 pm
jancas08 (2/27/2013)
Typically running about 5000 rows.I will send sample data in 2mins.
OK then this will greatly benefit from a set based approach instead of a cursor. Thanks for the...
February 27, 2013 at 1:47 pm
jancas08 (2/27/2013)
The TEST ddl is the data that has commands that specify changes to the tables.
My objective is to do those specified commands which can...
February 27, 2013 at 1:22 pm
Viewing 15 posts - 9,211 through 9,225 (of 15,381 total)