Showing posts with label fields. Show all posts
Showing posts with label fields. Show all posts

Wednesday, March 28, 2012

How to insert date in database table in sql server

I have one form with fields name,date of birth , age.
I would like to get the input from user and store it to sql database
table.
After I stored , while viewing the table records, the dateof birth
field is 01.01.1900, how to store the exact date in database.
what datatype i have to store in database table.
Thanx & Regards,
SSGSSG wrote:
> I have one form with fields name,date of birth , age.
> I would like to get the input from user and store it to sql database
> table.
> After I stored , while viewing the table records, the dateof birth
> field is 01.01.1900, how to store the exact date in database.
> what datatype i have to store in database table.
> Thanx & Regards,
> SSG
Use datetime datatype and you can get plenty of information regarding
it in BOL.
Regards
Amish Shah

How to insert date in database table in sql server

I have one form with fields name,date of birth , age.
I would like to get the input from user and store it to sql database
table.
After I stored , while viewing the table records, the dateof birth
field is 01.01.1900, how to store the exact date in database.
what datatype i have to store in database table.
Thanx & Regards,
SSGSSG wrote:

> I have one form with fields name,date of birth , age.
> I would like to get the input from user and store it to sql database
> table.
> After I stored , while viewing the table records, the dateof birth
> field is 01.01.1900, how to store the exact date in database.
> what datatype i have to store in database table.
> Thanx & Regards,
> SSG
Use datetime datatype and you can get plenty of information regarding
it in BOL.
Regards
Amish Shah

how to insert data into to image datatype

i have a table gg. It has two fields one is ggno int, ggfig image .
how can i insert into the record into 'gg' table help me with examppleDepends on your coding language, there should be many exmaples out
there for each coding language. Normally you will need to open the
stream and fill a blob, but that is different in every coding language.

HTH, Jens Suessmeyer.

--
http://www.sqlserver2005.de
--

How to insert an image into a table?..is it possible to insert?

I have a created a table pub_info with two fields 1.pub_id string 2.logo
image ...now i want to insert images into logo column and i want to retreive
that into my c#.net program...How can i do that'..please helpYou want to start here:
http://support.microsoft.com/defaul...kb;en-us;317016
http://support.microsoft.com/defaul...kb;en-us;309158
http://support.microsoft.com/defaul...kb;en-us;317043
http://support.microsoft.com/defaul...kb;en-us;317701
-oj
"saroja" <saroja@.discussions.microsoft.com> wrote in message
news:02231950-4493-4F6E-9126-E866337BB032@.microsoft.com...
>I have a created a table pub_info with two fields 1.pub_id string 2.logo
> image ...now i want to insert images into logo column and i want to
> retreive
> that into my c#.net program...How can i do that'..please helpsql

Wednesday, March 21, 2012

How to improve the performance of a query?

I have a table called DMPD_Product_Lookup_Dom. It is a lookup table which contains values for certain fields of other tables in the database.
This takes long time to run.
Is there any way to improve performance of this query ??

