|
Hello:
I am now creating an excel file using xslt.However, when there is a blank or a special char in one of my headers, i've got an invalid xpath expression which throw an exception.
what can i do ?
thx
|
|
|
|
|
create a stored porc and i want to send numeric value with parameter how can i do this
create porc test @num int
as
select * from table1 where id in (@num)
i am not use where caluse because i want to send like 1,2,3,4 at the single query
Pls help
vipin paliwal
vipin paliwal
|
|
|
|
|
CREATE PROCEDURE ProcName ( @WhereClause varchar(100) ) AS
-- Create a variable @SQLStatement
DECLARE @SQLStatement varchar(255)
-- Enter the dynamic SQL statement into the
-- variable @SQLStatement
SELECT @SQLStatement = 'select * from table1 where id in ' + @WhereClause
SET NOCOUNT ON
-- Execute the SQL statement
EXEC(@SQLStatement)
SET NOCOUNT OFF
END
Navi
|
|
|
|
|
i create a stored porc and i want to send numeric value with parameter how can i do this
create porc test @num int
as
select * from table1 where id in (@num)
i am not use where caluse because i want to send like 1,2,3,4 at the single query
Pls help
vipin paliwal
-- modified at 3:25 Thursday 24th August, 2006
|
|
|
|
|
create porc - a good start
calus - we can be. Very.
Suggest you post this in the correct forum.
Regards
Malc
*********************************************
|
|
|
|
|
create porc test @num varchar(100)
as
--Set @num='1,2,3,4,5'
Exec('
select * from table1 where id in ('+@num+')
|
|
|
|
|
You're a disgrace.
As another 26 years old, I feel ashamed that you, sir, cannot comprehend the bold, red text saying "Please do NOT post programming questions or ads to this forum." when typing your question at The Lounge.
Aside from that, your text-speak allows me to think of you as someone with lower than average intelligence, lazy, and inconsiderate of others in this community.
Please refrain from further posting until you understand the nettiquete and can write properly.
"A democracy is nothing more than mob rule, where fifty-one percent of the people may take away the rights of the other forty-nine." - Thomas Jefferson
"Democracy is two wolves and a lamb voting on what to have for lunch. Liberty is a well-armed lamb contesting the vote." - Benjamin Franklin
Edbert
Sydney, Australia
|
|
|
|
|
S'funny. At the top of this forum, it says "SQL / ADO / ADO.NET"...
or has this been moved from the lounge? (I didn't know you could do that)
Steve S
Developer for hire
|
|
|
|
|
Steve S wrote: or has this been moved from the lounge? (I didn't know you could do that)
Yeah, it's been moved from the Lounge. A visual indication would be nice though.
|
|
|
|
|
so,
any body give me answer .
vipin paliwal
|
|
|
|
|
CREATE PROCEDURE Test(@num int) AS
select * from table1 where id = @num
Best Regards,
Apurva Kaushal
|
|
|
|
|
hi all
can anyone tell me how to delete the duplicate records from the table..like
kitty
nikki
asha
manju
asha
kiran
Here i want to delete duplicate record "asha", both using SQL query and using Cursor.
Thanks in advance
regards
kitty
|
|
|
|
|
U can't delete single record when it contains its duplicate or u need its id to delete record.
U can't delete single 'asha' using query. Suppose 'asha' is under 'FNAME' column of 'testtable'
----delete testtable where FNAME='asha'
Above query will delete both records from ur testtable
To delete single record, table should contain id with respect record
-- modified at 2:54 Thursday 24th August, 2006
Balasaheb
Software Developer
Platform: Asp.net,vb.net
Database: SQL Server 2000
|
|
|
|
|
no we can delete duplicate row using cursor and query..but i dont know how exactly..
|
|
|
|
|
May I know On which database ur working?, because it is possible in Oracle 9i using rowid, as per my knowledge it is not possible to delete single duplicate record in sql server 2000.
Balasaheb
Software Developer
Platform: Asp.net,vb.net
Database: SQL Server 2000
|
|
|
|
|
SQL Server
Deleting Rows in Result Sets[^]
But, that will probably not work because:
Before a cursor can be used by a positioned UPDATE or DELETE statement, the SELECT statement in the cursor declaration must contain the FOR BROWSE option. (The Microsoft SQL Server 2000 FOR BROWSE option is similar to the FOR UPDATE option in other SQL databases, but you must use SQL Server syntax.) To use the FOR BROWSE option, the table must have both a unique index and a timestamp column.
You could do this:
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_MyTestingTable
(
TestCol varchar(50) NULL
) ON [PRIMARY]
INSERT INTO dbo.Tmp_MyTestingTable (TestCol)
SELECT DISTINCT TestCol FROM dbo.MyTestingTable TABLOCKX
DROP TABLE dbo.MyTestingTable
EXECUTE sp_rename 'dbo.Tmp_MyTestingTable', 'MyTestingTable'
COMMIT
-----------------------------
LATER NOTE: I tried the cursor anyway...and it DOES work.
DECLARE @cCol varchar(50)
DECLARE MyCursor CURSOR FOR
SELECT testcol
FROM MyTestingTable
OPEN MyCursor
FETCH NEXT FROM MyCursor INTO @cCol
WHILE @@FETCH_STATUS = 0
BEGIN
if(SELECT COUNT(*) FROM MyTestingTable WHERE TestCol = @cCol)>1
BEGIN
DELETE FROM MyTestingTable
WHERE CURRENT OF MyCursor
END
FETCH NEXT FROM MyCursor INTO @cCol
END
CLOSE MyCursor
DEALLOCATE MyCursor
GO
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
There has to be a unique ID (referential Intergrity 101) for you be able to delete the name. Otherwise with a general delete syntax you will delete all instances of the name. Hope this helps.
PS: You may want to add an ID column to your table so you can identify the exact record you want to delete.
Greg
Coding makes the world go round!!!
|
|
|
|
|
I am trying to install SQL 2005 Express edition on Windows XP, with VS.NET 2003, with .NET framework 2.0. When installing, i am getting following error logged on the error log file:
Microsoft SQL Server 2005 Setup beginning at Tue Aug 22 18:30:08 2006
Process ID : 1896
c:\10394006888baccbee\setup.exe Version: 2005.90.1399.0
Running: LoadResourcesAction at: 2006/7/22 18:30:8
Complete: LoadResourcesAction at: 2006/7/22 18:30:8, returned true
Running: ParseBootstrapOptionsAction at: 2006/7/22 18:30:8
Loaded DLL:c:\10394006888baccbee\xmlrw.dll Version:2.0.3604.0
Complete: ParseBootstrapOptionsAction at: 2006/7/22 18:30:8, returned false
Error: Action "ParseBootstrapOptionsAction" failed during execution. Error information reported during run:
Could not parse command line due to datastore exception.
Source File Name: utillib\persisthelpers.cpp
Compiler Timestamp: Fri Jul 29 01:13:55 2005
Function Name: writeEncryptedString
Source Line Number: 124
----------------------------------------------------------
writeEncryptedString() failed
Source File Name: utillib\persisthelpers.cpp
Compiler Timestamp: Fri Jul 29 01:13:55 2005
Function Name: writeEncryptedString
Source Line Number: 123
----------------------------------------------------------
Error Code: 0x80070002 (2)
Windows Error Text: The system cannot find the file specified.
Source File Name: cryptohelper\cryptsameusersamemachine.cpp
Compiler Timestamp: Mon Jun 13 14:30:00 2005
Function Name: sqls::CryptSameUserSameMachine::ProtectData
Source Line Number: 50
2
Could not skip Component update due to datastore exception.
Source File Name: datastore\cachedpropertycollection.cpp
Compiler Timestamp: Fri Jul 29 01:13:49 2005
Function Name: CachedPropertyCollection::findProperty
Source Line Number: 130
----------------------------------------------------------
Failed to find property "InstallMediaPath" {"SetupBootstrapOptionsScope", "", "1896"} in cache
Source File Name: datastore\propertycollection.cpp
Compiler Timestamp: Fri Jul 29 01:13:50 2005
Function Name: SetupBootstrapOptionsScope.InstallMediaPath
Source Line Number: 44
----------------------------------------------------------
No collector registered for scope: "SetupBootstrapOptionsScope"
Running: ValidateWinNTAction at: 2006/7/22 18:30:8
Complete: ValidateWinNTAction at: 2006/7/22 18:30:8, returned true
Running: ValidateMinOSAction at: 2006/7/22 18:30:8
Complete: ValidateMinOSAction at: 2006/7/22 18:30:8, returned true
Running: PerformSCCAction at: 2006/7/22 18:30:8
Complete: PerformSCCAction at: 2006/7/22 18:30:8, returned true
Running: ActivateLoggingAction at: 2006/7/22 18:30:8
Error: Action "ActivateLoggingAction" threw an exception during execution. Error information reported during run:
Datastore exception while trying to write logging properties.
Source File Name: datastore\cachedpropertycollection.cpp
Compiler Timestamp: Fri Jul 29 01:13:49 2005
Function Name: CachedPropertyCollection::findProperty
Source Line Number: 130
----------------------------------------------------------
Failed to find property "primaryLogFiles" {"SetupStateScope", "", ""} in cache
Source File Name: datastore\propertycollection.cpp
Compiler Timestamp: Fri Jul 29 01:13:50 2005
Function Name: SetupStateScope.primaryLogFiles
Source Line Number: 44
----------------------------------------------------------
No collector registered for scope: "SetupStateScope"
00DCCFC4Unable to proceed with setup, there was a command line parsing error. : 2
Error Code: 0x80070002 (2)
Windows Error Text: The system cannot find the file specified.
Source File Name: datastore\propertycollection.cpp
Compiler Timestamp: Fri Jul 29 01:13:50 2005
Function Name: SetupBootstrapOptionsScope.InstallMediaPath
Source Line Number: 44
Class not registered.
Failed to create CAB file due to datastore exception
Source File Name: datastore\cachedpropertycollection.cpp
Compiler Timestamp: Fri Jul 29 01:13:49 2005
Function Name: CachedPropertyCollection::findProperty
Source Line Number: 130
----------------------------------------------------------
Failed to find property "HostSetup" {"SetupBootstrapOptionsScope", "", "1896"} in cache
Source File Name: datastore\propertycollection.cpp
Compiler Timestamp: Fri Jul 29 01:13:50 2005
Function Name: SetupBootstrapOptionsScope.HostSetup
Source Line Number: 44
----------------------------------------------------------
No collector registered for scope: "SetupBootstrapOptionsScope"
Message pump returning: 2
Any help would be greatly appreciated.
Shafik
|
|
|
|
|
Do you or have you had installed any beta or evalution versions of this software?
When was the last time you poured some wine for you and your sweetie and went out on the front porch to watch the geometry frolic on the lake?--Rebecca M. Riordan, Designing Effective Database Systems
|
|
|
|
|
I had installed this about six months ago, and had problems, so i uninstalled using Add/Remove programs. Then i installed MSDE 2000. Two weeks ago i had problem with VS.NET 2003, and so i uninstalled Visual Studio, and MSDE. I have re-installed VS, but would like to give SQL 2005 Express another try. I think that i have removed everything with SQL using Add/Remove programs. Now when installing SQL 2005, i started getting this error now.
Any assistance is appreciated.
Shafik
|
|
|
|
|
Due to format like below, we are not able to save this information in SQL server 2000
Migración Líneas 1&2
Above information is saved in SQL SERVER 2000 as
Migración sistema control Abelló Linde Alcalá
Can someone help me in this regard?
Thanks
Balasaheb
Software Developer
Platform: Asp.net,vb.net
Database: SQL Server 2000
|
|
|
|
|
Are you using nvarchar columns or just varchar ? I suspect you are using varchar and you would get it to work using nvarchar .
|
|
|
|
|
Thanks for ur reply
Yes I'm using Varchar in my table
still I would like to know, is there any way to convert such word in some proper format?
-- modified at 5:08 Thursday 24th August, 2006
Balasaheb
Software Developer
Platform: Asp.net,vb.net
Database: SQL Server 2000
|
|
|
|
|
BalasahebK wrote: Yes I'm using Varchar in my table
still I would like to know, is there any way to convert such word in some proper format?
So, did you try changing it to nvarchar ?
|
|
|
|
|
Your source data appears to be UTF-8. Varchar columns in SQL Server 2000 are Windows-1252 if you're using the Modern_Spanish or Mexican_Trad_Spanish collations.
Somewhere along the line, your UTF-8 data is being interpreted as Windows-1252. If you're using ADO or ADO.NET, all strings are internally Unicode (UTF-16) in the runtime, before being passed to the database, so you should check whatever process is passing the strings to ADO. For example, if reading from a file, you should check that the file is set to UTF-8 mode. Visual Basic 6.0 cannot do this - it always reads files using the thread's current code page.
Bulk Insert also does not understand UTF-8. You will have to preprocess your file into something it does understand, either Windows-1252 or UTF-16.
|
|
|
|