Forum Replies Created

Viewing 15 posts - 10,081 through 10,095 (of 13,460 total)

  • RE: select comma Separated values

    here is a sql 2000 compatible example; this is updating a third column in the table to contain the concatenated values;

    you might be able to adapt this example to your...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: users stored in database

    you can use the old backwards compatible sysusers view or the newer sys.sysusers view in 2005 and above:

    select * from sysusers

    select * from sys.sysusers

    that is different fromt he logins that...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Restrict Login to SSMS access to a database user

    Erik can you give a code example? I've recently found the IP address like this whenever i needed it:

    select client_net_address from sys.dm_exec_connections where session_id = @@spid,

    if there is another...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Auto Increment within Select statement

    the row_number() function will do what you are after, as long as you are in SQL 2005 and above;

    something like this will work:

    SELECT COL1,COL2,COL3,COL4,ROW_NUMBER() OVER (PARTITION BY COL1,COL2,COL3 ORDER BY...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: loading data

    if a calculated column exists in the table, you MUST supply the column names.

    insert into mytable

    select 1,2,3,4 --will no longer work.

    you must say

    insert into mytable(col1,col2,col3,col4)

    select 1,2,3,4

    show us the...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: loading data

    you cannot include the computed column name in any insert/update/delete statement;

    so if you were doing something like

    INSERT INTO SOMETABLE(PK,Value,computedvalue)

    SELECT 1,3.1415,2*(3.1415)^2

    --it must be changed to

    INSERT INTO SOMETABLE(PK,Value)

    SELECT 1,3.1415

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Convert code from Implicit to Explicit

    here's my best guess; I had trouble identifying what is supposed to be the A alias, especially since it seems to appear twice.

    SELECT

    JOB.EMPLID,

    JOB.FILE_NBR,

    PER.NAME,

    ...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: SQL 2005 Role to see database objects?

    VIEW ANY DEFINITION would give them the ability to see proc code, but not edit it; here's some examples: you can also do it to a specific schema, so...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Trigger not working as expected

    I'm a little weak on the UPDATE function, but i thought that if the column is included in the update statement, even if it is still the same value, the...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Is there any justification for really using SQL CLR

    CLR is much faster with string manipulations. there are some things that cannot be done in TSQL

    Regular expressions is one of the most common example, where it cannot be done...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Restrict Login to SSMS access to a database user

    gotcha...so you want to kill their connection if they use your the logon designated for your application and SQL Server Management Studio(or anything except your application:

    the if statement would look...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Selecting records that match user-entered keywords

    you didn't quite post enough information...

    you said Say that the user enters 'a a m' as the search terms. Given the following two simplified tables, how do I select Michael...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: Restrict Login to SSMS access to a database user

    checkai (1/19/2010)


    We have user names for applications that have higher security than we want our developers to have. However, the developers need the pwd to put into their apps to...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: does a stored procedure recognize its 'caller'

    can you have each process add a variable to the procedure call? or at least one of them? they can discover which process from a parameter, but not really from...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • RE: A "TOP 10" Query - puzzled as to why this does not work

    Richard McSharry (1/19/2010)


    "Why does posting a question to forums so often result in the answer popping into one's head immediately after posting?" :ermm:

    So true!

    by the time you take the time...

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 15 posts - 10,081 through 10,095 (of 13,460 total)