 |
|
 |
In MS Sql Server 2005 I want to create a Stored procedure that will generate a report.
However I don't want to have to recreate or update stored procedures when the number of columns increase or decrease.
Here is what I am needing. I need to create a dynamic table that will increase the number of columns in that table based on the results of the select statement.
Sample: Select PartName from Parts --PartName will return anywhere between 5 to 200 results or more.
DECLARE @ToolsTrackingBoard as TABLE ( JobNumber int, [Job Name] [nvarchar](100) ...All the additional column names are the names from the (Select partname from Parts) query. )
select * from @ToolsTrackingBoard
How can I do this? I have been hunting for days.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
HI, i need the query to dump a database to or a database table to an sql dump which i can restore with the LOAD DATA INFILE.. command. Thank you in advance.
|
| Sign In·View Thread·PermaLink | 5.00/5 (1 vote) |
|
|
|
 |
|
 |
Hi,
I have a table like this one:
Num DateStart DateEnd 1 10-10-2000 12-01-2001 1 09-01-2000 12-01-2000 1 01-01-2005 12-30-2009 2 01-01-2004 01-01-2005 2 01-01-2006 01-01-2007
I have to group by Num, but only if the interval (Date) is included in another. The new DateStart needs to be the lowest DateStart and DateEnd the biggest DateEnd.
Here's the result I want: (Only the first 2 rows are grouped)
Num DateStart DateEnd 1 09-01-2000 12-01-2001 1 01-01-2005 12-30-2009 2 01-01-2004 01-01-2005 2 01-01-2006 01-01-2007
Thanks,
Martin
========================== Martin Bonneville Analyst-programmer
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi, I am working on a project which is to get an image,precisely a fingerprint image from a fingerprint reader and store into or retrieve from the database(MySQL).I understand that i can use the data type blob in MySQL,I dont know how to go about it in C#.I will really appreciate any help rendered.Thanks.
|
| Sign In·View Thread·PermaLink | 5.00/5 (1 vote) |
|
|
|
 |
|
|
 |
|
 |
Hi,
Which method is the best way to transfer realtime data from one sqlserver to another sqlserver.
Plz let me know..
Thanx...
krishna veer singh
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
:(
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi there,
I have tried running a query using the DISTINCT keyword, but the result is not what i am looking for.
The table is something like the following:
name age AA 12 BB 13 cc 18 AA 14 BB 19 If i query: Select Distinct name, age from table; i get all the rows.
I am intested in a result set that will be:
name age AA 12 BB 13 cc 18
Can anyone help?
Thank!
Edit: 1. I know that distinct works on the combination of the colunms, giving a distinct set of rows, but that is not what i need. I need it to be distincted by the name. 2. Running Select Distinct(name), age from table; doesn't give the correct result either.
modified on Sunday, October 11, 2009 10:37 AM
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Just to let you know, i solved the problem.
select distinct(name), age from table group by name; did the job.
Thanks.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi,
I have a records in datatable. I need to pass them all at a time to data base and i need to process the list in a loop.
In sqlserver I can send it as XML string.Mysql does not support xml I think.
please provide the solution and guide me.
Thanks in advance, Srinivas Mateti
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hello,
I have a SQL job in 2000 server which has VB script on that to create Folders.It is running Fine. Now I am trying to create same SQL Job in 2008 Server. The same VB script is Failing here. Error is:
Error Source= Microsoft VBScript runtime error Error Description: File already exists Error on Line 27. The step failed.
IN the VB script I am checking like this :
If Not objFSO.FolderExists(sFilePath1) Then objFSO.CreateFolder(sFilePath1) End If
Can Anyone Please help ME on this? Why its running fine on 2000 Server and Failing on 2008 server ?
Thank you for your Help....
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
This is about SQL Server, not about MySQL.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? Neen!
|
| Sign In·View Thread·PermaLink | 5.00/5 (1 vote) |
|
|
|
 |
|
 |
for example:
the database: date id score 2009-01-01 1 5 ...
How to write the sql command to query the first 3 highest-score record for each day?
Thanks.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I'm trying to use "insert... on duplicate key update" on a table with multiply unique keys, but MySQL fails to recognize them. It only recognizes the first column as a primary key. Is there anything additional I can do to force it to recognize the other four keys, or I'll have to create a procedure for this to work?
Anyone got any idea?
Where it seems there are only borderlines, Where others turn and sigh, You shall rise!
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I need to run the MSSQl Job type of feature in MYSQl.But I heard there is no job scheduling in Mysql.Is it true.??In that case how can I achive the same.Please guide me.
Thanks In advance, Srinivas Mateti
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
hello to all!!
so here's the thing i have a table lets say it tableone with the following datas
tableone ------------------ id| name| ------------------- 1 | a | 2 | b | 3 | c | 4 | d |
so i want to swap the names with id=1 and id=2 with a single update query
and the new table should look like this
tableone ------------------ id| name| ------------------- 1 | b | 2 | a | 3 | c | 4 | d |
any ideas? thank you in advance
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi all,
I am new to MySQl.Erlier I used SQL SERVER. IN MSSQL when I call stored procedure from BLL/DAL, I have to provide all non mandatory fields. No need to provide optional fields.But this is not working in MYSQl.Is it must and shold to provide all fileds(optional and mandatory).Please post your answers.
Thanks in advance. Srinivas Mateti
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
yes all the parameters from the front end should be sent as the input parameter to the procedure that u r executing.and after that in the front end application you should make the direction as output.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Thanks for the reply..here one more question we have actually we have large size of web forms...erlier when we were on MSSQL we used one SP per one Form.But if I approach the same in MySQl i need to send all parameters in evry time.Instead of that approach now we are using multiple sp's for single form(one sp per one action.).Can u tell me which method is better ..
whether one form - one sp or one form- multiple sps
Please guide me
Thanks in advance, Srinivas Mateti
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Hi
I have been searching all over. Could someone tell me if this is possible.
I would like to store a complete array in a single field.
Say for instance:
array size is array[640];
Then store that array in a single field. As far as I know there is no data type to do so.
So what I would like to have is,
------------------------- ID | Name | Array ------------------------- 1 | First | Array1 ,where Array1 is of size Array1[640] ------------------------- 2 | Second | Array2 ,where Array2 is of the same size Array2[640] ------------------------- and so forth
Is this possible?
I would really appreciate it if someone could help me.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi,
you can store all kinds of (large) data in a database (images, text files, whatever), there is at least one special field type to support this: BLOB. MySQL has several BLOB-like types.
This[^] might help you.
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Thanks for the reply. 
I forgot to mention, the array will be an Integer type.
If I use the BLOB type, will the values be the same when I retrieve the array compared to the values when I stored the array?
To my knowledge, BLOB is a binary data type. I'm not sure if BLOB uses any sort of compression, because if it does then the values won't be the same when I retrieve it.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |

BLOB does not care about the contents, it just stores it. And all field types are meant to eventually return what you stored in there. Databases don't compress data.
Luc Pattyn
Have a look at my entry for the lean-and-mean competition; please provide comments, feedback, discussion, and don’t forget to vote for it! Thank you.
Local announcement (Antwerp region): Lange Wapper? Neen!
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Ok thanks for clearing it up for me.
I think I just confused with when storing a jpeg using a blob. It is the jpeg that does the compression, not the blob.
Thank you for your help. 
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |