Viewing 15 posts - 2,821 through 2,835 (of 3,011 total)
Here is a ready built script that will do what you want.
Script to analyze table space usage
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=61762
June 14, 2007 at 2:11 pm
You can make your backup to a compressed directory.
June 13, 2007 at 4:04 pm
If you are asked this question: “If you were any animal, which one would you be and why?”, the correct answer when interviewing for a management position is:
I...
June 13, 2007 at 4:00 pm
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
Viewing 15 posts - 2,821 through 2,835 (of 3,011 total)