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. Noonoo

    Locating a table in a database.

    I may have completely misunderstood what you're after but if you want to list all column names (and data types) in a database you could run this: SELECT o.name as TableName, Column_Name, C.Data_Type FROM dbo.sysobjects o INNER JOIN information_schema.columns C ON o.Name = C.Table_Name...
  2. Noonoo

    Group By Count Value In Check Constraint

    Thanks for all your comments. It's interesting to know there's a problem with these types of constraints. I'll avoid trying them in future.
  3. Noonoo

    Group By Count Value In Check Constraint

    Thanks for your time. The syntax does’nt work but I tried your general approach of calling a function in the constraint, which seems like a good trick. Not passing any parameters but returning a count of IDs with more than one ‘On’ Bit field. The check constraint could’nt cope though and would...
  4. Noonoo

    Group By Count Value In Check Constraint

    Hi people. I'd like to set a check constraint on a table that says, if the count of ON bit fields for a particular ID is greater than one then don't allow the update/insert. i.e. SELECT Count(ID) FROM tableName WHERE bitField = 1 GROUP BY ID HAVING COUNT(*) > 1 should be zero or null I'm...
  5. Noonoo

    Retrieve available database names on a server without using sp_helpdb

    Hi. Thanks for the reply. Done some research. sp_MSforeachdb provides a way of looping through the databases on server and apparently carrying actions on them. I can see uses for this but I need to retrieve just the operable and fully available database names and do stuff with them.
  6. Noonoo

    Retrieve available database names on a server without using sp_helpdb

    Hi Folks. I'm sure one of you out there must have come across this problem. I'd like to put the names of all active databases in a cursor so I can loop through them. They have to be up and running though - not in single-user mode for example - as the query I'm using falls over when trying to...
  7. Noonoo

    Alter stored procedures in multiple databases

    Thanks for the prompt reply. If I was building from scratch would do what you suggest. I agree with your logic and understand what you're saying. Unfortunately, I've inherited this system and, trust me, changing the way stored procedures are referenced is too big a task to take on right now. I...
  8. Noonoo

    Alter stored procedures in multiple databases

    Can anyone help please. Someone out there must already have a solution. I regularly have to copy stored procedures from a source development database to many other databases. I do this by copying the CREATE PROCEDURE code and pasting it to all the other databases. What I would like is a way...
  9. Noonoo

    setTimout - other Window field value setting

    Hi. I've written a function which sets a variable (ParentWin) equal to the current window's opener. If an opener does'nt exist it opens a new window and sets the ParentWin as that. This gaurantees there's another open window that can referenced. I've written a 2nd function, which takes two...
  10. Noonoo

    Convert String to Hexadecimal

    Thanks for the replies. tsuji, your code does exactly what I need.
  11. Noonoo

    Convert String to Hexadecimal

    Hi people. Can anyone tell me how I can convert a string into Hexadecimal values. e.g 'BaD' to '%42%61%44'. I've tried Hex() which seems to only work with numerics and ASCW(), which converts to decimal but can't seem to find anthing to do this. The reason I'm trying to do this is I'm building...
  12. Noonoo

    Column Length Check Contraint

    That's worked a treat. Cheers.
  13. Noonoo

    Column Length Check Contraint

    Hello. I'd like to constrain a table column to be either 11 numeric digits long or null. Though it's not strictly correct I can make the column Int to force numeric values but it's specifying Length within the constraint I'm having problems with. I've spent a while trying to achieve this but...
  14. Noonoo

    QS encryption - how to de-encrypt - 5.30am urgent - please help!

    Hi, I've tweaked the functions a little bit. You should have a bit more joy now: Here's some revised code showing a value being encrypted and decrypted: '*** start of code *** 'encrypt function code Function Encrypt(TheString) Dim x, i, tmp For i = 1 To Len( TheString ) x = Mid( Thestring...
  15. Noonoo

    Notification on query result joining two databases

    Rocking! Thanks. Problem solved. Should anyone else come across this article and want to find out what else the xp_sendmail stored procedure does you could try http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_xp_aa-sz_6hbg.asp.
  16. Noonoo

    Notification on query result joining two databases

    Hello. I have a query which joins tables from 2 databases. If this query returns any records I'd like to send an email notification. I first thought of using a DTS package but it only seems to be possible to execute a task against one connection and therefore one database at a time. I also...
  17. Noonoo

    Constraint Syntax Query

    Thanks James. Took a little bit of fiddling but it's working a treat
  18. Noonoo

    Constraint Syntax Query

    Hello. I'm trying to create a constraint on a table which prevents null values in colummn B when the column A bit field is '1'. It seems that a contraint is the ideal way and I've tried the following. Alter Table TableName Add Contraint CN_ContraintName Check (B IS NOT NULL where A = 1)...
  19. Noonoo

    Transactional Replication Problem With Primary Keys

    Hello. I'm trying to set-up transactional replication between 2 servers. I've followed the wizard to replicate the table, am warned only tables with primary keys can be published in transactional replication, only to to find the 'specify articles' menu does not allow selection of tables with...

Part and Inventory Search

Back
Top