|
|
I am not sure how you are passing the binary type to the sp, I am guessing it is in error because you are passing a string to a binary field. Either convert it to binary when passing it to the sp or do a CONVERT(binary(16), @password)
I don’t believe the SQL stage is the place where you want to build you cryptology, the application should send you a encrypted string.
PS.. I assume this is MS SQL Server
John
|
|
|
|
|
Hi,
Thanks for the response.
I realised i was entering a string rather than a binary. I was simplytesting the procedure in the SQL editor to test it in preparation for use with my website. The coding of the website passes in a hashed string, hence the SQL / procedure set-up.
P.s. I did mention in the orginal post that it was an SQL2005 DB.
I deleted the post once i realised my foolish mistake.
Thanks again.
|
|
|
|
|
Hi
I am having trouble setting up SQL 2008 Express on a Novell network. I want to host the database on one of the client PCs and then connect to it from both that PC and the rest of the client PCs. However, I am unable to log in from the other client PCs. This is the first time I am setting up an SQL server, so I really have no idea where I am going wrong.
Thanks
Karl
modified on Thursday, May 14, 2009 4:56 AM
|
|
|
|
|
|
Yes, it should work. The host machine is running Windows XP but is a client on a Novell network. I'm trying to connect over TCP/IP. I am using a c# app that need to log in to the db - maybe I am setting the connection string incorrectly?
Data Source = x.x.x.x,1433\SQLEXPRESS or x.x.x.x\SQLEXPRESS,1433? ; Network Library=DBMSSOCN
Do I have to connect with a user ID and password over TCP/IP?
With the above I am not even able to connect from the host machine (it works fine when I substitute with NovellClientName\SQLEXPRESS though)
|
|
|
|
|
Like I said, I haven't used Novell in a long time, so I won't be able to duplicate anything. However, I would think you'd need to specify a username/password, unless you're specifying a Trusted_Connection. Have you checked out the connection strings bible - http://www.connectionstrings.com/sql-server-2005[^]?
Scott
|
|
|
|
|
Hay ,
I edit a stored procedure to select a Name column from various tables as the next :
Create PROCEDURE [dbo].[SelectName]<br />
@table_name sysname,<br />
@sName nvarchar(50)<br />
AS<br />
<br />
exec ( ' SELECT * FROM ' + @table_name + ' WHERE Name =' + @sName )
then when i execute it and pass the next valriables
<br />
@table_name = 'emp'<br />
@sName = 'NameTest'<br />
the next error message appear
<br />
Invalid column name 'NameTest'<br />
what the error here ,,
thanks
jooooo
|
|
|
|
|
If you add a print statement to your stored procedure, such as:
print ' SELECT * FROM ' + @table_name + ' WHERE Name =' + @sName
and execute it, you'll see this as output:
SELECT * FROM emp WHERE Name =NameTest
Msg 207, Level 16, State 1, Line 1
Invalid column name 'NameTest'.
From there you can see that it's trying to compare the Name column to what it interprets as another column name - not a text literal. You need to put the literal in quotes, so your procedure would need to look like:
exec ( ' SELECT * FROM ' + @table_name + ' WHERE Name =''' + @sName + '''')
That being said, that code is dangerous, and you should read up on SQL injection, e.g. SQL Injection Attacks and Some Tips on How to Prevent Them[^]
Scott
|
|
|
|
|
Thanks for reply
I use print as you said
<code>print ' SELECT * FROM ' + @table_name + ' WHERE Name ="' + @sName + '"'
it's ok no errors ,, but no rows are returned ,, for eg
@sName = "Jooo"
this name is already exit but no rows return ,,
I test the same statement but with another column type
<code>print ' SELECT * FROM ' + @table_name + ' WHERE ID =' + @iID
@iID = 1
it's ok and return the the required row,
what the diff between nvarchar and int column to get the int and nvarchar no
jooooo
|
|
|
|
|
The print statement that I mentioned was just to help you debug what was happening. Did you also change your exec statement as I recommended?
The difference between the nvarchar and int columns is that to find something in the nvarchar column you need to specify a text literal, which needs to be in quotes. If it's not in quotes it's going to interpret it as another column name. To find something in the int column you specify a numeric literal, which doesn't need to be in quotes, and the numerical literal won't be interpreted as a column name.
Scott
|
|
|
|
|
Err, the table 'emp' doesn't have a column 'NameTest'?
You want to try and avoid that dynamic sql stuff. No query plans and not safe.
Regards,
Rob Philpott.
|
|
|
|
|
I have a table where I need to show data where the total amount is not zero e.g
Select iName, sum(Amount) as Total
From TableA
group by iName
having Sum(Amount) <> 0
How do I filter only the following (the sum for Joe is 0)?
iName imonth Amount
JOE 1 0
JOE 2 0
JOE 3 0
and NOT the following (the sum for Joe is also 0 but I want this included)..
iName imonth Amount
JOE 1 10
JOE 2 -5
JOE 3 -5
Any help would be appreciated
Thanks
modified on Wednesday, May 13, 2009 5:16 PM
|
|
|
|
|
You need to include iMonth in your select list and grouping if you want Joe to be returned as follows:
iName imonth Total
JOE 1 10
JOE 2 -5
JOE 3 -5
because the Sum of the Amount is not 0 for each month.
Here's the adjusted query:
Select iName, imonth, sum(Amount) as Total
From TableA
group by iName, imonth
having Sum(Amount) <> 0
|
|
|
|
|
|
HI,
Iam facing problem to connect Sqlserver 2005 with this connection string
Provider=SQLOLEDB.1;Password=sa;Persist Security Info=True;User ID=sa;Initial Catalog=master;DataSource=RAYALU\SQLEXPRESS
iam Able to connect sqlserver 2000 with same above mentioned connection string.
I need some OLEDB connection string provider which works on both SqlServer2000
and Sqlserver2005.
Please Guide how to connect atleast Sqlserver2005.
Thanks,
Rayalu
|
|
|
|
|
Look at www.connectionstrings.com[^] the problem you are having I believe is with your provider. The provider clients for Sql Server 2000 and 2005 are different.
|
|
|
|
|
Hi
How I can get the Fields Database names of X Table ?
(Query or C# cod..... or both)
(i work with Access)
thank's in advance
|
|
|
|
|
Your question got voted down at least partly because there are loads of hits from Google that answer this.
BTW not by me.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi All,
I am currently working on a part of my project (using windows forms in C#.Net) which involves creating connection string based on values.
I have a simple form where the user can specify the type of database (SQL Server, Access etc.) and then give specific connection information based on the database type selected.
One thing I would like to be able to do is to allow the user to specify the OleDb provider when using an access database. I can easily allow free text entry for the provider but it would be much more user friendly if I could give the user a drop down of available providers for selection.
So... Does anybody know have I could retrieve such a list?
Thanks
...Oh, and before anybody wants to complain, I have had no luck with google
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Hi
I`m searching for the same thing.
The only thing i have found is using SQL function
EXEC master..xp_enum_oledb_providers
|
|
|
|
|
so that a customized user function can access it in order to search through it? The array should not be stored in a spreadsheet but it should be stored programmatically as a global variable.
It appears that there are limitations to the size of a function file so it cannot be stored in the customized function file itself. Plus, it does not make sense for the function to load the array each time that the function is called.
modified on Wednesday, May 13, 2009 10:27 AM
|
|
|
|
|
What are you trying to achieve? Why the need for the large array? What is it doing currently? How large is large?
Have you considered storing the array data in a table in whatever database you are using, and accessing it that way? Much better than trying to mangle Excel to behave like a database.
|
|
|
|
|
I need to develop a specialized user function that will search an array consisting of 16500+/- records and two columns. If I were to load the array each time the function is used, and if there were 10,000 records in the spreadsheet to whic the formula should be applied, it would take a great deal of time. Thus, it would be more appropriate to store the array as a global variable and to only search throuh the array in the function.
Is it possible to store the array as a global variable and to access the variable inside a customized function? To create a customized function, press Alt-F11 key at the same time and then "Insert > Module". A new customized function can be written here, but it has a certain file size limitation that will not accommodate the two dimensional array. To use the new function select "Insert > Function".
|
|
|
|
|
How is the array going to help you more then having the 16500 records in a table, and using SQL to extract the records you want?
What specifically are you doing?
|
|
|
|