|
check out the INFORMATION_SCHEMA views. they will give you all this data. in particular for tables in views:
select * from INFORAMATION_SCHEMA.TABLES
if you want a comprehensive data dictionary of your database, check out the link in my sig below.
|
|
|
|
|
iam having an emp table
and i want to display recs randomly each time i retrieve
with regards
ravi kiran
|
|
|
|
|
|
Are you talking about a System.Data.DataTable that's already populated and you want to pull a random record from it? Or are you talking about writing a select statement that randomly selects a row?
If it's a datatable you could use Random.Next(DataTable.Rows.Count) to get a random integer with a maximum value set to the row count.
If it's a sql query you want to write you could get a random number based on the RAND() function and the COUNT() function then write something like:
DECLARE @Id INT, @Count INT, @Rnd INT
SELECT @Count = COUNT(*) FROM table
SET @Rnd = CAST((@Count*rand())+1 AS INT)
SELECT TOP (@Count) @Id = Id FROM table ORDER BY CartNumber
SELECT * FROM table WHERE Id = @Id
If you're not using SQL 2005 you'll have to build the SELECT TOP query as a string and call EXECUTE instead.
|
|
|
|
|
Oops, a small mistake. Change this:
SELECT TOP (@Count) @Id = Id FROM table ORDER BY CartNumber
to this:
SELECT TOP (@Rnd) @Id = Id FROM table
|
|
|
|
|
on mssql:
select top 100 * from yourtable order by newid()
|
|
|
|
|
i have around 20 fields in my database.i want to print them through crystal report.but all the 20 fields cann't accomodate in one page of a crystal report.are there any other methods except sub report concepts so that i can print all my records in a single page..?(i may use A12 sheet in dot matrix printer as usually used in offices)
thanks in advance
i m pradip kishore
|
|
|
|
|
you can have multiple detail sections in your report. one more workaround is to change the report to landscape.
hope that works.
Regards
Saud
saud
|
|
|
|
|
hi saud
thanks for your reply.but i am still not able to accomodate all the fields in one page of crystal report..can you give me any tutorials link or any further help in this regard..?
thanks again..
pradip kishore
|
|
|
|
|
Hi pardeep ,
Multi detail section is your only solution. have u tried that. if u need assitance of how to add multiple detail section let me know.
saud
|
|
|
|
|
|
you have to alter your collation settings,
the default collation in sql server 2005 is latin1_general_CI_AS
CI = case insensitve
AS = Accent sensitive
you might have to change it in to Case sensitive.
do google on "SQL Server Collation" for more details.
have fun. cheers
|
|
|
|
|
Thank you very much ...
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Is there anyother alternate way to migrate blob data instead of using import column transformation and export column transformation using SSIS component. if so please tell me.
Thanks in Advance
gvr
|
|
|
|
|
hello
can i change my database collation name after i create it
and fill it with data
how please ???????
|
|
|
|
|
[ i did the same using sql 200, it is a very very tedious process, would recomment you to re install the DB using proper collation and dump in data, and re run sp's , this is much much better approach,
|
|
|
|
|
Hi,
I made a GirdView and fill it with data from database. In this GirdView
I have five columns. First column is Name of item that is represented
in this grid. I want to make items in this column url addresses so when
I click on item name it opens another page to edit the item on which I
clicked.
Can this be done? And if can, how?
Thanks!
Vasini
|
|
|
|
|
add hyperlink column to your page in the design time. you can notice smart tag at the righ top edge of the grid. hyperlink column need a url u can give the url of your required page there.
do let me know if u need further assistance
Regards
Saud
saud
|
|
|
|
|
Hi to all,
Some years ago I have made some experiences with ‘ADO.NET vNext CTP’ predecessor ObjectSpaces. Some while ago I also made my experiences with an O/R mapper (EntityBroker) from THONA Software & Consulting Ltd..
No I will give ‘ADO.NET vNext CTP’ a chance.
How good is Microsoft now?
Is ‘ADO.NET vNext CTP’ better than ObjectSpaces? And when YES which changes Microsoft has done?
Use anyone from you ‘ADO.NET vNext CTP’? Productive? J
Regards,
cyberjoe
|
|
|
|
|
I have an old asp website and trying to run it in Visual Studio 2005. It does not run. It says "This type of page is not served". Is there away to run it to fix an error?
|
|
|
|
|
dptalt wrote: I have an old asp website and trying to run it in Visual Studio 2005. It does not run. It says "This type of page is not served". Is there away to run it to fix an error?
I wouldn't think that is an error. Why would VS2005 handle classic ASP?
|
|
|
|
|
I've been perplexed by this for a while now, and have found no real solution.
I cannot find a way to create a stongly typed DataRow, without first creating a DataTable, which i don't want to do.
Basicaly, i want to wrap my business object around a datarow, so that it can be used with a data table, without exposing the table and adapter to the external code, and using the datarow to enforce the validation initialy.
Can anyone give me any pointers as to how to do this? I've tried a number of ways and been blocked by various caveats.
Cheers
Tris
[Update]
I'm thinking about using a single instance of each type of data table as a row factory, and wrap them in a static class with static members. Can anyone comment on the thread safety of this approach?
|
|
|
|
|
hey there, have you tried
System.Data.DataRow myDataRow;
Riaan Booyzen
|
|
|
|
|
hello,
Can I give a list of values in a valiable and use this variable in select query where clause with in operator
for instance
declare @list nvarchar(1000)
set @list = select words from sample
select * from emp where dept in(@list)
regards,
Uma
|
|
|
|
|
yes you can give...
You can use it something like this:
declare @tt varchar(100)<br />
declare @sql varchar(100)<br />
set @tt = '''0004'','+'''0005'','+'''0006'''<br />
set @sql='select * from mst_employees where emp_no in ('+@tt+')'<br />
exec (@sql)
Best Regards,
Apurva Kaushal
|
|
|
|