Showing posts with label exists. Show all posts
Showing posts with label exists. Show all posts

Monday, March 19, 2012

how to find that the table column exists through program

i need to check that the column exist in the table if yes the update/insert value in the column else i need to add the new column like new browser name in the table.

after the search i found some thing like and make the procedure like

Dim daAs SqlDataAdapter, dsAs DataSet, dcAs DataColumn, foundsAsBoolean

Try

Conn.Open()

cmd =New SqlCommand(str, Conn)

da =New SqlDataAdapter(cmd)

ds =New DataSet

da.Fill(ds,"tbls")

ForEach dcIn ds.Tables(0).Columns

If UCase(colnames) = UCase(dc.ColumnName)Then

founds =True

ExitFor

Else

founds =False

EndIf

Next

Catch exAs Exception

Finally

Conn.Close()

EndTry

Return founds

sugesstions on this is required.................

Wednesday, March 7, 2012

How to Find if locks exists when deleting records from a table

Hi,
Please do help me in finding whether any locks exists when records from a table is being removed(deleted).
I want a step by step procedure.
regards,
Raj
Hi,
1. Login to Query analyzer
2. Execute SP_WHO and identify the process id (SPID) in whcih you are
deleting the contents of table. Check for cmd column , it will show "DELETE"
3. After getting the SPID, Execute SP_LOCK <SPID> to get the lock
information
In the type column you will have diffrent types of lock types like;
DB = Database
IDX = Index
PG = PAGE
KEY = Key
TAB = Table
EXT = Extent
Thanks
Hari
MCDBA
"Raj" <anonymous@.discussions.microsoft.com> wrote in message
news:713607B3-ED2C-4FD6-8076-909FF3A8AF18@.microsoft.com...
> Hi,
> Please do help me in finding whether any locks exists when records from a
table is being removed(deleted).
> I want a step by step procedure.
> regards,
> Raj

How to Find if locks exists when deleting records from a table

Hi,
Please do help me in finding whether any locks exists when records from a ta
ble is being removed(deleted).
I want a step by step procedure.
regards,
RajHi,
1. Login to Query analyzer
2. Execute SP_WHO and identify the process id (SPID) in whcih you are
deleting the contents of table. Check for cmd column , it will show "DELETE"
3. After getting the SPID, Execute SP_LOCK <SPID> to get the lock
information
In the type column you will have diffrent types of lock types like;
DB = Database
IDX = Index
PG = PAGE
KEY = Key
TAB = Table
EXT = Extent
Thanks
Hari
MCDBA
"Raj" <anonymous@.discussions.microsoft.com> wrote in message
news:713607B3-ED2C-4FD6-8076-909FF3A8AF18@.microsoft.com...
> Hi,
> Please do help me in finding whether any locks exists when records from a
table is being removed(deleted).
> I want a step by step procedure.
> regards,
> Raj

How to find if a file exists

Using either activeX or dos commands is there a way find whether a specified filed in a particular location exists or not?
ThanksI solved my own problem. Check out this site (Just for info).

http://www.sqldts.com/default.aspx?211|||in dos:

if exist your_file_name_with_path goto process_file