|
i want to update an image field of a record in SQL but i can not .
i must first delete the record and then insert it but i want to update the record.
please help
|
|
|
|
|
fix your code.
If you want more help, try posting some details of the code you're using, so we can look at it and try to help.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
You can learn the with content from the new SQL Server 2008 Jumpstart event. The site contains presentations, recordings, hands-on labs and demonstrations for the SQL Server 2008 JumpStart technical training event.
There are five tracks:
The online material includes presentations, videos, hands on labs and manuals, recorded webcasts, and the SQL Server 2008 Virtual PC used for the labs.
You'll be asked to register if you want to access the training material from the event. All the resources you need for testing your application on SQL Server can be downloaded from the Application Compatibility & Upgrade Track page.
If you are conducting Application Compatibility testing, remember to sign-in with your Windows LiveID and report your results through the SQL Server App Compat Testing Results Survey. If you encountered bugs with any of the product features, submit feedback to the SQL Server Engineering team so we can fix it. For online support go to the App Compat and Upgrade forum.
|
|
|
|
|
Hi all,
I am getting an 'incorrect syntax near StoredProcName' error on debugging the beginings of my web app.
I know the sql syntax is correct as I have tested it in management studio express(2005) annd it returns exactly what I expect. The error is only occuring when calling from my page.
Here's my page code followed by a very simplified stored procedure(I know my complex one will return the correct result and this has the same error).
Page code:
SqlConnection conn = new SqlConnection(connString);
string sPName = "getProjectProModules2";
SqlCommand cmd = new SqlCommand(sPName, conn);
SqlParameter par1 = new SqlParameter("@modCount", SqlDbType.Int);
par1.Direction = ParameterDirection.Output;
par1.Size = 1;
cmd.Parameters.Add(par1);
SqlParameter par2 = new SqlParameter("@singleModule", SqlDbType.VarChar);
par2.Direction = ParameterDirection.Output;
par2.Size = 20;
cmd.Parameters.Add(par2);
conn.Open();
SqlDataReader recaffected;
try
{
recaffected = cmd.ExecuteReader();
if (recaffected.HasRows)
{
int i = 0;
while (recaffected.Read())
{
if (i == 0)
{
string countStr = cmd.Parameters["@modCount"].Value.ToString();
count = Convert.ToInt16(countStr);
}
moduleList[i] = cmd.Parameters["@singleModule"].Value.ToString();
i++;
}
recaffected.Close();
recaffected.Dispose();
return moduleList;
}
else
{
moduleList[0] = "No Modules";
return moduleList;
}
}
catch (Exception ex)
{
moduleList[0] = ex.Message.ToString();
moduleList[1] = ex.Data.ToString();
moduleList[2] = ex.Source.ToString();
return moduleList;
}
finally
{
conn.Close();
conn.Dispose();
}
SP Code:
ALTER PROCEDURE dbo.getProjectProModules2
@modCount int OUTPUT, @singleModule varchar(50) OUTPUT
AS
select '1'
RETURN
If I don't put the parameter size in my page code, it errors saying invalid parameter size.
Really not sure whats going wrong, I've looked up the code all over the place and from what i can see I'm doing it right. Anyone have any idea what the problem is?
Thanks in advance.
Mark
OK, fixed that error for those interested, I was not setting the command type to be StoredProcedure. However, I only seem to be able to return null as my parameter values. Still if there's any suggestions I would appreciate it.
modified on Tuesday, May 27, 2008 5:41 PM
|
|
|
|
|
To return parameters, you create local variables and pass them to the parameters, from memory.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
OK, so I have created 2 local variables, 1 int and 1 string, these I am passing to the paramater as the value,
I.E.
string singleModuleStr = "";
int countInt = 0;
--it doesn't like me not assigning them....
.....
par1.value = countInt;
.....
par2.value = singleModuleStr;
do i then assign the par2.value etc to these variables at recAffected.Read()?
Don't want to sound dumb but I'm used to just returning a select list and I want to be able to do it each possible way to broaden my knowledge.
Thanks for the help so far.
mark
|
|
|
|
|
Hey there,
I'm having a little issue with a query. Basically I'm trying to do some paging. There's many ways to do it, I know, but what I came up with was this:
SELECT TOP 10 columnA, columnB
FROM table
WHERE columnA not in (
SELECT TOP 21190 columnA
FROM table
ORDER BY columnC DESC)
ORDER BY columnC DESC
Some notes about it:
columnA is the key
columnD, columnC and columnA are index1
columnD and columnA are index2
columnC is index3.
In SELECT TOP 21190, that number is pageNumber * pageSize
Now... it seems that the very last 'ORDER BY columnC DESC'is the problem. Like it is the query takes around 1 minute to run. If I take that line out, the query runs in less than a second. Or, if I change the ORDER BY to be done by columnA, it also runs in less than a second.
Any ideas?
|
|
|
|
|
You need to do an order ASC in one of those queries for this to work. Then you don't need the 'not in', which is your problem. Select in desc order, ending with the first record you want. Then select in your outer query the number you want, in ASC order.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi, I want to debug a stored proc on our server but the database contains close to 30k stored procs. So when I press the expand button on the server explorer pane I have to wait for at least 30 minutes before VS unfreezes... This is getting quite annoying...
Out of these 30k stored proces around 95% are useless to me so I would like to filter them by their names.
All the ones I don't want start with 'zDP_'.
Do you know if there is a way to apply a filter before pressing the +?
Alternatively, is there another tool I could use to debug my stored procs?
We are running SQL Server 2005.
Thanks
Fred
modified on Tuesday, May 27, 2008 12:30 PM
|
|
|
|
|
hi everybody
I created a website with SQL express database in server explorer, everything is going just fine and now I want to upload the site and the database to the internet so that my customer can test it.
The server on which I want to upload my site to requires me to upload a .mdf file to the server, I searched my computer for the mdf file but I couldn't find it.
Any help please?
Thanks
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
we have a database publishing wizard to do so search google and download it
If You win You need not Explain............
But If You Loose You Should not be there to Explain......
|
|
|
|
|
hi friends
i have a server that installed o it a sql server 2000
i want to create a connection to the database on this sql server.
my server name is (local);
when i try to login into my database from query analyzer:
i type "(local)" instead of server name and username and password of a auser that i created for login to database.
its worked correctly.
but when i try to do this action from my home pc, an error appear that contanis below message:
"Sqlserver does not exist or access denied."
i enter my server ip instead of "(local)" in my query analyzer from my home pc.
now how can i login to my database from my home pc????
what do i enter server name ? an ip address or else???
please help me
nobody help you...
you have to help you yourself
and this is success way.
|
|
|
|
|
(local) only works if you are logged in locally to the machine where the instance of SQL Server is installed. You will probably need to use the IP address of the machine from home, unless you have some way to resolve the hostname (like if you are logged in thru a VPN). Then you can type in your username and password into QueryAnalyzer just like you would if you were on the machine locally.
|
|
|
|
|
Video:
http://www.microsoft.com/hk/webcast/default.aspx?sid=211[^]
SQL server 2008 will help enable information technology to drive business intelligence throughout the organization. All your saved data could be easy to analyze and present by reports and charts for you to study the trends and make the right business decision.
|
|
|
|
|
Thanks for sharing!
The latest version looks good; I am considering upgrade to this 2008 version.
|
|
|
|
|
How can i pass the parameters to triggers?
|
|
|
|
|
You don't. The trigger has all the data from the insert/update/delete in special tables called inserted and deleted. Google triggers and yuo will find plenty of examples.
Hope this helps
Bob
Ashfield Consultants Ltd
|
|
|
|
|
hi..
can anybody tell me using c#.net to create advanced search like all words, anywords, and exact word, if i have to search in 5-6 tables, means if i give "red" in search text box then how can i search red in 5-6 tables and i dont know which column contains the word red.
|
|
|
|
|
Check this[^]
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
|
|
|
|
|
Actually , i am making a car website like cars.com, and i have seen in cars.com they allow search on keywords, I too want to implement that feature but how can i, bcoz i have normalized the features of car into 5-6 tables and i want to search it in that 5-6 tables.
|
|
|
|
|
Hi friends..
1. I want to know abot SQL SERVER Security(Logins, Server Roles, Credentials) under particular server.
2. And about security(users, Roles, Schemas) under particular Database.
Plz let me know detailed explanation with example.
Regards
Willington D
D.Willington
|
|
|
|
|
Try BOL or Google, its too big a subject to answer in a forum - there are loads of articles and advice out there.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hi
I was searched with google for sql security..., but i didn't get any usefull topics.., they were confused me. Thats y i posted this query.., If u have any articals plz.. let me know the URL.
Regards,
Willington D
D.Willington
|
|
|
|
|
If you cannot find a simple enough article to explain SQL security then perhaps you would be better off employing someone who does understand it to set up the security on your system. The saying 'a little knowledge is a dangerous thing' is very applicable to security.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
To big a topic to give "detailed explanation with example", and well - that would also mean I'd do your work for you.
So I'll simply say that you should read the SQL Server documentation, some books about SQL Server administration (SQL Server 2005 Administrators Companion provides a chapter on it) and "online books" from MSDN.
|
|
|
|