Viewing 15 posts - 61 through 75 (of 443 total)
Try using the following Changed Code;
declare @db varchar(100),
@dbid int,
@hidb int,
@sql as varChar(500)
set @hidb = (select max(dbid) from master..sysdatabases)
set @dbid = 0
While @dbid <= @hidb
Begin
set @db = (select name...
May 28, 2010 at 4:25 am
How about writing a function as;
-- ================================================
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:Atif Sheikh
-- Create date: 28-05-2010
-- Description:Trim Non Alpha Characters
-- =============================================
ALTER FUNCTION fnTrimNonAlphaCharacters
(
@pString varchar(max)
)
RETURNS varchar(max)
AS
BEGIN
Declare @vTable Table (Ch Char(1))
Declare...
May 28, 2010 at 3:44 am
Glad it helped you.:-)
Please be sure to specify the test data yourself when you post any other question. It really helps to find quick and better answer.
May 28, 2010 at 3:12 am
Its wrong design but Why not?
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Table1](
[PKID] [int] NOT NULL,
[FKID] [int] NULL,
CONSTRAINT [PK_Table1] PRIMARY KEY CLUSTERED
(
[PKID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY =...
May 27, 2010 at 6:13 am
Try RPC Completed.
It will Give You sp_executesql 'INSERT ...'
And sp_executesql 'INSERT ...'
May 27, 2010 at 6:01 am
Kingston Dhasian (5/27/2010)
A LEFT OUTER JOIN with the same table again will give you the desired result
SELECTEmp.Emp_Name, Sup.Emp_Name Sup_Name
FROMEmployee Emp
LEFT OUTER JOINEmployee Sup ONEmp.Supervisor_ID = Sup.Emp_ID
Looking at the data in...
May 27, 2010 at 5:39 am
For checking the flow of T-SQL code in SSMS, PRINT statement is fine. For debugging, another option is RAISERROR. You can check the details @ http://www.sqlservercentral.com/articles/SQL+Puzzles/quickhintsforusingtheraiserrorcommand/2114/
And also @ http://msdn.microsoft.com/en-us/library/ms178592.aspx
May 27, 2010 at 5:35 am
Gopi Muluka (5/24/2010)
you may want to look at "SYS.PARAMETERS"
In SYS.PARAMETERS, we do have Has_Default_Value bit and Default _Value column. But these are related to the CLR objects. http://msdn.microsoft.com/en-us/library/ms176074.aspx
May 24, 2010 at 4:30 am
lmu92 (5/24/2010)
May 24, 2010 at 4:29 am
Anamika (5/21/2010)
Hi,Thanks for the inputs. both are working fine
thanks,
regards,
Ami
If the comma separated list is as long as 1000s of list items, it would be better to with tally table solution....
May 21, 2010 at 6:12 am
You can see it in the Execution Plan.
May 20, 2010 at 10:59 pm
CirquedeSQLeil (5/20/2010)
Atif Sheikh (5/20/2010)
Dynamic SQL is the last thing to do.
Sometimes Dynamic SQL is quite useful. There are alternatives to using case statements or dynamic sql (such as...
May 20, 2010 at 10:46 pm
vk-kirov (5/19/2010)
Kari Suresh (5/19/2010)
where and how we can use this? Anybody can explain with an example?
For example, it may be very useful when a big transaction rolls back and you...
May 20, 2010 at 10:37 pm
ziangij (5/17/2010)
Atif Sheikh (5/17/2010)
Even without selecting Table Designer from Tool bars, right click the workspace of Table design screen and select 'Generate Change Script ...'. 🙂
thanks 🙂 didn't know about...
May 20, 2010 at 10:26 pm
Viewing 15 posts - 61 through 75 (of 443 total)