Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. fxthoth

    find description defined datatypes

    Hello, try this: select ownType.name, systemType.name, ownType.max_length, ownType.precision, ownType.scale, ownType.is_nullable, ownType.is_user_defined from sys.types as ownType inner join sys.types as systemType on ownType.system_type_id=systemType.user_type_id where...
  2. fxthoth

    SQL2008 -condition on # of occurances of a character in a string

    Of course, you can use directly: update @myTable set foo='new value' where (LEN(foo) - LEN(REPLACE(foo, '|' ,'')))=1 My mistake...
  3. fxthoth

    SQL2008 -condition on # of occurances of a character in a string

    Hello, try this: declare @myTable table ( id int identity primary key not null, foo varchar(100) not null ) insert into @myTable values('abc|def') insert into @myTable values('abc|def|') insert into @myTable values('abcd|efgh') insert into @myTable values('abcd|efgh|ij|kl') --select values...
  4. fxthoth

    SQL 2008 Express, adding new things don’t show intelisense?

    I have tested it also on Express 2008 and it works fine if you write all via sql code. Btw. I apologize, but on my Firefox didn't show any of adult ads. I used imagevenue a few years ago and they had any adult ads. So now I see, they have changed it. Of course first of all I tried use the...
  5. fxthoth

    SQL 2008 Express, adding new things don’t show intelisense?

    You are right, I tested it and intellisence didn't work with manually created table. But it works with sql code created tables. So I suppose this should be the solution... :)
  6. fxthoth

    Finding last 3 numbers in a string

    Hi. It really depends on what values can be there... Try this: create table example( foo varchar(100) ) insert into example values('PR10232A') insert into example values('123456A') insert into example values('65498566ABC') insert into example values('65AD123456AB') select...
  7. fxthoth

    SQL 2008 Express, adding new things don’t show intelisense?

    I tried it and it works for me. I didn't create the table, but it is showed in intellisence. Look at picture: http://img240.imagevenue.com/img.php?image=21843_file01_122_514lo.jpg This is my version of SQL Server: Microsoft SQL Server 2008 (RTM) - 10.0.1600.22 (Intel X86) Jul 9 2008...
  8. fxthoth

    FTP Uploads over 500kb fail

    Maybe it blocks antivirus or antispyware. Or net hardware like UTM. Try upload it to localhost at the same computer.
  9. fxthoth

    SQL Server 2005 Error Numbers List

    Hello, list of all errors is here for SQL Server 2005 or 2008: select * from sys.messages and here for SQL Server 2000: select * from master.dbo.sysmessages But you can catch errors in SQL Server 2005 or 2008 in T-SQL. Here is demonstration how TRY/CATCH works...
  10. fxthoth

    sql, incrementing numbers

    You can also write constraint: create table example( col1 int ) alter table example add constraint mod3 check (col1%3=0) insert into example values (0)--is ok insert into example values (1)--fails insert into example values (3)--is ok insert into example values (4)--fails
  11. fxthoth

    Convert else if to case

    Thank you both for helpfull answers.
  12. fxthoth

    Convert else if to case

    Hi. Is in T-SQL possible to do something like switch in PHP? www.php.net/switch I have this code: declare @variable int set @variable=3 if @variable=1 begin print 'a' print 'another t-sql commands continue...' end else if @variable=2 begin print 'b' print 'another t-sql commands...
  13. fxthoth

    updating email address

    Hi. First of all backup your data. Than you can use REPLACE(): select replace('myAccount@e-mail.com','e-mail.com','newe-mail.com') returns myAccount@newe-mail.com For UPDATE it could work like: update yourtable set email=replace(email,'e-mail.com','newe-mail.com')
  14. fxthoth

    Assigning unique value for each month

    In SQL server 2005 you can use DENSE_RANK(), which should do exactly what you want. declare @myTable table( start datetime, info varchar(20) ) insert into @myTable values ('20080501','Median deposit') insert into @myTable values ('20080501','Average deposits') insert into @myTable values...
  15. fxthoth

    Select Grouped Record

    Hi, try this: declare @myTable table( col1 int, col2 int ) insert into @myTable values (8,1) insert into @myTable values (8,2) insert into @myTable values (8,3) insert into @myTable values (9,2) insert into @myTable values (9,3) insert into @myTable values (10,1) insert into @myTable...
  16. fxthoth

    SQL Cross Tab Information

    Yes, it makes sense :). I tried your code in Management studio and I completely understand what you explained. Thank you very much. Star for you.
  17. fxthoth

    SQL Cross Tab Information

    Hi George. First of all I want thank you for your hard work at this forum. I really love read your answers! I have a question. Why did you use function Min()? Min(case when sitm_sapc = 6 then 'X' else null end) as cen may return 'X' or null. If I try: select min('X') --return X select...
  18. fxthoth

    sumproduct

    Hi. I suppose you need the same funcionality as in Excel function SUMPRODUCT(). Here is example, but be aware how this method work with NULL values. It will not include NULL values in your sum result. declare @mytable table ( col1 int identity not null, col2 int ) insert into @mytable...
  19. fxthoth

    joining tables from 2 different databases

    Hi, Here is example: SELECT * FROM [honza\sqlexpress].[AdventureWorks2008].[HumanResources].[Department] means: [honza\sqlexpress] = computer with SQL Server where you want connect [AdventureWorks2008] = name of database [HumanResources] = name of schema [Department] = name of table Server...

Part and Inventory Search

Back
Top