|
Saira Tanwir wrote: CREATE PROCEDURE Describe (@table_name VarChar) AS
SET NOCOUNT OFF
DESC @table_name
GO
it would be like this:
CREATE PROCEDURE Describe (@table_name VarChar(1000)) AS
SET NOCOUNT OFF
select name from syscolumns where id =object_id (@table_name)
GO
Best Regards,
Apurva Kaushal
|
|
|
|
|
I receive currency notes in bulk sorted by serial numbers. If i make individual entry of each currency note in database table, it will grow very big, so i am storing the start range and end range of serial numbers of the notes i receive in single instance.
Index StartRange EndRange TotalNotes
1 21 30 10
2 11 17 7
3 35 45 10
4 31 35 5
Now i want to determine whether the currency note of serial number 16 is present in the database. I may also want to determie whether the serial numbers of range 29 to 33 present or not.
Please tell me how to do so ?
Imtiaz
|
|
|
|
|
Something like:
SELECT 1 FROM TABLE
WHERE @SerialNumber between StartRange and EndRange
Imtiaz Murtaza wrote: I receive currency notes in bulk sorted by serial numbers.
Really. What's your address...?
|
|
|
|
|
Imtiaz Murtaza wrote: i want to determine whether the currency note of serial number 16 is present in the database.
See Paddy Boyd's answer.
Imtiaz Murtaza wrote: I may also want to determie whether the serial numbers of range 29 to 33 present or not.
select * from TableName where startrange <=29 and endrange >=33
However, you will need a more complex query if you want to check for the case where you have one range of 25 to 30 and another of 31 to 35. This would mean that your 29 to 33 range is present, just not in one record. Maybe that isn't an issue for you.
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
Hi I have two servers one runnning sql 2000 and another running sql 2005.
i am using BI from visual studio.net 2005 and running a sql report.
server with sql 2005 has a server linked to server with sql 2000.
all query works fine but when it comes ot stored procedure it gives me below error.
TITLE: Microsoft Report Designer
------------------------------
An error occurred while retrieving the parameters in the query.
Could not find stored procedure 'SURVEY.sys.sp_procedure_params_managed'.
------------------------------
ADDITIONAL INFORMATION:
Could not find stored procedure 'sys.sp_procedure_params_managed'. (Microsoft SQL Server, Error: 2812)
I check the RPC and made them allow in both servers. i thought it could be due to compatibility issues so i changed th compatibility issue to 70 from 80 but i am still getting this error. dont know what am i doing wrong. every where i am giving an appropriate names like
servername.dbname.user.table does anyone know how to fix this problem or any one ever come across this problem
please help
|
|
|
|
|
Please tell me the easiest way to make the file ute.asp require a user name and password.
Thanks
|
|
|
|
|
Hi all , I have designed my Database in SQL Express 2005 and I want it host on SQL 2000 supported hoster (brinkster.com) ... Please advice how can i Downgrade my Database ... Generating scripts ??? Creating .BAK files ???... Urgent reply awaits ... thanks
Kaliem
|
|
|
|
|
Hi
I run what I thought was the most basic example of a table that allows a cascading delete:
CREATE TABLE TEST
(
ID tinyint NOT NULL,
PARENT_ID tinyint NULL,
CONSTRAINT PK PRIMARY KEY (ID),
CONSTRAINT FK FOREIGN KEY (PARENT_ID) REFERENCES TEST(ID) ON DELETE CASCADE
)
go
I get the error:
Introducing FOREIGN KEY constraint 'FK' on table 'TEST' may cause
cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO
ACTION, or modify other FOREIGN KEY constraints.
Msg 1750, Level 16, State 0, Server PEER170, Line 5
What am I doing wrong???
cheers,
Neil
|
|
|
|
|
Since the foreign key references a field in the same table, specifying cascade delete has the potential to create cycles.
Not sure how you would ever insert the first record in this table, unless Id = Parent_id, and clearly that row would create an infinite loop on cascade delete , trying to recursively delete itself...
|
|
|
|
|
Thanks for that. So it is basically a limitation of SQL Server.
The first row (a "top level" row) would be inserted with parent_id = NULL, therefore there would be no infinite recursion problem.
But no worries, I can workaround it.
cheers,
Neil
|
|
|
|
|
I have a simple database using SQL Server Express 2005. Given that it's the Express edition, I don't have the Import/Export features available in Visual Studio etc. I have found that I can use DTSWizard.exe (in c:\Program Files\Microsoft SQL Server\90\DTS\Binn\dtswizard.exe) to export tables, but so far, although it suggests I should be able to select multiple tables, I have only been able to export one at a time. Does anyone know how I can select all of the tables at once? My aim is simple to have an export of the complete database in order to send it to colleagues to import for themselves.
Alternatively, is there a way to write an SQL script to do this? I am almost a complete beginner using SQL databases, and also have no experience with PHP/MySQL so can't call on that knowledge to assist me.
Many thanks,
Alice
|
|
|
|
|
Hi all,
I am stuck with problem while using mysql5.0. I am using it with visualstudio2005. It doesn't allow me to store date as dd/mm/yyyy. I need to store it in this format. Kindly suggest me How it will be done? Thanks for your consideration.
|
|
|
|
|
I answered this in the C# forum where you cross-posted. Posting the same question to multiple forums is generally regarded as rude.
|
|
|
|
|
It depends upon what libraries you are using to connect to MySQL. But, for the most part, you need to know that when you save your date you need to format it yyyy-mm-dd.
See Handling Date and Time Information in Connector/NET[^]
MySQL and the .NET languages handle date and time information differently, with MySQL allowing dates that cannot be represented by a .NET data type, such as '0000-00-00 00:00:00'. These differences can cause problems if not properly handled.
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
I don't know MySQL but as a general rule databases should not be culture specific. That is the job of the GUI for your application. If MySQL supports it you should use the ISO date format yyyy-mm-dd as it is culture neutral. When you retrieve data from the database you can then format it for the culture it is to be used in. Or, when you save data to the database it should be stored in a culture neutral format.
|
|
|
|
|
I've created a report with 3 drill down groups in a table control. Issue is when the parent group is not expanded the report has a gap (white space) between the first parent item in the group and the next parent item.
-Stores
+Joe's Grocery(10)
+Mark's Grocery(1)
+etc....
Any ideas how to control the row height by what is being displayed?
Sue
|
|
|
|
|
A client has gone and ordered a new server to run my software, the new server has SQL Server 2005 installed. Are there any gotcha's that I need to watch out for when transferring an SQL Server 2000 system to SQL Server 2005. Especially when copying an existing database from one server to another.
I'm going to be googling all night, but I thought I'd see if anybody here has any advice they'd care to share.
|
|
|
|
|
You should be aware that SQL 2005 installs with all remote protocols disabled by default. You may need to configure (enable) the appropriate network protocols before you can connect to it from another node (or the internet). If the new server has the windows firewall enabled, you may also need to unblock the apprpriate TCP port (1433 IIRC).
|
|
|
|
|
Hi , I have reverse problem .. I have my DB in SQL 2005 (designed in Express edition) but my hoster supports SQL 2000 only .. Pls advice how i can do that ... I generated .BAK of my DB but it didnt work with hoster ...
|
|
|
|
|
It's likely that the only thing you can do is export your database then import it into sql 2000. You could script the schema, and perhaps use bcp to export the data. Neither backup files nor detached databases will work when moving backwards.
|
|
|
|
|
select f.financialTrendSeq
from #tempAllobligor a
left join obligor o on a.obligorSeq = o.obligorSeq
left join obligorFinancialTrend ot on o.obligorSeq = ot.obligorSeq
right outer join financialTrend f on ot.financialTrendSeq = f.financialTrendSeq
where o.quarterDate=ot.quarterdate
and ot.quarterdate = '06/30/2006'
When I join 3 tables, am not getting the result containing all financialTrend f data.
Only, financialTrends in obligorFinancialTrend ot is displayed.
Am I wrong? Can somebody please help me?
rmr
|
|
|
|
|
Hi
What is the easiest option for Exporting ALL of my SQL Server tables into a CSV file (either separate CSV files for each table or one big file with all the table columns and data) ???
I just want to Backup my SQL Server database like we backup MySQL database using phpMyAdmin. Unfortunately, my SQL hosting company does not allow backups for free.
Thanks for help
|
|
|
|
|
i want to copy one database to another using following approach:-
fill dataset1 from adapter1
copy dataset1 to dataset2
update database from dataset2 using adapter2.
But error here is:- Update unable to find TableMapping['Table'] or
DataTable 'Table'.
On Following line:- adapter.Update(ds2)
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
LoadFBGrid()
loadDS2()
copyds1to2()
End Sub
Public Sub copyds1to2()
Dim cmdBuilder As FbCommandBuilder = New FbCommandBuilder(adapter2)
ds2 = ds.Copy
adapter.Update(ds2)
End Sub
Public Sub loadDS2()
Try
ds2 = New DataSet("Destination")
con2 = New FbConnection(connectionString2)
con2.Open()
adapter2 = New FbDataAdapter("Select * from Students", con2)
adapter2.Fill(ds2, "Studets")
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
Public Sub LoadFBGrid()
Try
ds = New DataSet("Source")
con = New FbConnection(connectionString)
con.Open()
adapter = New FbDataAdapter("Select * from Students", con)
dt = New DataTable("Students")
adapter.Fill(ds, "Studets") ' copy ds change
adapter.Fill(dt)
DataGrid1.DataSource = dt
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
"You can do any thing you set to your mind" - theGhost_k8
|
|
|
|
|
Hi,I want to display two columns from one table in a Web Form dropdownlist,I've tried something
like this @"SELECT TeamA FROM Under11s.
UNION
SELECT TeamB FROM Under11s;";
But the result set mixes the columns I want them grouped together like
"TeamA"
Player1
Player2
Player3
"TeamB"
Player1
Player2
Player3
SQl Server Or MySql.
Flip Gabes
|
|
|
|
|
You are close make your query look like this;
SELECT TeamA FROM Under11s.
UNION ALL
SELECT TeamB FROM Under11s
This should work.
|
|
|
|