Viewing 15 posts - 61 through 75 (of 168 total)
If you are using SS 2005, this is another way using pivot
Create
table #testtbl (
Material
varchar(10
September 18, 2006 at 3:05 pm
Small version specific to Character to integer conversion
DECLARE @STR VARCHAR(100),
@VAL VARCHAR(10),
@L INT
SET @STR= '1,2,3,4,5,6,7,8,9,10,0'
DECLARE @tab TABLE (VAL INT)
WHILE DATALENGTH(@STR)>0
BEGIN
IF (DATALENGTH(@STR)=1 AND...
September 18, 2006 at 12:33 pm
Always use trim functions to avoid unpredicted results while dealing with Character Datatypes
September 18, 2006 at 11:53 am
small variation
CREATE
TABLE #TableName (ColumnName VARCHAR(100))
INSERT
#TableName VALUES
September 18, 2006 at 11:40 am
Give it a try
This script takes database names and table name as Input parameters and compares column names and data types if they are not matched it will display the...
September 15, 2006 at 6:28 pm
try with explicitly opening distributed transaction like this
BEGIN DISTRIBUTED TRANSACTION
-- see BOL for more details
September 15, 2006 at 1:59 pm
Return type should be sysname, It is the nvarchar(128) datatype used to store the object names in SQL Server
September 15, 2006 at 12:18 pm
try like this
DECLARE @UseIt1 varchar(100),
@WorkQueue varchar(100)
EXEC ('SELECT A.AcctNo ' +
'FROM QueueOrderExcessDol A ' +
' INNER JOIN _FinalFlat B
ON A.AcctNo = B.AcctNo
INNER JOIN QueueComboBox D
ON B.WorkQueue = D.ProgramKeyField
WHERE B.Tagged = 0
AND...
September 14, 2006 at 6:45 pm
you can use Left function also, but it won't accept ntext datatype,
you have to explicitly convert the datatype to character types
September 14, 2006 at 6:14 pm
This is because you may have one of the column with text datatype
try converting text to varchar datatype
select convert(varchar,textcol)+char(13)+' Right' from tab
September 14, 2006 at 12:52 pm
Its exactly what Jun wanted
September 14, 2006 at 12:13 pm
you can replace the select statement for cursor with this
select
o.name as tab ,i.
September 14, 2006 at 11:31 am
These are the SQL Server generated statistics for the tables. Statistics generated tables will have a row in sysindexes table
September 13, 2006 at 4:34 pm
you can register the server with the machine name itself (If it is having a default Instance)
In the local EM local DB Server will be visible as localhost only
hope this...
September 13, 2006 at 4:03 pm
Use this procedure to delete all non clustered indexes in the database
Create procedure dropIndex as
Begin
declare @tab sysname,
@idx sysname,
@sql nvarchar(4000)
declare cur cursor for
select o.name as tab ,i.name as idx...
September 13, 2006 at 3:23 pm
Viewing 15 posts - 61 through 75 (of 168 total)