Viewing 15 posts - 721 through 735 (of 907 total)
Here is two examples that might help you decide how to handle this:
-- if 021002 (yymmdd) is October 2, 2002
select cast('021002' as datetime)
-- 021003 (ddmmyy) is October 2, 2003
select cast(substring('021003',5,2)...
October 1, 2002 at 9:01 am
What you want is to perform a pivot table fuction. There are some examples of doing pivot table queries on my website at http://www.geocities.com/sqlserverexamples/#pivot.
I think you will want to do...
October 1, 2002 at 8:50 am
This is straight from books online, but I think this explains your issue:
Naming multiple transactions in a series of nested transactions with a transaction name has little effect on the...
October 1, 2002 at 8:30 am
Comparing NULL always present problems. Think you might try something like this. Of course you will need to determine what you would like to set the "a" fields...
October 1, 2002 at 7:35 am
Great article, and an easy step to miss if you write backups locally. We have always been shipping our logs off to another server as the last step of...
September 30, 2002 at 1:51 pm
Think you want to use the convert function. Here try this:
create table date_test (sd smalldatetime)
insert into date_test values(getdate())
select convert(char(10),sd,101) from date_test
drop table date_test
Gregory Larsen, DBA
If you looking for SQL...
September 30, 2002 at 9:49 am
I'm not sure this is exactly what you are looking for, but you might try the -r option of osql.
Gregory Larsen, DBA
If you looking for SQL Server Examples check out...
September 29, 2002 at 8:35 am
I'm guessing something like this might do the trick:
select supplierid, productid,productname, unitprice
from products a where productid in (select top 3 productid
from Products
where supplierid=a.supplierid
order by SupplierID, UnitPrice desc )
order...
September 27, 2002 at 8:22 am
This one was a new one on me as well. Think we should all say "...Prakash, a real guru ... "
Gregory Larsen, DBA
If you looking for SQL Server Examples...
September 26, 2002 at 4:57 pm
Think of it this way:
The update command is only updating one records at a time. First it updates there first records. After updating the first record @Hellobye gets...
September 26, 2002 at 4:31 pm
Since youre table only contains one records this will work:
Declare @V1 <datatype for a, in table TblJunk)
Declare @V2 <database for b, in table TblJunk>
Select @v1 = a, @v2 =...
September 26, 2002 at 3:51 pm
Might try this:
declare @delete varchar(100)
declare @cmd varchar(100)
set @delete = 'db_dbk.sql'
set @cmd = 'exec master..xp_cmdshell ''del E:\backups\' + @delete + ''''
print @cmd
exec (@cmd)
Gregory Larsen, DBA
If you looking for SQL Server...
September 26, 2002 at 10:31 am
Now it make perfect sense. Your suggestion is a good one. Thank you for the answer, and the alternative method.
Gregory Larsen, DBA
If you looking for SQL Server Examples check...
September 26, 2002 at 9:51 am
James, I'm wondering about your statement "..maybe better.". In what cases is your suggestion better?
I did a little test with the table I created with my earlier...
September 26, 2002 at 8:47 am
Looks like RedGate might just to the trick, and create the schema correctly.
Gregory Larsen, DBA
If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples
September 26, 2002 at 7:34 am
Viewing 15 posts - 721 through 735 (of 907 total)