SELECT
BNAD.Benefit_Admin_Cat_CD AS 'AdminCategory',
DOM1.Value_Description AS 'AdminCategoryDesc',
BNAD.Benefit_Component_Name_CD AS 'BenefitAdmin',
DOM2.Value_Description AS 'BenefitAdminDesc',
BNDT.Benefit_Rider_CD AS 'BenefitRider',
DOM3.Value_Description AS 'BenefitRiderDesc',
BNDT.Benefit_Exception_Ind AS 'Exception',
BNDT.Benefit_Detail_Desc_CD AS 'BenefitDetail',
DOM4.Value_Description AS 'BenefitDetailDesc',
DMCS.Cost_Share_Value_Type_CD AS 'CSValueType',
DOM5.Value_Description AS 'CSValueTypeDesc',
DMCS.Cost_Share_Value AS 'CS_Value',
DMCS.Cost_Share_Rule_Cat_CD AS 'CS_Rule_Cat_CD',
DOM6.Value_Description AS 'CS_Rule_Cat_Value',
BNCS.Cost_Share_Rule_Type_CD AS 'CS_Rule_Type_CD',
DOM7.Value_Description AS 'CSRuleTypeDesc',
BNCS.Cost_Share_Mbr_Family_Ind AS 'MemberOrFamily',
DOM8.Value_Description AS 'MemberOrFamilyDesc',
BNCS.Network_Ind AS 'NetworkInd'
FROM
prdtrk01..DMPD_Product_Lookup_Dom DOM1,
prdtrk01..DMPD_Product_Lookup_Dom DOM2,
prdtrk01..DMPD_Product_Lookup_Dom DOM3,
prdtrk01..DMPD_Product_Lookup_Dom DOM4,
prdtrk01..DMPD_Product_Lookup_Dom DOM5,
prdtrk01..DMPD_Product_Lookup_Dom DOM6,
prdtrk01..DMPD_Product_Lookup_Dom DOM7,
prdtrk01..DMPD_Product_Lookup_Dom DOM8,
prdtrk01..BNAD_Benefit_Admin BNAD,
prdtrk01..BNDT_Benefit_Detail BNDT,
prdtrk01..BNCS_Cost_Share_Rule BNCS,
prdtrk01..DMCS_Cost_Share_Dom DMCS
WHERE
BNAD.Benefit_Admin_ID = BNCS.Benefit_Admin_ID
AND BNDT.Benefit_Detail_ID = BNCS.Benefit_Detail_ID
AND DMCS.Cost_Share_Rule_ID = BNCS.Cost_Share_Rule_ID
AND DOM1.Product_Domain_Entity = "BNAD"
AND DOM1.Product_Attribute_Type = "Benefit_Admin_Cat_CD"
AND DOM1.Domain_Value = BNAD.Benefit_Admin_Cat_CD
AND DOM2.Product_Domain_Entity = "BNAD"
AND DOM2.Product_Attribute_Type = "Benefit_Component_Name_CD"
AND DOM2.Domain_Value = BNAD.Benefit_Component_Name_CD
AND DOM3.Product_Domain_Entity = "BNDT"
AND DOM3.Product_Attribute_Type = "Benefit_Rider_CD"
AND BNDT.Benefit_Rider_CD *= DOM3.Domain_Value
AND DOM4.Product_Domain_Entity = "BNDT"
AND DOM4.Product_Attribute_Type = "Benefit_Detail_Desc_CD"
AND DOM4.Domain_Value = BNDT.Benefit_Detail_Desc_CD
AND DOM5.Product_Domain_Entity = "DMCS"
AND DOM5.Product_Attribute_Type = "Cost_Share_Value_Type_CD"
AND DOM5.Domain_Value = DMCS.Cost_Share_Value_Type_CD
AND DOM6.Product_Domain_Entity = "DMCS"
AND DOM6.Product_Attribute_Type = "Cost_Share_Rule_Cat_CD"
AND DOM6.Domain_Value = DMCS.Cost_Share_Rule_Cat_CD
AND DOM7.Product_Domain_Entity = "BNCS"
AND DOM7.Product_Attribute_Type = "Cost_Share_Rule_Type_CD"
AND DOM7.Domain_Value = BNCS.Cost_Share_Rule_Type_CD
AND DOM8.Product_Domain_Entity = "BNCS"
AND DOM8.Product_Attribute_Type = "Cost_Share_Mbr_Family_Ind"
AND DOM8.Domain_Value = BNCS.Cost_Share_Mbr_Family_Ind
AND BNCS.Product_ID = @.Product_ID
ORDER BY
DOM1.Sort_Seq_No,
DOM1.Value_Description,
DOM2.Sort_Seq_No,
DOM2.Value_Description,
DOM3.Sort_Seq_No,
DOM3.Value_Description,
DOM4.Sort_Seq_No,
DOM4.Value_Description,
DOM5.Sort_Seq_No,
DOM5.Value_Description,
DOM6.Sort_Seq_No,
DOM6.Value_Description,
DOM7.Sort_Seq_No,
DOM7.Value_Description,
DOM8.Sort_Seq_No,
DOM8.Value_DescriptionDo you have indexes on these tables?|||

