Viewing 15 posts - 1 through 15 (of 18 total)
use a case statement:
select case when column1 > column2 then column1 else column2 end as Result;
December 5, 2016 at 2:52 am
It looks like you're overthinking it. Try something like this:
INSERT INTO aaa_test_users (UserName, first_name, last_name)
FROM aaa_test_sp
INSERT INTO aaa_test_users_positions (UserID, position, phone)
SELECT aaa_test_users.UserID, aaa_test_sp.position, aaa_test_sp.phone
FROM aaa_test_sp
join...
October 15, 2015 at 3:25 am
I'd have them all as separate packages. You can have a new "Master" package which calls the others one by one, one advantage of this is that the called packages...
September 4, 2015 at 3:21 am
It took me a little while to figure this out, and it may still need some further tweaking, but this query returns the rows in a phone book format:
declare
November 27, 2014 at 5:52 am
Just as a point of information, the ID field in tbl_Data is what we're calling a surrogate key, it's called a surrogate because the value of the ID has nothing...
November 13, 2014 at 2:42 am
You can have several indexes on a table, but the data is physically stored on the disc in the order of the clustered index. This is why using a surrogate...
November 12, 2014 at 4:09 pm
Is your sample data correct? You've got GBP to USD showing as 1.587, and you've also got USD to GBP as the same rate.
I'd start by simplifying the exchange rate...
November 12, 2014 at 10:04 am
What's the difference between the dump table and the holding table? It looks like you're importing the data into one table just so you can index it and then move...
November 12, 2014 at 9:00 am
I've seen a similar approach used in the past when populating a large data warehouse that took several hours. A copy of the database was created and populated, and then...
November 12, 2014 at 4:44 am
I'd import the text file into a staging table and then run a merge statement to copy any new data into the live table.
Maybe you can get the SSIS package...
November 12, 2014 at 4:37 am
This should give you what you want:
select ContractNumber, MAX(pc1) as pc1, MAX(pb) as pb, MAX(om) as om, MAX(vp) as vp
, MAX(BillClerk) as BillClerk, MAX(BillCord) as BillCord, MAX(OpsMgr) as OpsMgr,
MAX(VicePres) as...
November 7, 2014 at 8:25 am
Note: I posted some code, removed it because it didn't work, and then posted this code in its place.
Try something like this:
declare @data table (groupid int, salesperhour tinyint)
declare...
November 7, 2014 at 3:01 am
Thanks for that, I'll have a look at those articles later. Still had to do some googling to find out what VLF stands for though, as she doesn't give a...
November 4, 2014 at 9:08 am
If you're backing up the transaction log then SQL Server should start reusing the space in the log file after the backup has finished. You could shrink the log file...
November 4, 2014 at 8:52 am
JJR333 (10/31/2014)
... shrink the database...
Just be aware that if you do this you'll fragment all your indexes. Also it's generally frowned upon because the server will only have to grow...
October 31, 2014 at 9:53 am
Viewing 15 posts - 1 through 15 (of 18 total)