Viewing 15 posts - 46 through 60 (of 95 total)
Instead of creating it yourself why dont you use one of the many that are currently out there ?
I use the scripts from Ola and they work brilliantly for me.
April 11, 2013 at 8:13 pm
Unless there are some other surprises this should do it.
Ive changed the definition for your table variable and im assuming that information is readily available to you.
I would still recommend...
April 9, 2013 at 11:18 pm
Im not sure why you went searching for other code when you had some that worked as you wanted.
Unfortunately its very hard to help since you still have not given...
April 9, 2013 at 10:53 pm
Personally i wouldnt live without one anymore.
It has many more uses than what i showed.
The solution Chris provided doesnt use a tally table so if you dont want one then...
April 9, 2013 at 7:52 am
Do a search for tally table on the forums - you need one.
N is the column name in mine
April 9, 2013 at 4:04 am
Keep in mind what Chris says - im assuming they are all datetime.
The code will need to change if they are different.
April 9, 2013 at 1:38 am
That should be fine.
Try this. Just uncomment the insert into statement and replace with your actual table
declare @studentid as datetime = '2012-01-03 00:00:00'
declare @studentname as varchar(20) = 'john'
declare @startdate as...
April 9, 2013 at 1:37 am
Something like this ?
IF OBJECT_ID('TempDB..#test','U') IS NOT NULL
drop table #test
create table #test
(studentid int, studentname varchar(20), startdate datetime, starttime datetime, endtime...
April 9, 2013 at 1:04 am
Yep i understand after seeing the function that its not appropriate.
There is only around 5 tables so far where this needs to be done so its manageable in separate stored...
March 29, 2013 at 4:58 am
Thanks for that chris.
I guess i was hoping i could create some sort of function that i could apply to multiple tables.
Looks like that wont be happening.
Still its a good...
March 27, 2013 at 6:55 pm
Thanks Chris, much appreciated - this looks like what im after.
Seeing how easy the code really is it looks like i was over complicating it.
Is this something that could be...
March 26, 2013 at 7:20 pm
Vinu, part of this works but im pretty sure its not a good way of doing it and it will need to be performed over a number of tables which...
March 26, 2013 at 2:58 am
Cadavre, Im not expecting to have the physical data ordered.
For any queries that will work on this table it will always have an
order by orderId asc
I guess its like...
March 26, 2013 at 2:55 am
Sorry i will try to clarify. I have two different situations that i can think of.
The first is when im trying to change the order of a current item to...
March 26, 2013 at 2:51 am
One way of doing this is to open up SSMS.
Right click on your database name.
Choose tasks then GEnerate scripts.
Go through the wizard and have it generate a sql file or...
March 26, 2013 at 1:10 am
Viewing 15 posts - 46 through 60 (of 95 total)