Quote:

Originally Posted by iburyak

Do you have indexes on these tables?


Yes, the tables mentioned have indexes. But i want to know is there any other way to improve the performance of this query.|||Unfortunately you didn't provide specific answer.
To help you I need to see all index compositions.
Some people think they have indexes but it could be that they are not the once that such query will use.

To view if your query uses indexes in SQL Query Analyzer go to Query Show Execution Plan.
Execute your query and point to each item and see if your indexes are actually used.|||well the performance can be boosted using the appropriate filters in the FROM clause itself. Try to use INNER and the other different appropriate joins in the clause.The default join is the CROSS join which is the worst join. So try to filter out the results as much as possible in the FROM clause. Definitely the performance will be boosted up to some instant.|||

Quote:

Originally Posted by abhishek8236

well the performance can be boosted using the appropriate filters in the FROM clause itself. Try to use INNER and the other different appropriate joins in the clause.The default join is the CROSS join which is the worst join. So try to filter out the results as much as possible in the FROM clause. Definitely the performance will be boosted up to some instant.


Thanks Everyone! The Problem has been resolved.

Monday, March 19, 2012

How to improve performance of Reports?

I HAVE REPORT WITH SEVERAL GROUPS AND FIELDS
ITS RUNNING VERY SLOW
I AM EXTRACTING EVERYTHING FROM 1 TABLE ONLY
HOW CAN I IMPROVE PERFORMANCE OF THE REPORT
CAN ANYONE FROM MICROSOFT LET ME KNOW ALL PERFORMANCE OPTIMIZATION TIPS AND TECHNIQUES FOR THIS TOOLYou'll have to be more specific:
1. How long does it take to get the data from the SELECT statement?
2. How long does it take to export the data as XML (RDL processing, from what I understand)?
3. What is the final output format? We are currently have performance problems with large PDF
reports.
I would love to see some tips for performance as well!
Jami
On Mon, 28 Jun 2004 10:27:01 -0700, Raj <Raj@.discussions.microsoft.com> wrote:
>I HAVE REPORT WITH SEVERAL GROUPS AND FIELDS
>ITS RUNNING VERY SLOW
>I AM EXTRACTING EVERYTHING FROM 1 TABLE ONLY
>HOW CAN I IMPROVE PERFORMANCE OF THE REPORT
>CAN ANYONE FROM MICROSOFT LET ME KNOW ALL PERFORMANCE OPTIMIZATION TIPS AND TECHNIQUES FOR THIS TOOL|||Take a look at this
http://blogs.msdn.com/tudortr/archive/2004/06/28/167969.aspx
--
Tudor Trufinescu
Dev Lead
Sql Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Raj" <Raj@.discussions.microsoft.com> wrote in message
news:F3580BB2-C509-40F3-BD9D-062DC03A87A0@.microsoft.com...
> I HAVE REPORT WITH SEVERAL GROUPS AND FIELDS
> ITS RUNNING VERY SLOW
> I AM EXTRACTING EVERYTHING FROM 1 TABLE ONLY
> HOW CAN I IMPROVE PERFORMANCE OF THE REPORT
> CAN ANYONE FROM MICROSOFT LET ME KNOW ALL PERFORMANCE OPTIMIZATION TIPS
AND TECHNIQUES FOR THIS TOOL|||We definitely need more information. This should not be a problem at all (at
least from a complexity viewpoint).
Bruce L-C
"Raj" <Raj@.discussions.microsoft.com> wrote in message
news:F3580BB2-C509-40F3-BD9D-062DC03A87A0@.microsoft.com...
> I HAVE REPORT WITH SEVERAL GROUPS AND FIELDS
> ITS RUNNING VERY SLOW
> I AM EXTRACTING EVERYTHING FROM 1 TABLE ONLY
> HOW CAN I IMPROVE PERFORMANCE OF THE REPORT
> CAN ANYONE FROM MICROSOFT LET ME KNOW ALL PERFORMANCE OPTIMIZATION TIPS
AND TECHNIQUES FOR THIS TOOL