Showing posts with label provide. Show all posts
Showing posts with label provide. Show all posts

Wednesday, March 21, 2012

Detecting Carriage Returns in a column

Can anyone provide me with some SQL that will identify rows from a table where a varchar column named "Notes" contain Carriage Returns?

I know that with report writer SQR I can translate CR's to white space but I do not know of any Sybase function that will allow me to do the same, any ideas on this well would be appreciated.For Microsoft SQL Server, I'd use CharIndex. For Sybase, it would depend on which of the Sybase servers you are using. Different Sybase engines have different string handling syntaxes.

-PatP|||Thanks Pat. One other dumb question is how is a Carriage Return represented in SQL? char[13]?? THanks again for your help, I used to know this but I'm a little rusty.|||That depends on what you mean by a carriage return. ;)

The problem is complex, because different operating systems store the "line end" marker differently, and because different SQL implementations have different ways of dealing with character expressions.

In Microsoft SQL Server, you represent a lone carriage return character asChar(13)...but, based on your previous question I think you really want to find a "line end" instead of a carriage return character. If you want to find a "line end" as used in Microsoft SQL Server, then you want:Char(13) + Char(10)

-PatP

Saturday, February 25, 2012

designing database for jobs portal

Hi...
I am making a online job portal...for dat i need to make a gud database.
wud anybody be kind enuf to provide or tell me how to make a good database design...
thnx..Introduction to Data Modeling (http://www.utexas.edu/its/windows/database/datamodeling/)

Tuesday, February 14, 2012

design help

I want to keep track of products , its inventory and any faults to the
products.. Can someone provide a broad design for this ? As far as table
names and their relationship to other tables. Doesnt have to be detailed and
does not have to include data types,etc.. Thanks
It really depends on what you want to do, how much data your need to =
capture, and how you want to use the data. =20
It would seem that these are the bare minimum:
Product table
ProductID
ProductName varchar
Inventory table
InventoryID
ProductID
LogDate
InventoryQty
Defect table
ProductID
LogDate
DefectCode
Explanation
--=20
Keith
"Hassan" <fatima_ja@.hotmail.com> wrote in message =
news:uwfz3XkJEHA.3120@.TK2MSFTNGP11.phx.gbl...
> I want to keep track of products , its inventory and any faults to the
> products.. Can someone provide a broad design for this ? As far as =
table
> names and their relationship to other tables. Doesnt have to be =
detailed and
> does not have to include data types,etc.. Thanks
>=20
>
|||Does that mean the relation between product and inventory or product and
defect might be a one to one relation
"Keith Kratochvil" <sqlguy.back2u@.comcast.net> wrote in message
news:ugJKpikJEHA.2660@.TK2MSFTNGP09.phx.gbl...
It really depends on what you want to do, how much data your need to
capture, and how you want to use the data.
It would seem that these are the bare minimum:
Product table
ProductID
ProductName varchar
Inventory table
InventoryID
ProductID
LogDate
InventoryQty
Defect table
ProductID
LogDate
DefectCode
Explanation
Keith
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:uwfz3XkJEHA.3120@.TK2MSFTNGP11.phx.gbl...
> I want to keep track of products , its inventory and any faults to the
> products.. Can someone provide a broad design for this ? As far as table
> names and their relationship to other tables. Doesnt have to be detailed
and
> does not have to include data types,etc.. Thanks
>
|||Yes, product and inventory would be related on ProductID. Since there =
could be multiple inventory checks per day the other PK column could be =
InventoryID OR LogDate could be be part of the PK.
Within the Defect table I am thinking that LogDate and ProductID would =
make up the PK. Then again, LogDate could simply be part of the table =
and another column (identity, for example) could be added the PK. =20
There is not a right or wrong way to do it...you just have to pick a =
method that works for you and meets your business requirements.
--=20
Keith
"Hassan" <fatima_ja@.hotmail.com> wrote in message =
news:uTiZuDlJEHA.3944@.tk2msftngp13.phx.gbl...
> Does that mean the relation between product and inventory or product =
and[vbcol=seagreen]
> defect might be a one to one relation
>=20
> "Keith Kratochvil" <sqlguy.back2u@.comcast.net> wrote in message
> news:ugJKpikJEHA.2660@.TK2MSFTNGP09.phx.gbl...
> It really depends on what you want to do, how much data your need to
> capture, and how you want to use the data.
>=20
> It would seem that these are the bare minimum:
> Product table
> ProductID
> ProductName varchar
>=20
> Inventory table
> InventoryID
> ProductID
> LogDate
> InventoryQty
>=20
> Defect table
> ProductID
> LogDate
> DefectCode
> Explanation
>=20
>=20
> --=20
> Keith
>=20
>=20
> "Hassan" <fatima_ja@.hotmail.com> wrote in message
> news:uwfz3XkJEHA.3120@.TK2MSFTNGP11.phx.gbl...
the[vbcol=seagreen]
table[vbcol=seagreen]
detailed
> and
>=20
>

design help

I want to keep track of products , its inventory and any faults to the
products.. Can someone provide a broad design for this ? As far as table
names and their relationship to other tables. Doesnt have to be detailed and
does not have to include data types,etc.. ThanksIt really depends on what you want to do, how much data your need to =
capture, and how you want to use the data. =20
It would seem that these are the bare minimum:
Product table
ProductID
ProductName varchar
Inventory table
InventoryID
ProductID
LogDate
InventoryQty
Defect table
ProductID
LogDate
DefectCode
Explanation
--=20
Keith
"Hassan" <fatima_ja@.hotmail.com> wrote in message =
news:uwfz3XkJEHA.3120@.TK2MSFTNGP11.phx.gbl...
> I want to keep track of products , its inventory and any faults to the
> products.. Can someone provide a broad design for this ? As far as =
table
> names and their relationship to other tables. Doesnt have to be =
detailed and
> does not have to include data types,etc.. Thanks
>=20
>|||Does that mean the relation between product and inventory or product and
defect might be a one to one relation
"Keith Kratochvil" <sqlguy.back2u@.comcast.net> wrote in message
news:ugJKpikJEHA.2660@.TK2MSFTNGP09.phx.gbl...
It really depends on what you want to do, how much data your need to
capture, and how you want to use the data.
It would seem that these are the bare minimum:
Product table
ProductID
ProductName varchar
Inventory table
InventoryID
ProductID
LogDate
InventoryQty
Defect table
ProductID
LogDate
DefectCode
Explanation
Keith
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:uwfz3XkJEHA.3120@.TK2MSFTNGP11.phx.gbl...
> I want to keep track of products , its inventory and any faults to the
> products.. Can someone provide a broad design for this ? As far as table
> names and their relationship to other tables. Doesnt have to be detailed
and
> does not have to include data types,etc.. Thanks
>|||Yes, product and inventory would be related on ProductID. Since there =
could be multiple inventory checks per day the other PK column could be =
InventoryID OR LogDate could be be part of the PK.
Within the Defect table I am thinking that LogDate and ProductID would =
make up the PK. Then again, LogDate could simply be part of the table =
and another column (identity, for example) could be added the PK. =20
There is not a right or wrong way to do it...you just have to pick a =
method that works for you and meets your business requirements.
--=20
Keith
"Hassan" <fatima_ja@.hotmail.com> wrote in message =
news:uTiZuDlJEHA.3944@.tk2msftngp13.phx.gbl...
> Does that mean the relation between product and inventory or product =
and
> defect might be a one to one relation
>=20
> "Keith Kratochvil" <sqlguy.back2u@.comcast.net> wrote in message
> news:ugJKpikJEHA.2660@.TK2MSFTNGP09.phx.gbl...
> It really depends on what you want to do, how much data your need to
> capture, and how you want to use the data.
>=20
> It would seem that these are the bare minimum:
> Product table
> ProductID
> ProductName varchar
>=20
> Inventory table
> InventoryID
> ProductID
> LogDate
> InventoryQty
>=20
> Defect table
> ProductID
> LogDate
> DefectCode
> Explanation
>=20
>=20
> --=20
> Keith
>=20
>=20
> "Hassan" <fatima_ja@.hotmail.com> wrote in message
> news:uwfz3XkJEHA.3120@.TK2MSFTNGP11.phx.gbl...
the[vbcol=seagreen]
table[vbcol=seagreen]
detailed[vbcol=seagreen]
> and
>=20
>

design help

I want to keep track of products , its inventory and any faults to the
products.. Can someone provide a broad design for this ? As far as table
names and their relationship to other tables. Doesnt have to be detailed and
does not have to include data types,etc.. ThanksIt really depends on what you want to do, how much data your need to =capture, and how you want to use the data.
It would seem that these are the bare minimum:
Product table
ProductID
ProductName varchar
Inventory table
InventoryID
ProductID
LogDate
InventoryQty
Defect table
ProductID
LogDate
DefectCode
Explanation
-- Keith
"Hassan" <fatima_ja@.hotmail.com> wrote in message =news:uwfz3XkJEHA.3120@.TK2MSFTNGP11.phx.gbl...
> I want to keep track of products , its inventory and any faults to the
> products.. Can someone provide a broad design for this ? As far as =table
> names and their relationship to other tables. Doesnt have to be =detailed and
> does not have to include data types,etc.. Thanks
> >|||Does that mean the relation between product and inventory or product and
defect might be a one to one relation
"Keith Kratochvil" <sqlguy.back2u@.comcast.net> wrote in message
news:ugJKpikJEHA.2660@.TK2MSFTNGP09.phx.gbl...
It really depends on what you want to do, how much data your need to
capture, and how you want to use the data.
It would seem that these are the bare minimum:
Product table
ProductID
ProductName varchar
Inventory table
InventoryID
ProductID
LogDate
InventoryQty
Defect table
ProductID
LogDate
DefectCode
Explanation
Keith
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:uwfz3XkJEHA.3120@.TK2MSFTNGP11.phx.gbl...
> I want to keep track of products , its inventory and any faults to the
> products.. Can someone provide a broad design for this ? As far as table
> names and their relationship to other tables. Doesnt have to be detailed
and
> does not have to include data types,etc.. Thanks
>|||Yes, product and inventory would be related on ProductID. Since there =could be multiple inventory checks per day the other PK column could be =InventoryID OR LogDate could be be part of the PK.
Within the Defect table I am thinking that LogDate and ProductID would =make up the PK. Then again, LogDate could simply be part of the table =and another column (identity, for example) could be added the PK.
There is not a right or wrong way to do it...you just have to pick a =method that works for you and meets your business requirements.
-- Keith
"Hassan" <fatima_ja@.hotmail.com> wrote in message =news:uTiZuDlJEHA.3944@.tk2msftngp13.phx.gbl...
> Does that mean the relation between product and inventory or product =and
> defect might be a one to one relation
> > "Keith Kratochvil" <sqlguy.back2u@.comcast.net> wrote in message
> news:ugJKpikJEHA.2660@.TK2MSFTNGP09.phx.gbl...
> It really depends on what you want to do, how much data your need to
> capture, and how you want to use the data.
> > It would seem that these are the bare minimum:
> Product table
> ProductID
> ProductName varchar
> > Inventory table
> InventoryID
> ProductID
> LogDate
> InventoryQty
> > Defect table
> ProductID
> LogDate
> DefectCode
> Explanation
> > > -- > Keith
> > > "Hassan" <fatima_ja@.hotmail.com> wrote in message
> news:uwfz3XkJEHA.3120@.TK2MSFTNGP11.phx.gbl...
> > I want to keep track of products , its inventory and any faults to =the
> > products.. Can someone provide a broad design for this ? As far as =table
> > names and their relationship to other tables. Doesnt have to be =detailed
> and
> > does not have to include data types,etc.. Thanks
> >
> >
> >