Viewing 15 posts - 391 through 405 (of 921 total)
CREATE PROC p_TopDrugs @Rows int AS
SET NOCOUNT ON
SET ROWCOUNT @Rows
SELECT Drug_Name, COUNT(*)
FROM Orders
GROUP BY Drug_Name
ORDER BY COUNT(*) DESC
--Jonathan
December 4, 2003 at 7:02 am
quote:
Have you thought about Multiple Words in table names Like Order Details
🙂
November 26, 2003 at 10:44 am
DECLARE @sql varchar(200)
CREATE TABLE #t(db sysname, own sysname, tab sysname, Col sysname, Seq tinyint, PKName sysname)
SET @sql = PARSENAME(@TableName,3) + '.dbo.sp_pkeys ' + PARSENAME(@TableName,1) + ','...
November 26, 2003 at 8:59 am
quote:
After every full backup I automatically run these 2 commands to reclaim the space the TLog has allocated:backup log DBName with truncate_only
DBCC...
November 26, 2003 at 8:01 am
Yes, every edition other than MSDE comes with the GUI utilities.
--Jonathan
November 26, 2003 at 5:44 am
You can use DMO to script out creation scripts for database objects. There are a myriad of ways to get the data into a local file, from passing it...
November 26, 2003 at 5:41 am
Sybase had TOP (and a synonym, FIRST) the last time I used it, several years ago. It did not have PERCENT or WITH TIES options, though.
--Jonathan
November 26, 2003 at 5:34 am
In ADO you've got the Number, SQLState, and NativeError properties of each error object. I typically use the SQLState when testing expected conditions in an error handling routine, as...
November 26, 2003 at 5:20 am
You're treating TEXTPTR() as static and it's not. Try this:
DECLARE @TextPointer varbinary(16)
DECLARE @ReplaceStr varchar(8000)
DECLARE @SearchStr varchar(8000)
DECLARE @DeleteLength int
DECLARE @OffSet int
SET @SearchStr = 'XXXX'
SET @ReplaceStr...
November 25, 2003 at 2:02 pm
As you're wanting to truncate rather than round, I think cmore means:
SELECT ROUND(1,-2,1)*ROUND(b,-2,1)
If the vales are an integer data type, you could also just do something...
November 25, 2003 at 1:37 pm
Sorry; duplicate post. "Delete reply" still nonfunctional.
Edited by - Jonathan on 11/25/2003 1:44:33 PM
November 25, 2003 at 1:29 pm
EXEC master..xp_regread 'HKEY_LOCAL_MACHINE','Software\Microsoft\MSSQLServer\MSSQLServer','Backupdirectory'
--Jonathan
November 25, 2003 at 1:21 pm
As there are no table constraints other than PRIMARY KEY and FOREIGN KEY in SQL Server, I presume you mean a column CHECK constraint.
CREATE FUNCTION dbo.CntUser(@userid...
November 25, 2003 at 11:02 am
quote:
Will running transaction log backups every two hours WITH INIT, NOSKIP keep the transaction from growing too large?
November 25, 2003 at 8:58 am
If you're using SQL Server 2000, this is easy with a User Defined Function (UDF), e.g.:
CREATE FUNCTION dbo.f_RemoveChars(@Input varchar(1000))
RETURNS varchar(1000) AS
BEGIN
DECLARE @pos smallint
SET @Pos = PATINDEX('%[^0-9]%',@Input)
WHILE...
November 25, 2003 at 7:02 am
Viewing 15 posts - 391 through 405 (of 921 total)