|
|
Seconded. SQL Compare is very good.
|
|
|
|
|
CREATE PROCEDURE [dbo].[spa]
@a image
AS
insert into a(a) values(@a)
GO
table
column name = a
datatype = image
p[0] = objclsdb.Parameter("@a", DbType.Byte, buffer, ParameterDirection.Input);
The above code is right to insert the image in sql server 2000?
|
|
|
|
|
It looks okay. Does it work?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
Hi
how to install sqsh[^] on Windows after cygwin installed? In fact where do you even download[^] binary for Windows?
Thanks!
devy
|
|
|
|
|
Hello Everyone,
I am new to code project. Recently i had downloaded and installed oracle 9. but i could not be able to log on to sql plus. it displays the error "could not resolve service name"(error tns:12154). i went through several lot links online and tried to resolve. but none of them work. i had created the new port,checked the tnsnames.ora file, updated the necessary information from the net manager option. i am really worried about my problem. could anyone please help me regarding this. I appreciate your help.
|
|
|
|
|
You might want to look on the Oracle forums.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
I'm starting out with database programming in C# (using System.Data.Odbc). I have an SQL command, using the UPDATE command. I'm trying to update a memo field (in an .mdb file) with contents that have multiple lines of text. However, I keep getting an error. I can see what the error is saying (that it doesn't like me starting a line without an SQL command). How do I modify the following example so that it will work?
UPDATE mytable
SET pagecontents = 'first line of text
second line of text
third line of text'
WHERE id = 3
The error basically says:
ERROR [42000] [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression "second line of text
thirdline of text'
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
Basically, I need to find out how to put multiple lines of text into a memo field. The text may or may not have apostrophes, quotes, backslashes, and other characters that usually require special treatment in other circumstances.
Anyone?
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
Nevermind, I found it myself. I'm using an OdbcCommand object with an OdbcParameter.
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
Good Evening All
i want to Create a Procedure that will update the "locked" Field with "1" when it find some records that are null in a "Locked", based on a Parameter. Here is the Query that select records where Field "locked" is Null based on a parameter i have named "@lis_key".
SELECT Primary_ID, Boundary_area, Attrib_Code, Lis_Key, Func_Key, Actual_Extent,
Improved_Value, Site_Value, Purchase_price, Purchase_date, prop_id,
confidence_score, fin_ls_prediction, new_lis_key, new_func_key,
Tshwane_Prediction, matchflag, source, flagtype,
Locked FROM Property_mass WHERE (SUBSTRING(Lis_Key, 1, 4) = @Lis_key)
AND (Locked IS NULL)
i have tried the following but did not finish and not know which way to go, am still researching,
Create Procedure sp_Lock_Select
(
@Lis_key varchar(34)
)
as
SELECT Primary_ID, Boundary_area, Attrib_Code, Lis_Key, Func_Key, Actual_Extent,
Improved_Value, Site_Value, Purchase_price, Purchase_date, prop_id,
confidence_score, fin_ls_prediction, new_lis_key, new_func_key,
Tshwane_Prediction, matchflag, source, flagtype,
Locked FROM Property_mass WHERE (SUBSTRING(Lis_Key, 1, 4) = @Lis_key)
AND (Locked IS NULL)
Update Property_Mass
set Locked = 1
where (above selected Records)
PLease help
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
hi All
while looking for Answers , i came across this and it seemed to work if i test the Procudure,
Create Procedure sp_Lock_Select
(
@Lis_key varchar(34)
)
as
if Exists(
SELECT Primary_ID, Boundary_area, Attrib_Code, Lis_Key, Func_Key, Actual_Extent,
Improved_Value, Site_Value, Purchase_price, Purchase_date, prop_id,
confidence_score, fin_ls_prediction, new_lis_key, new_func_key,
Tshwane_Prediction, matchflag, source, flagtype,
Locked FROM Property_mass WHERE (SUBSTRING(Lis_Key, 1, 4) = @Lis_key)
AND (Locked IS NULL)
)
Update Property_Mass
set Locked = 1
WHERE (SUBSTRING(Lis_Key, 1, 4) = @Lis_key And Locked IS NULL)
Am using the same searching Criteria of searching, because it will look for the same records that it had been found and update them.
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Hi All
Now Here is another Challenge, the above query is for select and lock the selected. now i have a challenge that is beyond my experience,because i used to depends on VS wizards to do it for me, now i have come out of the closet to code my way out. am trying to update a Datagrid from a Prodecure in vb.net, here is my Procedure and am open for advice.
create Procedure Update_And_UnLock
(
@Tshwane_Prediction float ,
@Primary_ID int
)
as
Update Property_Mass
set Tshwane_Prediction = @Tshwane_Prediction
where Primary_ID = @Primary_ID
Helps, how can i do that, i will keep on loking for answers while, am waiting for your advices.
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
how a multiple row can be assigned to the out parameter of a stored procedure
|
|
|
|
|
I don't think this is possible. However you could return a resultset from your stored procedure that contains the information.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hi
does any1 know how to copy sql database.
I need to make another version of the database for test purposes
thanks
|
|
|
|
|
Take a backup and restore it to a new database...
You can do this form SQL Server Management Studio For MS SQL Server/MS SQL Server Express, from Enterprise Manager for MS SQL Server 2000 and 7.0.
From Query Analyzer, SQLCMD or other sql tools; lookup BACKUP (T-SQL) and RESTORE (T-SQL) in books online or Google.
|
|
|
|
|
Hi,
Open Sql Server 2000 Enterprise Manager Select Your DataBase Right Click on that there is an option Under All Tasks->BackUp DataBase->In Destination Path Give The Location Where u want to store that database back up.
After that Click Ok.
Then Restore this database backup where ever you want.
For that Just create one database Right Click on that Select
All Tasks->Select Restore Database,Select From Device It will ask the
location there u specify ur DataBase Backup Name Click Ok.
Regard's
Veeresh
i want to join this group
|
|
|
|
|
Hi,
Open Sql Server 2000 Enterprise Manager Select Your data base Right Click on that there is an option Under All Tasks->BackUp data base->In Destination Path Give The Location Where u want to store that database back up.
After that Click Ok.
Then Restore this database backup where ever you want.
For that Just create one database Right Click on that Select
All Tasks->Select Restore Database,Select From Device It will ask the
location there u specify ur DataBase Backup Name Click Ok.
Regard's
Veeresh
i want to join this group
|
|
|
|
|
Hi
SQL Profiler for Sybase?
Thanks!
devy
|
|
|
|
|
How do I enumerate tables in a given database? I remember you need to open a cursor to a system table...?
Thanks
devy
|
|
|
|
|
|
I created a very simple app to better understand LINQ and WPF, I'm using the Northwind db and the table Employee. In the code behind for the window in the constructor I have the following code.
public Window1()
{
InitializeComponent();
dc = new NorthWindDataContext();
this.DataContext = dc.Employees;
}
In the XAML file a have a combobox that lists each record in the table, there are also four Textbox fields, a New and a Save button, the app runs OK, I can make changes to existing records OK, but I don't understand how to add new records. I would like to be able to click the New button, the textboxes clear allowing me to enter new data, I click the Save button and the record is written to the db.
How would I do this ?
|
|
|
|
|
Hi,
I have a two medium sized tables, one containing 2.000.000 cities, and one containing localized names for part of these cities in sofar 3 languages ( about 3.000.000 records)
When users look for a city the following query is basically being used:
SELECT TOP 10 COALESCE(Cities_Localized.[Name], Cities.[Name])
FROM Cities
LEFT JOIN Cities_Localized ON Cities.CityID = Cities_Localized.CityID AND
Cities_Localized.Language = 'en-US'
WHERE Cities.[Name] LIKE 'T%' OR --where T is the first letter of some city
Cities_Localized.[Name] LIKE 'T%'
ORDER BY COALESCE(Cities_Localized.[Name], Cities.[Name])
This is of course an abstracted version, but it deals with the basic problem. This query takes a long time. Especially the sorting. Does anyone have a few tips on how to make this query faster?
Thanks,
Gidon
|
|
|
|
|
COALESCE is built to handle numerous elements. You are only using two so ISNULL(Cities_Localized.[Name], Cities.[Name]) might be a bit faster (maybe not?).
I assume you already have an index on [Name] in both tables to handle the LIKE comparisons.
The next thing I would try is a temporary table so that the NULL testing is only done once. I am assuming you are using SQL server.
DECLARE @tmp TABLE
(
CityName NVARCHAR(200)
)
INSERT INTO @tmp (CityName)
SELECT TOP 10
ISNULL(Cities_Localized.[Name], Cities.[Name])
FROM
Cities
LEFT JOIN
Cities_Localized
ON (Cities.CityID = Cities_Localized.CityID) AND
(Cities_Localized.Language = 'en-US')
WHERE
Cities.[Name] LIKE 'T%' OR
Cities_Localized.[Name] LIKE 'T%'
SELECT
CityName
FROM
@tmp
ORDER BY
CityName
You can also try a UNION query and see if it is any faster.
SELECT
[Name] AS CityName
FROM
Cities
WHERE
[Name] LIKE 'T%'
UNION
SELECT
[Name]
FROM
Cities_Localized
WHERE
Cities_Localized.Language = 'en-US' AND
Cities_Localized.[Name] LIKE 'T%'
ORDER BY
CityName
If none of those resulted in a fast enough query, I would develop a table that contained all city names (normal and localized) with a Foreign Key back to the City table.
|
|
|
|
|