I use sql server 2005 and asp.net C#.
Is there any two-way encryption method for int column of a table?
It can be user-defined-function in sql server 2005 or C# method.
I've looked at log4jdbc (which does not support datasources), p6spy which seems to be what I am looking for but it has not been updated since 2003 which makes me nervous and lists only JBoss 3.x (we use JBoss 5), and JAMon which seems heavyweight for what I am trying to accomplish (a simple log of all SQL statements running through a JBoss application server).
I was hoping that JBoss itself would have a switch to log all the sql (as Websphere does) but I cannot find any documentation for it so that functionality might not exist.
Hello, I have an sql select query that has a group by.
I want to count all the records after the group by statement.
Is there a way for this directly from sql?
For example, having a table with users I want to select the different towns and the total number of users
select town, count(*) from user
group by town
I want to have a column with all the towns and another with the number of users in all rows.
I have this PHP/SQL query:
$sql = sprintf("SELECT * FROM %sCubeCart_filemanager WHERE filepath REGEXP '%s[\\/\\\\][^\\/\\\\]+$' AND type = '%d' AND disabled = '0' ORDER BY filepath ASC %s", $this->_config['dbprefix'], str_replace(array('\\','/'),'.',$folder), $type, $limit);
if '$folder' == 'iha9' it is finding results like 'iha91' and 'iha99' too. Something is wrong with the regular expression, but I don't know how they work, can anyone help?!
Is there a way to convert a date to a string in Sqlite? For example I am trying to get the min date in Sqlite:
SELECT MIN(StartDate) AS MinDate FROM TableName
I know in SQL Server I would use the SQL below to accomplish what I am trying to do:
SELECT CONVERT(VARCHAR(10), MIN(StartDate), 101) AS MinDate FROM TableName
Thanks!
I have a table in SQL that links to itself through parentID. I want to find the children and their children and so forth until I find all the child objects. I have a recursive function that does this but it seems very ineffective.
Is there a way to get sql to find all child objects? If so how?
Im getting that error every time I try to add a new set of data to my sql server 2008 database.
I'm running windows 7 on my development machine.
my current config is:
all:
doctrine:
class: sfDoctrineDatabase
param:
dsn: 'odbc:Driver={SQL Server Native Client 10.0};Server=localhost;database=jobeet;'
username: sa
password: ****
thanks to every one.
Hi,
How can I make a MS-SQL stored function availabe in LINQ expressions if using the Entity framework?
The SQL function was created with CREATE FUNCTION MyFunction(@name) ...). I was hoping to access it similarly to this:
var data = from c in entities.Users where MyFunction(c.name) = 3;
Unfortunately I have only .NET 3.5 available.
Hi all
I have the following model association: a student model and has_many scores.
I need to make a list showing their names and average, min, max scores. So far I am using
student.scores.average(:score) on each student, and I realise that it is doing one sql per student. How can I make the list with one joined sql?
Also how would I use that with Will_Paginate plugin?
Thank you
I right clicked on a Database in the object explorer of SQL Server 2008 Management Studio. I went to Tasks Import Data, and imported some data from a flat text file, opting to save the package on the server.
Now how the heck do I get to the package to edit or run it again? Where in SQL Server Management Studio do I go? I've expanded everything and I can't find it. It's driving me nuts.
hi,
i ve data in d sql DB using those values i ve to call a function in the system..
data in sql
location of func:c:\
namespace:calci
class name:arith
function name:add
parameter 1: 1
parameter 2: 2
now we ve use the values
c:\,calci,arith,add,1,2
using this we ve to calculate the result..
thanx..
Is it pronounced "Gewid" or is it prononced "G.U.I.D" by spelling out the letters. It seems inconsistently used. What is the proper pronountiaton? Same story goes for SQL. It seems more people say "S.Q.L." than "Sequel".
How do I close SQL Server output subwindow which appears when I run a T-SQL script from inside Visual Studio 2010? It neither has nay kind of control buttons like [x] or[-=] visible, nor any other obvious means of closing.
I have a SQL Table with a column called FullName which contains, for example, "John Smith".
How can order the data by the last name that appears in the FullName column?
For a long name like "Laurence John Fishburne", I would like to order the data by the word "Fishburne".
Thus, names are stored in the order
First Name
Middle Names
Last Name
I am using Microsoft SQL Server 2005.
I have a SQL Server Express edition with management studio and i'm trying to use the enterprise disks ("SQL Server 2005" Enterprise Edition 32-bit Server Applications") and I can't get it to give me the option of installing the server components or a server instance. What am I missing?
What are some of the methods/techniques experienced SQL developers use to determine if a particular SQL query will scale well as load increases, rows in associated tables increase etc.
How can I insert all dates in an year(or more) in a table using sql
My dates table has following structure
dates(date1 date);
Suppose I want to insert dates between "2009-01-01" to "2010-12-31" inclusive.
Is there any sql query for the above?
As the title suggests:
What is your opinion on allowing administrators to update the SQL Connection string dynamically from the application versus just showing them the connection details in the application?
Because the database connection is so important and on a heavily used system the abrupt change to the connection seems like it could cause problems. However I would think displaying the server and catalog and whether the connection is using SSPI or SQL Auth could be helpful for administrators who don't like playing with .NET config files.
Thoughts?
For my application most of my SQL queries return a specified number of rows. I'd also like to get the maximum possible number of results i.e. how many rows would be returned if I wasn't setting a LIMIT.
Is there a more efficient way to do this (using just SQL?) than returning all the results, getting the size of the result set and then splicing the set to return just the first N rows.
Is there any easy way to query a stored procedure (Oracle - PL/SQL) for what parameters it expects?
I know that I can query USER_SOURCE to get the whole procedure but I'd then have to parse the whole procedure, and if the parameter is of type [table].[column]%TYPE I'd then have to query the table schema as well.
Either using just sql or via ODP.Net.
We are in the process of switching from the C# Guid.NewGuid() random-ish guid generator to the sequential guid algorithm suggested in this post. While this seems to work well for MS SQL Server, I am unsure about the implications for Oracle databases, in which we store guids in a raw(16) field. Does anyone have any insight as to whether this algorithm would be good for creating sequential guids for Oracle as well as for MS SQL Server, or if a different variant should be used.
Thanks!
I have the following code and i want to loop through all the fields in the result of this query and populate the dictionary called field.
Given a datareader is this possible?
OracleCommand command = connection.CreateCommand();
string sql = "Select * from MYTABLE where ID = " + id;
command.CommandText = sql;
Dictionary<string, string> fields = new Dictionary<string, string>();
OracleDataReader reader = command.ExecuteReader();
I'm testing my site against SQL injection attacks and I would like to trace SqlDataSource messages sent to SQL server. How can I do that or at least get as close as I can.
Can A datatable somehow be passed into SQL Server 2005 or 2008 ?
I know the standard way seesm to be passing XML to a SP. And a datatable can easily be converted to XML somehow to do that.
What about passing a .NET object into a SP ? Is that possible ?
I remember hearing about SQL and CLR working together in 2008 somehow but I never understood.. Maybe that means you can refer to .NET objects within a Stored Procedure ?