|
to my knowledge 8000 is max. in SQL Server 2000
Regards
KP
|
|
|
|
|
If you're using classic ADO, you must use the adLongVarChar datatype for the parameter, and use AppendChunk to write the data to the parameter rather than simply assigning the Value property.
For ADO.NET and the SQL Server data provider, use the SqlDbType.Text type.
|
|
|
|
|
Hi,
Thanks for ur reply....
I want to know how exactly to implement it in the stored procedure. Can u give me an example? It's very urgent.
Thanks,
Riz
|
|
|
|
|
Hi i am week in query,
plz solve my probs...,
the following queries,that first query and second query both are working...,
Now my question is,
What are the fields, i am getting in the two queries those want to show in single query...,
Means,in first query ur giving date in that it want to take the year only
and check with tblmonthhourdetails.sdate
and same time the tblmonthhourdetails empid want to equal with the employeemaster.empid
------------------------------------------------------------------
SELECT dbo.tblEmployeeMaster.empId, dbo.tblEmployeeMaster.empName,
dbo.tblTimeCardmain.carddate, dbo.tblTimeCardmain.reportingtime,
dbo.tblTimeCardmain.leavingtime, dbo.tblSalaryDetails.Whrs,
dbo.tblTimeCardmain.shift, dbo.tblTimeCardmain.projectid
FROM dbo.tblEmployeeMaster INNER JOIN dbo.tblTimeCardmain ON
dbo.tblEmployeeMaster.empId = dbo.tblTimeCardmain.empid INNER JOIN
dbo.tblSalaryDetails ON
dbo.tblEmployeeMaster.empId = dbo.tblSalaryDetails.EmpID
WHERE dbo.tblTimeCardmain.carddate = '5/2/2007'
AND dbo.tblTimeCardmain.app1 = 1 AND
dbo.tblTimeCardmain.projectid = 100
-----------------------------------------------------------------------
SELECT SUM(MedicalLeave) AS Ml, SUM(AnnualLeave) AS AL, EmpId
FROM dbo.tblMonthHourDetails
WHERE (DATEPART(YYYY, SDate) = 2007)
GROUP BY EmpId, SDate
-----------------------------------------------------------------------
Plz hlp me...,
-- modified at 1:05 Thursday 14th June, 2007
Magi
|
|
|
|
|
Hi Magi
Try this:
SELECT EM.empId, EM.empName, TC.carddate, TC.reportingtime,
TC.leavingtime, SD.Whrs, TC.shift, TC.projectid,
(SELECT SUM(MedicalLeave) FROM dbo.tblMonthHourDetails MHD
WHERE MHD.EmpId = EM.empId AND YEAR(MHD.SDate) = 2007) AS ML,
(SELECT SUM(AnnualLeave) FROM dbo.tblMonthHourDetails MHD
WHERE MHD.EmpId = EM.empId AND YEAR(MHD.SDate) = 2007) AS AL
FROM dbo.tblEmployeeMaster EM
INNER JOIN dbo.tblTimeCardmain TC
ON EM.empId = TC.empid
INNER JOIN dbo.tblSalaryDetails SD
ON EM.empId = SD.EmpID
WHERE TC.carddate = '5/2/2007'
AND TC.app1 = 1
AND TC.projectid = 100 I have used table aliases (EM, TC, etc) to make your query more readable. Correlated sub-queries are used to get the medical and annual leave.
Regards
Andy
|
|
|
|
|
Thanks lot...,
Its working cool,
Keep in touch,
Take care,
Magi
|
|
|
|
|
Magh_M wrote: Query doubt.
You have a question, not a doubt.
|
|
|
|
|
Hi,
I have one table like
sno name
--- ------
1 hai
2 hello
3 hai
4 hello
5 hello
6 bye
7 take care
from the above table i want to display only duplicate values like
sno name
---- ------
1 hai
2 hello
3 hai
4 hello
5 hello
how to display it ?
|
|
|
|
|
SELECT * FROM tableA WHERE name IN (SELECT name FROM tableA GROUP BY name HAVING Count(*) > 1)
Here Sub-Query retruns only those names which are present more than once and main Query returns all rows where the same is present.
Regards
KP
|
|
|
|
|
I wish to know if there is any way to create a trigger that runs when a user makes some insert / update / delete action on a table of a database and then add the same values to a table that dwells in another separate database, both Sql-Server. How can I use the table in the external database? is it possible?
Thanks.
|
|
|
|
|
hi
It is possible,
just call the tablename like
databasename.dbo.tablename
k.ravi sankar
|
|
|
|
|
If the table is not owned by dbo then?
Regards
KP
|
|
|
|
|
Yay, it worked nice!
thanks a lot, mate.
|
|
|
|
|
andreumv wrote: How can I use the table in the external database?
does this mean both databases are not in one server. if so, you need to link both using sp_addlinkedserver check online help for syntax and usage.
once after linking you can access the tables like <server>.<database>.<owner>.<table>
if both databases are on same then
<database>.<owner>.<table>
I've used both (in queries/functions/procedures) exceipt in triggers
Regards
KP
|
|
|
|
|
Hi,
I have a table in which I have four columns.
ID (primary Key)
FirstName,
LastName,
Email
I want to add another column as @@identity in this already existing
table.
How can I do that.
seema
|
|
|
|
|
If ID is an integer then you would do:
alter table MyTable alter column
ID integer identity(1,1) not null When you insert new records then you use @@identity to show the identity number that SQL-Server has allocated to your new record:
Insert into MyTable (FirstName, LastName, Email)
values ('Andy', 'Harman', 'Andy@AndysWorld.com')
Select @@Identity You can find out more about this in the SQL Server Books-Online.
Regards
Andy
|
|
|
|
|
Hi All,
I am working on SQL SERVER 2000.I have a problem of Characters maximum length.I declared a cloumn of length 2000 characters of Data type Char.But it is taking only 255 characters.even i tried with ntext,text,varchar,nvarchar datatyupes with 2000 length but it is accepting 255 characters only.No restriction from coding side as well.
Plase any help me to solve this problem.
Thanks & Regards
S.Raju.
|
|
|
|
|
I've never seen this problem. I've happily inserted much larger amounts of text. You'll have to post your code. I'm guessing that somewhere or other you have something that is truncating the text at 255 chars and that is causing the problem rather than the database.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton
My website
|
|
|
|
|
If Query Analyzer is only displaying 255 characters, that's because that's the maximum it asks for by default.
Go to Tools, Options, Results tab and increase Maximum characters per column.
|
|
|
|
|
Mike Dimmick wrote: If Query Analyzer is only displaying 255 characters...
Well thought of! I never thought that it might be what he was seeing in Query Analyzer. I just assumed his application was getting back less information that was being put in.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
* Reading: Developer Day 5
Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton
My website
|
|
|
|
|
Thanks.
Now i got the solution.
But Now In crystal Reports it is showing only 255 characters.what might be the problem?
Thanks & Regards
S.Rajeshwar
|
|
|
|
|
Hi,
I work on a project which convert a database access in mysql and I have a field
which has 9 Mb and when I try to convert this field in mysql I get the error:
Error:Unable to write to stream<br />
I put the mysql sintax:
set global max_allowed_packet=16777216
but it doesn't work.
Maybe I didn't put it right.
I put this command in my program.
Please help.
Thanks
|
|
|
|
|
Hi
I'm executing the following Xquery on SQLserver 2005.
select
policy_xml.query('/Policy/PolicyApplication/Inuserer/InsurerID'),
policy_xml.query('/Policy/PolicyApplication/Insurer/AccountIdentifier'),
policy_xml.query('/Policy/PolicyApplication/Insurer/Type'),
policy_xml.query('/Policy/PolicyApplication/Insurer/HolderName')
from policyTable
where
policy_xml.exist('/Policy/PolicyApplication/Insurer/PolicyOwner/EntityID[.="E_1"]') = 1
Its taking 50 Secs to search from 10000 records{without indexes}
The table has 3 columns sno,policy_id,policy_xml.
I have primary index on policy_id field and 1 secondary index(path index) on the table.
When I enable the index the query takes 380 secs.
The size of loan_xml column is about 110 Kb for each row. We need to keep the indexes for some more complex update Xqueries. Is there a way out to improve the performance of the XQuery we are using? Please let us also know the reasons of decrease in performance using indexes on the table. Do indexs have any issues related to XQuery performance?
Vikas Neema
|
|
|
|
|
i want to create hierarchical infragistics grid. anyone can u give me the idea about this?
|
|
|
|
|
If you've installed the grid, there are a number of tutorials associated with it. Plus, the Infagistics forums are a better place to ask for help.
Deja View - the feeling that you've seen this post before.
|
|
|
|