Viewing 15 posts - 2,821 through 2,835 (of 3,008 total)
If you want an integer, you can use this as the default for your column:
abs(convert(int,convert(varbinary(16),newid())))
June 6, 2007 at 10:03 pm
Using DATENAME eliminates dependency on the setting of DATEFIRST, but it introduces a dependency on the setting of LANGUAGE.
This code gives a day of week number that is independent of...
June 6, 2007 at 9:52 pm
This should do it, and it shows the breakout by type.
select EMAIL_ADDRESS, ACCOUNT_COUNT= sum(ACCOUNT_COUNT), LEAD_COUNT= sum(LEAD_COUNT), CONTACT_COUNT= sum(CONTACT_COUNT), TOTAL_COUNT = sum(ACCOUNT_COUNT+LEAD_COUNT+CONTACT_COUNT) from ( select EMAIL_ADDRESS = EMAILADDRESS1, ACCOUNT_COUNT = count(*), LEAD_COUNT = 0, CONTACT_COUNT = 0 from ACCOUNTBASE group by EMAILADDRESS1 union all select EMAIL_ADDRESS = EMAILADDRESS, ACCOUNT_COUNT = 0, LEAD_COUNT = count(*), CONTACT_COUNT = 0 from LEADS group by EMAILADDRESS union all select EMAIL_ADDRESS =...
June 1, 2007 at 11:13 pm
Your function depends on the setting of DATEFIRST, and the default setting for DATEFIRST depends on the national language setting of SQL Server.
The function on this link is independent...
May 29, 2007 at 10:30 pm
You can use a date table, but I doubt if you will find one that does exactly what you want, because the output you listed has an inconsistent format for...
May 29, 2007 at 10:16 pm
You can use them, but you should remember that it is not really a data modeling tool, but a way to build and maintain a database with a GUI tool that...
May 24, 2007 at 9:50 pm
The problem with splitting data that way is that it assumes that the workload is evenly distributed across the files. It is rare to actually have accurate information about that,...
May 24, 2007 at 9:32 pm
If you are planning on doing this in a production database where there are live transactions happening, dropping or disabling the foreign key constraints is a very bad idea. You...
May 24, 2007 at 7:23 pm
It is better to bcp the data into staging tables, and then update rows that already exist that have changed, and insert the new rows.
May 23, 2007 at 9:32 pm
I like to do it this way, because it prevents anyone from connecting to the database. Even a single user connection will cause the restore to fail.
use master alter database My_Database_Name...
May 20, 2007 at 8:20 pm
Here is an alternate solution, using your test data. This one groups by the start of week date, using Monday as the start of the week.
This solution has a couple...
May 20, 2007 at 8:13 pm
I would just point out that a table without a primary key is not even in first normal form.
Personally, I would never accept a table into production without a primary key.
Someone mentioned...
May 16, 2007 at 7:42 pm
This sounds similar to an IT fad of the past, Decision Support Systems.
I remember being at a meeting with the company president where we were asked to introduce ourselves and...
May 10, 2007 at 4:23 pm
The function on the link below is designed to load a date dimension table for any range of dates that you supply. It contains over 60 columns of date attributes.
It...
May 8, 2007 at 9:11 pm
The method I use is to capture at least three different workloads, and look at the index recommendations from each one. Then I create only the indexes that were recommended...
May 5, 2007 at 6:07 pm
Viewing 15 posts - 2,821 through 2,835 (of 3,008 total)