Forum: MS SQL Jan 16th, 2007 |
| Replies: 2 Views: 10,534 Also, look at the SUBSTITUTE function |
Forum: MS SQL Jan 12th, 2007 |
| Replies: 2 Views: 5,138 1. You won't lose anything -- you can import the old into the new as legacy DTS packages. SQL Server 2005 comes with SSIS, which is a little more complex than DTS, but definitely better!
3. No, it... |
Forum: MS SQL Jan 9th, 2007 |
| Replies: 1 Views: 1,653 I'm not too familiar with SQL Server's replication feature.
For your import/export however, what error messages did you get while trying to move data from dbaseB to dbaseC? If it's the same... |
Forum: MS SQL Jan 9th, 2007 |
| Replies: 3 Views: 8,872 I think you're better off avoiding cursors where possible! It's much slower than a straight up statement, such as:
select name,
substring(name,1,charindex(' ', actor_name)-1) FirstName,
... |
Forum: MS SQL Dec 16th, 2006 |
| Replies: 3 Views: 4,117 have a look at the sp_executesql (or is it sp_execute -- can't remember). with this method, you build your string in SQL, then execute it with the SP above. BOL should have more info and examples |
Forum: MS SQL Dec 9th, 2006 |
| Replies: 3 Views: 3,309 Valid theoretical question (I think it will error with overflow), but do you practically think you'll get there? bigint can go up to 9,223,372,036,854,775,807
That's pretty big... Just to try and... |
Forum: MS SQL Dec 9th, 2006 |
| Replies: 5 Views: 19,468 Are all the values in the column like 000000001? Because you could just do field+0 that would implicitly convert it... or cast(field as int) to explicitly do it. if you have mixed fields, then you... |
Forum: MS SQL Dec 9th, 2006 |
| Replies: 1 Views: 1,631 see DBCC CHECKTABLE in BOL for more info... be careful about the repair, as it could invalidate.. but it should fix the table even if some of the data might be lost. Good luck! |
Forum: MS SQL Dec 6th, 2006 |
| Replies: 5 Views: 19,468 CASE is used when you want to return different values based on different conditions, such as:
select case when priority=1 then 'Low' when priority=2 then 'Med' when priority=3 then 'High' end from... |
Forum: MS SQL Dec 4th, 2006 |
| Replies: 3 Views: 2,651 aah.. i keep on missing the "desc" in the order by, but that should be easy enough to figure out :)
select top 3 d1.num num1, d2.num num2
from data d1 inner join data d2 on (d1.date=d2.date) and... |
Forum: MS SQL Dec 3rd, 2006 |
| Replies: 3 Views: 2,651 actually, no need for the distinct count.. :
select top 3 d1.num num1, d2.num num2
from data d1 inner join data d2 on (d1.date=d2.date) and (d1.num<d2.num)
group by d1.num, d2.num
having... |
Forum: MS SQL Dec 3rd, 2006 |
| Replies: 3 Views: 2,651 My approach would be something like the following, assuming the second data structure. (It's untested)
select top 3 d1.num num1, d2.num num2
from data d1 inner join data d2 on (d1.date=d2.date)... |
Forum: MS SQL Nov 18th, 2006 |
| Replies: 1 Views: 2,313 Is "SQL Active Directory" performing certificate verification against crl.microsoft.com? I had an issue with other components of SQL Server 2005 wanting to check revocation of certificate against... |
Forum: MS SQL Nov 17th, 2006 |
| Replies: 4 Views: 2,428 Yup, that's correct, color is the "physical" name of the column. |
Forum: MS SQL Nov 16th, 2006 |
| Replies: 4 Views: 2,428 Well, the bad way would be to do something like:
select case color when 0 then 'black' when 1 then 'white' when 2 then 'red' when 4 then 'blue' end as color from myTable
ideally, you would... |
Forum: MS SQL Nov 16th, 2006 |
| Replies: 1 Views: 10,123 I don't have my sql server readily available, but you could use the "create trigger" command, then use the logical tables "inserted" and "deleted" (which represent what is and what was, respectively)... |
Forum: MS SQL Nov 13th, 2006 |
| Replies: 2 Views: 4,809 If the user running the query has rights to select the table in the other database, you will be able to. the syntax is something like:
select * from tableA join otherDB.dbowner.tableB on... |
Forum: MS SQL Oct 19th, 2006 |
| Replies: 2 Views: 4,969 How are you moving the data? Through SQL statements? Through the EM Import Wizard?
Anyhow, the answer is enabling "identity insert" in your target table B. This option can only be active for one... |