Viewing 10 posts - 586 through 595 (of 595 total)
SQL Server can provide the values you want using DatePart ( dy, <date> ).
Try these examples:
declare @date datetime
set @date = '1/1/2003'
SELECT Convert(varchar(3), DatePart(dy, @date)) + '-' + Convert(varchar(4), Year(@date))
set @date...
February 11, 2004 at 5:14 am
How about something like the following (note that it is easier to use 'less than the first of the next month' instead of trying to figure that last day of...
February 2, 2004 at 10:37 am
Here's an example. Note that I changed the cursor to retrieve the column name instead of using a separate SET.
drop table tbl1
drop table tbl2
drop table autoinc
go
create table tbl1...
January 28, 2004 at 6:27 am
Click the Hammer icon in the upper left corner of the window, then click Customize View from the menu. Make sure the the Toolbars checkbox is checked.
If that doesn't work, the...
January 24, 2004 at 8:41 am
Here's a link to the Microsoft KB article describing the procedure mentioned above:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;165918
January 22, 2004 at 6:53 am
If you don't care about resetting the rid values, I would just use something like:
(Assume table has two columns: rid int identity(1,1) and logtext text)
delete logs
where rid in (select top...
January 22, 2004 at 6:31 am
How about something like the following? For simplicity, I used integer keys and left out error checking in the stored procedure.
DROP TABLE cars
DROP PROCEDURE pSwapCarDetails
GO
CREATE TABLE cars
(
CARManuf int...
December 29, 2003 at 6:56 am
How about this:
DECLARE @STORE_ID VARCHAR (10), @BUSINESS_DATE DATETIME
SET @STORE_ID = ''
SET @BUSINESS_DATE = '06/30/2002'
IF @STORE_ID <> ''
BEGIN
SELECT STORE_ID,
BANK_CODE,
...
December 17, 2003 at 7:53 am
quote:
There is also a script here that can helphttp://www.sqlservercentral.com/scripts/contributions/26.asp
Steve,
I use SQL Server 2000, and that code doesn't work. For example,...
December 9, 2003 at 8:23 am
For this type of problem I typically use a UDF. The one I'm providing here will return a table for each record. If you are only using it for a...
December 3, 2003 at 10:48 am
Viewing 10 posts - 586 through 595 (of 595 total)